Aller au contenu

Photo

Encountered weird thing in battle.


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
andysks

andysks
  • Members
  • 1 650 messages

Hi all. It could be an one time thing, but here it goes. Conversation starts, trash talk etc, leads to battle using the ga_faction_join on $HOSTILE. After a couple of seconds, enemy goes invisible, reapears and starts the conversation all over again. Battle starts, same thing happens. What could cause this?

 

If it's any help, the conversation starts from a trigger, which destroys itself afterwards. Companions were there as well, and the trigger calls GetFirstPC(FALSE); Could it be that the trigger didn't destroy itself on time and refired?



#2
4760

4760
  • Members
  • 1 207 messages

That's what I would think... How about defining a "bAlreadyTriggered" variable attached to OBJECT_SELF?

If it's 0 (or it doesn't exist), continue execution of the script, and set it to 1.

If its value is already 1, just exit (I know, it shouldn't be required because the trigger is supposed to be destroyed, but in case the destruction happens too late, that's an easy workaround).



#3
andysks

andysks
  • Members
  • 1 650 messages

Hmm, it seems to have been fixed by changing

GetFirstPC(FALSE);

to

     object oPC = GetEnteringObject();
     if (!GetIsPC(oPC))
         return;

No idea why but I'll take it.