The situation is this - there is an area in the module known as “The Hills” where a secret bandit camp is hidden. But I don’t want the PC to be able to go into the Hills until he learns that is where the bandit camp is. Otherwise he could just prematurely stumble upon the camp. So for the area transition trigger for the Hills I put this script in OnClick:
void main()
{
object oPC = GetClickingObject();
object oTarget = GetTransitionTarget(OBJECT_SELF);
object oWay = GetObjectByTag("WPHills");
location lLoc = GetLocation(oTarget);
if(!(GetLocalInt(oPC, "bandit") == 2))
AssignCommand(oPC,ActionJumpToObject(oWay));
else
AssignCommand( oPC, SpeakString( "This path leads back up into the Hills. It is best to not start wandering around up there unless you know where you are going." ) );
}
If it worked the way I wanted to the PC should get the text about not wandering around when they click on the trigger without knowing about the bandit camp. Once they have the conversation about the bandit camp (and the LocalInt of “bandit” now equals 2) then they can jump to the hills.
But as it is now the PC always jumps to the Hills no matter what the condition. Any help to get it to work right would be appreciated.