OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Wildebeest on 12 Mar 2005, 18:29:10

Title: Engine sound when trying to drive
Post by: Wildebeest on 12 Mar 2005, 18:29:10
Hi!

Is there a way to determine wheter a guy is trying to drive a vehicle? I want a vehicle that is out of gas to make a start engine sound when you try to use it.

thx..
Title: Re:Engine sound when trying to drive
Post by: Tomb on 12 Mar 2005, 18:47:19
well, a trigger:

condition must be:

           fuel car1 <=0.2 && bob in car1

Activation could then be a sound effect, either selected from the trigger's own list of sounds
(ye could create yer own addition to the list), or a playsound (pre-defined in the missions descr.ext file)  :-*

           car1 say "MySound"


later

Title: Re:Engine sound when trying to drive
Post by: Kyle Sarnik on 12 Mar 2005, 19:06:06
Or you can use the engine eventhandler:

Code: [Select]
? fuel _car <= 0 : _car say "startup"
exit

should work similar to the bug with BAS's chopper startup sounds (where if you tried to start it up when it was out of fuel).
Title: Re:Engine sound when trying to drive
Post by: Wildebeest on 12 Mar 2005, 19:28:09
yeah.. but it doesn't determin if you put the pedal down or not, right? Thanks anyways guys.. I'll go with your suggestions..
Title: Re:Engine sound when trying to drive
Post by: Kyle Sarnik on 12 Mar 2005, 21:56:53
yeah.. but it doesn't determin if you put the pedal down or not, right? Thanks anyways guys.. I'll go with your suggestions..

Yes, it does. Read again. Use an engine eventhandler:

this addeventhandler ["engine",{if (_this select 1) then {[_this select 0] exec "script.sqs"}}]

script.sqs will be the script I showed, plus the defination of _car which is = _this select 0  (_car = _this select 0).