It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
This is a stupid question, but I'm stuck.

I have an encounter polygon defined. when the player crosses it, a bugbear will spawn. What I want is to also set a variable called nFoundBugbear to 1 when the player crosses the encounter polygon.

How do I do this? I thought I was setting it correctly in the encounter properties but it didn't work. If it's set to 1, an NPC says something different than if it isn't, and that part is set up correctly. So I'm obviously not setting the variable correctly.

help would greatly be appreciated.
This question / problem has been solved by urknighterrantimage
That's a simple script. You can either use the script wizard or Lilac Souls script generator.

It will look something like this. Make sure you give the trigger a unique tag.

void main()
{
// Get the creature who triggered this event.
object oPC = GetEnteringObject();

// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;

// Only fire once.
//if ( GetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF)) )
// return;
//SetLocalInt(GetModule(), "DO_ONCE__" + GetTag(OBJECT_SELF), TRUE);

// Set a local integer.
SetLocalInt(oPC, "nFoundBugbear", 1);
}

Place this in the trigger's OnEnter hook. If you want the module to restrict the script to only firing once uncomment the 3 lines under "Only fire once".

In future the best place for scripting help is here.
Post edited November 29, 2014 by urknighterrant
avatar
urknighterrant: That's a simple script.
Oh excellent. Thank you so much :)
YVW.

I can't recommend the LS-TK script generator enough. It's a must-have for for folks learning to script.