Jump to content
Sign in to follow this  
LovE-RicH

How to make a driver stop when i get out of a car?

Recommended Posts

How to do: I made a guy wait for me in his car, and when I get in, he starts driving (CONDITION: "player in vehicle").

But I'd like him to stop whenever I get out (eject) from the car, and wait until I get back in again. I tryed making my 1st script, but later I found out that the command "STOP" won't stop a unit following its waypoints. Anyway, here it is:

(in a trigger's "ON ACTIVATION" field I wrote "[player, driver, car] exec "script.sqs"")

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_player = _this select 0

_driver = _this select 1

_car = _this select 2

#start

?!(_player in _car) : goto "stop"

~3

goto "start"

#stop

_driver stop true

goto "backin"

#backin

?(_player in _car) : goto "continue"

~3

goto "backin"

#continue

_driver stop false

goto "start"

<span id='postcolor'>

Since it's wrong... I'm asking you beautiful people to help me.

Thanks!!!  smile.gif

Share this post


Link to post
Share on other sites

Create a trigger, type: none/repeatedly

Into it's condition field: player in name_of_car

onactivation: name_of_car setfuel 1

ondeactivation: name_of_car setfuel 0

Only prob here might be, how to get off the car, while

driving tounge.gif

But basically this is the answer to your question.

~S~ CD

Share this post


Link to post
Share on other sites

Gee, thanks man! smile.gif Now I remembered another thing:

Can a trigger be set so it activets while I'm in the car? For example, I want text to appear while the driver's taking me somewhere - I want a trigger to activate while we're driving through it, not only when I'm outside the car...

Thanks!

Share this post


Link to post
Share on other sites

Another question:

I want that a trigger can be triggered ONLY AFTER ANOTHER TRIGGER HAS BEEN TRIGGERED (don't twist your tongue). wink.gif How do I do that? Something with the condition field...?

Share this post


Link to post
Share on other sites

Into the first trigger's onActivation field type:

a=true

Into the condition field of the second trigger type:

a

:note - "a" is just any variable name, of my choice

: you can use any name here, except already used names

somewhere else in your mission, or reserved names (like

weapon, time, etc.)

~S~ CD

Share this post


Link to post
Share on other sites

Wow, I love quick answers! How do you do that? It's my first day here, on this forum, and I'm already the happiest OFP player in the world! wink.gif

Share this post


Link to post
Share on other sites

Quicker to use sync from one trig to the other , not tried it but would that work, and no scripting?

L4leather

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (L4leather @ Sep. 21 2002,05:25)</td></tr><tr><td id="QUOTE">Quicker to use sync from one trig to the other , not tried it but would that work, and no scripting?

L4leather<span id='postcolor'>

I think all this scripting is a pain, and its so much easier to just edit the maps and there missions in game  useing advanced functions and such... but anyways to do a transport make a Player  or group of players, or just AI for that matter, make the car "move" first and have the "move' synced with "get in", so when you get in the car will proceed to move to the next waypoint... same goes for getting out and haveing the car stop,  sync "get out" with the final "move" and then do the rest of the waypoints for the car and for the player or AI... simple as that.  Another thing, is you can have the AI thats driveing the CAr have a waypoint "transport unload"  and it will automatically kick you out of the car...  and give you time to move before the car moves to its next waypoint!  smile.gif

P.S. Make sure you have the waypoints very close to the car, or truck... or anything that drives smile.gif IE. Have the "move" right in front of the car by zooming really close to the editors map... and have it very close same with the "get in" and "get out"!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Quicker to use sync from one trig to the other , not tried it but would that work, and no scripting?

<span id='postcolor'>

Syncronising two triggers doesn't work.

You can syncronise a trigger with a waypoint, but not with

another trigger. wink.gif

to 4C3;

Not one of my suggestions here was related to use any external script. All could have been done by using the

INGAME EDITOR and it's wonderful features. All hints i gave

here, were really very basics in mission editing. All these

problems couldn't have been solved in an easier way than

suggested.

~S~ CD

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
Sign in to follow this  

×