3.bp.blogspot.com/-C6sLxtQD8C8/UQsngg2WymI/AAAAAAAABTE/-ivo31KamY0/s1600/local+variable+mystery.jpg
There is a local variable on a trigger (demarcated by the mushrooms). For testing, there is no way to set the local variable other than via conversation with the npc. The trigger itself has no scripts for it (heartbeat, onenter/exit etc). When initialized, the debug returns a string of 0, as expected. When told to set the value to 1, the value switches back and forth between 1 and 0. When told to set the value to 0, a string of 0 as expected. Back to 1 and it switches again. I tried storing the variable on a mushroom instead of the trigger and had the same result.
The following runs in the heartbeat of the npc to provide feedback on the value of the trigger's variable
object oTrigger = GetObjectByTag(GetLocalString(OBJECT_SELF, "sPerception_trigger"));
int nAllowedHere = GetLocalInt(oTrigger, "nPCAllowedHere");
SendMessageToPC(GetFirstPC(), "Debug: Trigger's local variable is : " + IntToString(nAllowedHere));
When I use an OnEnter script on the trigger to provide debug text on the local variable, with the same debug code as above, it always returns correctly.
Modifié par kamal_, 01 février 2013 - 02:49 .





Retour en haut







