Jump to content
Sign in to follow this  
kodansha

Water and Sea

Recommended Posts

a script exists in order not to make to drown who falls in sea, applicable to all the units ?? Thanks notworthy.gif

Share this post


Link to post
Share on other sites

Script of an unit floating once ejected

Quote[/b] ]private ["_sensor"];

_sensor = "EmptyDetector" createVehicle [0,0,0]

_calcH = {private["_result"]; _sensor setpos [getpos _this select 0, getpos _this select 1, 0]; _result = getpos _sensor select 2; _result};

_pilot = _this select 0

#check

@ ("plane" countType [vehicle _pilot] > 0) || ("helicopter" countType [vehicle _pilot] >0)

_craft = vehicle _pilot

@ !(vehicle _pilot == _craft)

@ (getpos (_pilot) select 2 ) < -1.5

#loop

?abs(_pilot call _calcH) < 3: goto "water"

; ? ((getpos _this select 2) > -0.4) : goto "water"

? speed _pilot < 1: goto "pirla"

goto "loop"

#water

? (getdammage _pilot > 0.7): _pilot setdammage 0

@ (vehicle _pilot) == _pilot

_boat = <span style='color:red'>"Raft"</span> createvehicle (getpos _pilot)

_pilot moveindriver _boat

@ (vehicle _pilot) == _pilot

goto "check"

#pirla

goto "check"

ps : replace the red part by something else that you'll define in the cpp.

Regards

TB84

Share this post


Link to post
Share on other sites

Sounds like this belongs in Mission Editing & Scripting smile_o.gif

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  

×