Jump to content
circassian

The simple roadblock and checkpoint mission

Recommended Posts

I'm trying to make a mission witch i had to pass an enemy checkpoint with a civilian car "the driver is a civilian guy" and his behavior "careless". and the enemy behavior "careless"..

the problem is when the driver reaches the roadblock he doesn't stops where i want before the arm gate..

I mad the waypoint "hold"

I mad a trigger to put the engine off

I mad a trigger to setfuel 0

But the driver doesn't stops where i want and he stops out of the road or away from the gate or doesn't stops at all because he lift the trigger zone and the engine sound is keeps giving the sound of starting..

How to force the driver to stop at a specific point?? no right nor left... just a simple damn stop where i want?

Share this post


Link to post
Share on other sites

I suspect your problem can be solved using some extra conditions in your mission's waypoints (and not using hold waypoints!). There is another way: MORE SCRIPTS! The method below can be used if you want to control a group using scripts rather than editor placed entities like triggers and waypoints.

So on many missions (mainly dynamic ones where you are spawning AI rather than using editor placed units) it's better to just move the AI around in a script by using the setWPPos command. To make this work, you make just two waypoints for the group you want to control, a move followed by a cycle (no conditions set just two standard waypoints a move and a cycle). When you want to move the waypoints in the script you would do:

[myGroup, 0] setwppos _pos
[myGroup, 1] setwppos _pos

You would usually initialise "myGroup" using the init line of the group leader in the editor: myGroup = group this; Would initialise the global variable myGroup to provide a reference to the group of a given editor placed unit (you can't create groups on the fly, all the groups you are going to use in the mission must be pre-placed in the editor).

The above script will actually move the move waypoint you placed (waypoint 1 in the editor waypoint order list) and a second move waypoint (waypoint 0) which is invisible in the editor but every group has, its initial placement corresponds to the group leader's initial editor placed position. The cycle (waypoint 2 in the editor) doesn't get moved anywhere but causes the AI to cycle between their two move waypoints (the invisible one and the one you placed), since you are moving both of these to the same spot the AI will always go to that waypoint.

Also the above method really comes into its own when scripting dynamic missions where you want to spawn AI into an empty group, because you know that the spawned units will always go to a single position, there's no need to try to force them to start a waypoint chain again.

Edited by *Zeewolf*

Share this post


Link to post
Share on other sites

hi,

IMHO, the best solution is to set your waypoint position as *Zeewolf* said but on a road ID. Another solution would be to use a doMove command which is a bit more precise than move/waypoint command.

init.sqs

;*******************************
;Init Script by Nikiller v0.9b
;contact: nikillerofp@hotmail.fr
;*******************************

nik_host=local server

[car1,640] exec "move_to_id.sqs"

exit

move_to_id.sqs

;**********************************************
;Move To ID Script by Nikiller v0.9b
;Order a unit to move at ID
;Note: put a game logic named server on the map
;contact: nikillerofp@hotmail.fr
;example: [car1,640] exec "script.sqs"
;**********************************************

if nik_host then {} else {goto "ende"}

_u  = _this select 0
_id = _this select 1

_o=object _id
_pos=getPos _o

? alive _u: _u doMove _pos

#ende

exit

Road ID example:

dHTk7sml.jpg

cya.

Nikiller.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×