Jump to content

Home

Conditional Scripting Question


RedHawke

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...