Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Conditional Scripting Question

Page: 1 of 1
 RedHawke
01-28-2005, 10:21 PM
#1
OK, In a dialogue, I only want a reply to be available if the PC speaker meets certain requirements, 3 to be exact;

Example: PC Must be a Jedi, Have a Repair Skill of 9 and must have at least 1500 Credits...

How in the heck do I write this one? 3 Nested IF statements, or lots of &&? :confused:

*Princess Leia Hologram* Help me Darth333 youre my only hope!

Or anyone else who wants to take a stab at this one...

:D
 Darth333
01-28-2005, 10:33 PM
#2
Originally posted by RedHawke
Or anyone else who wants to take a stab at this one...

I'll risk myself...if your computer explodes, don't blame me :D


int StartingConditional()
{
object oPC= GetPCSpeaker();
int nGold = GetGold(oPC);
int nSkill = GetSkillRank(SKILL_REPAIR, oPC);

if ((nGold >= 1500) && (GetLevelByClass(CLASS_TYPE_JEDICONSULAR, oPC) + GetLevelByClass(CLASS_TYPE_JEDIGUARDIAN, oPC) + GetLevelByClass(CLASS_TYPE_JEDISENTINEL, oPC)) && (nSkill >=9))

{
return TRUE;
}
return FALSE;
}


note that I considered that the pc has to have a repair skill of "at least" 9 and not just equal to 9. If you want just 9 well...you know what to do :D
 RedHawke
01-28-2005, 10:59 PM
#3
Thanks Darth333... It compiled, and not even any smoke from my PC... :D

And now I just have to write 27 more variants of this script... then I can test my modstrosity out. ;)

EDIT: Tested and confirmed as working. Thanks again for saving me Darth333... I edited my post above too! :D
 Mav
01-29-2005, 12:53 AM
#4
Oh no, what are you thinking up now RedHawke.....
Page: 1 of 1