Jump to content

Home

Question about script a conditional


Recommended Posts

At the moment, I'm trying to find a conditional that would set my newly created recruitment character apart from the one he shares a tag with.

 

My question is, would it be possible, and if so, what would it look like, to have a script that would check to see if an NPC was in your three character party, by looking for it's .utc name rather than its tag.

 

And if it's not possible, does anyone have any ideas of what I could do?

 

I'm using the Disciple's tag for the character, just so you know.

Link to comment
Share on other sites

Why can't you use the tag? If your character has Disciple tag , there's no problem in using this tag if it's in the override folder...but if for some reason you really need to check something more than just the tag (if you already have Disciple's .utc in you override folder per example), you could try something like:

 

(i never used it with npcs but I did use something similar to check area names)

 

- I assume this is to beging a dialogue:

int StartingConditional()
{

   object oObject=GetObjectByTag ("my_object_tag");
   string sName = GetName(oObject);
   string sSubName = GetSubString(sName,0,5);//0 is when you start the count and 5 when you end it - example, if the name is blabla, it will check the first 5 characters (blabl)

   if  ((IsObjectPartyMember(oObject)==TRUE) && (sSubName=="blabl") && (GetDistanceBetween(GetPCSpeaker(), oObject) <= 10.0))
   {
       return TRUE;
   }
   return FALSE;
} 

 

or check the appearance:


int StartingConditional()
{

return ((IsNPCPartyMember( 11 )==TRUE) && (GetAppearanceType(GetObjectByTag ("my_object_tag")) == 333) && (GetDistanceBetween(GetPCSpeaker(), GetObjectByTag("my_object_tag")) <= 10.0));

} 

 

Where it says (GetAppearanceType(GetObjectByTag ("my_object_tag")) == 333), replace 333 per the number of the appearance line for your npc in appearance.2da

 

edit: I assumed it was for a dialogue check above but if you want a npc to do something, per example, you'll have to use:


void main ()
{
if ((IsNPCPartyMember( 11 )==TRUE) && (GetAppearanceType(GetObjectByTag ("my_object_tag")) == 333) && (GetDistanceBetween(GetPCSpeaker(), GetObjectByTag("my_object_tag")) <= 10.0));
   {
do something
   }
} 

 

hope this helps :)

Link to comment
Share on other sites

When you make a custom party member npc, don't chage the tag unless you want to review the game.

 

the first visible effect will be that you'll end up with multiple clones of your npc unless you modify the onenter script of the Ebon Hawk. Another example is if the game attempts to look for a particular npc and doesn't find it, you 'll just get stuck.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...