Home   Help Search Login Register  

Author Topic: need help w/ roadblock script  (Read 458 times)

0 Members and 1 Guest are viewing this topic.

Pravit

  • Guest
need help w/ roadblock script
« on: 26 Dec 2003, 02:08:48 »
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?

Offline rhysduk

  • Former Staff
  • ****
Re:need help w/ roadblock script
« Reply #1 on: 27 Dec 2003, 15:26:09 »
First of, i really think this should be in the BETA Script board if you require some assistance ?? I mihgt be wrong though :)

I dont think you can name more than on eplayer "aP", it returns an error of "Variable used" if i am not mistaken :) ...

From what i read, i gather you have made a small example mission to test your script ??? :) :) Maybe you could upload this on this thread or email it to me ? (or IM) .... I would be happy to take a look at this script ... sounds intriguing :)

Regards

Rhys :) Look forward to testing that script dude :)
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

sabreblade

  • Guest
Re:need help w/ roadblock script
« Reply #2 on: 27 Dec 2003, 22:25:33 »
you probably know this but if a waypoint is too near where the driver of a vehicle is, the driver will not drive there. i think a way to fix that is to put on teh waypoint:

drivername domove [x,y,z]
...or something

sry if im confused and have got the wrong end of the stick! :-\ :-\

Offline rhysduk

  • Former Staff
  • ****
Re:need help w/ roadblock script
« Reply #3 on: 28 Dec 2003, 01:48:08 »
sabreblade,

what you are saying could work nicely.. i think hte only problem would be etting the exact x,y and z co-ordinates for the waypoint...

An easier way would be to place and name Gamelogics on the map.. and use something like...

_unit doMove "GameLogic Name"

OR

_unit doMove GameLogic Name

Rhys

EDIT :- Yes sabreblade, thank you, thats the right way :)
« Last Edit: 28 Dec 2003, 23:16:30 by rhysduk »
Reviewed Missions Board: Please Read the User's Guide before posting!

Pride and Joy 1 (HW100-T)

sabreblade

  • Guest
Re:need help w/ roadblock script
« Reply #4 on: 28 Dec 2003, 20:21:17 »
yeah but i thought that was obvious :-\

i think its:

_unit domove getpos gamelogicname

it works for me 8)

SB