OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: dmakatra on 04 Feb 2003, 17:53:13

Title: RUN! Or you will die!
Post by: dmakatra on 04 Feb 2003, 17:53:13
Hi! Is there some command or scipt so if you stand still for an amount of time a certain action will happen (camcreated heat in da head)? And how do I do it/get it? Plz help.

Thx in advance.

PS: I only want it to be activated in a certain area and a certain man (da player).
Title: Re:RUN! Or you will die!
Post by: macguba on 04 Feb 2003, 18:31:21
OK, first you need a trigger to start the script when the right loon is in the right place.    That I know you can do.

The script will look something like this.   ? .... : .... is the if-then command.

;put a marker when the guy is
setPos marker (getPos loon1)
_counter=1

#loop

;is the loon in the same place as the marker
?getPos marker <> getPos loon1:goto "end"

~1

_counter=_counter+1
?_counter=30:camcreate bang bang bang

goto "loop"

#end
exit

In accordance with my usual practice I won't bother attempting the syntax, it's not my strong point.    I'm not sure if or how you can check if two positions are the same, but assuming you can something along these lines should work.  It might be better to use a gamelogic rather than a marker.

So if he stays in the same place for 30 seconds its BANG time .. but if he moves the script will end and he's ok.