Hi,
I've got this script that makes the guards at a vehicle checkpoint go into "AWARE" mode and drive their truck into the middle of the road if the player is detected within the area of a trigger. The trigger is an East Detected by Resistance trigger(player is a Spetsnaz). In the On Activation field I've written "alarmzone1=true". I put a marker in the middle of the road called "roadblock1". There is a truck nearby I called "ourcar".
The beginning of my script looks something like this:
guards = _this select 0
car = _this select 1
alarm = _this select 2
block = _this select 3
blockpos = getpos block
captain = leader guards
captain moveindriver car
blockset = false
alarm = false
#guarding
?(alarm AND !blockset):titleText ["ALARM! ALARM!", "PLAIN"]; roadguard
setcombatmode "YELLOW"; captain doMove blockpos; blockset=true
~.1
goto "guarding"
I put this in the init field of the leader of the VCP guards:
[group this, ourcar, alarmzone1, roadblock1] exec "roadblock.sqs"
To test it out, I put my East player on the road and a Resistance soldier about 200 yards away with his back turned and weapons taken away. I started out the mission, ran over to the Res soldier, and he saw me and got down. I ran over to the VCP and they were just sitting there not doing anything. No text or anything, either. To make sure the trigger was really working, in the "EFFECTS" field of the trigger I put in some text "Trigger is working." Sure enough, I tried the mission again and I got the text "Trigger is working", but nothing happened again. What's wrong here? I changed the "ON ACTIVATION" to "alarm = true", and that triggered the "ALARM! ALARM!" text, but the captain still refused to drive the truck anywhere. Plus, that's not a real solution because I want to be able to use this script with different VCPs and different trigger areas(and I don't want a VCP at the northern tip of Everon going on alert because some guys at the southern tip saw me).
Anyone have any suggestions?
BTW, I'm making this an MP mission, but I've coded all my scripts to work off of one player named "aP"(for example another one makes the guards chase after aP in their truck if they see him). Can I name the other players "aP" as well?