Jump to content
Sign in to follow this  
Carbone

Script helicopter medevac

Recommended Posts

Hi,

I try to make a script transporting injured so that the helicopter pilot with as little turbulence as possible, otherwise it would have an influence on the injured on board the helicopter.

Already, with this :

with _heli1 the helicopter and _unit1 unit injured

? (speed _heli1) >= 100 : // try with _unit1 setdammage +0.1 (can???)

Now, add to this, it would be nice to do is:

if during a time (in seconds or fractions of seconds) changes its altitude _heli1 more or less, but so fast (to simulate turbulence) also add setdammage +0.1 to _unit1

I hope I am clear enough in my comments ...:rolleyes:

Sorry for my english.

a+

Share this post


Link to post
Share on other sites

Your english is fine your SQS isn't :(

I don't know much about sqs but I think it will be beter to check the distance between 2 positions of the heli in a period of time and if it too far (which means the chooper is traveling too far or doing some crazy manuvers it will add damage). So let say the premission speed is 100KPH so the traveling distance in a second should be 27.7 meter per second (100000 meters /3600seconds).

Now let's try this:

private ["_firstPos", "secondPos", "_heli", "_unit"]; //Declare private variables
_heli =_this select 0;  //Who is the chopper
_unit = _this select 1;  //Who is the injured person
checkFlight = true;
while {checkFlight} do 
 {
   _firstPos = getPos _heli;
   sleep 1;
   _secondPos = getPos _heli;
   if ((_firstPos distance   _secondPos) > 27.7) then {_unit setdamage(damage _unit) + 0.1};
 };

Now place a trigger or something to stop the script by turning checkFlight = false;.

put this in a sqf file. let say checkFlight.sqf and use this to start the script

[HeliName, InjuredName] execVm "checkFlight.sqf";

Edited by shay_gman

Share this post


Link to post
Share on other sites

Okay ! :D

Sorry but I just know a bit the sqs, when I discovered the sqf ...

Anyway thank you for the answer because in view of this script is exactly what I'm looking for.

I think I changed to "Secondpos" to "_Secondpos" ok?

In Arma2, I have an error message when I call the script with a trigger :

Cond. : Me in Helico1

Act. : [Helico1, S1] execVm "checkFlight.sqf";

Message editor : type script, nothing expected

I must make a blunder somewhere still ...:rolleyes:

---------- Post added at 08:40 PM ---------- Previous post was at 07:50 PM ----------

OKAY !

The script works nickel! big thank you my friend!

The fact of adding v = it worked, have now to improve a little, like to know its state (the wounded man, before he dies) and it's all good!

Thks

---------- Post added at 09:03 PM ---------- Previous post was at 08:40 PM ----------

With getPosATL, it also works with the altitude and this is how I modified :

private ["_firstPos", "_secondPos", "_altpos", "_alt1pos","_heli", "_unit"]; //Declare private variables

_heli =_this select 0; //Who is the chopper

_unit = _this select 1; //Who is the injured person

checkFlight = true;

while {checkFlight} do

{

_firstPos = getPos _heli;

sleep 1;

_secondPos = getPos _heli;

if ((_firstPos distance _secondPos) > 27.7) then {_unit setdamage(damage _unit) + 0.01};

_altpos = getPosASL _heli;

sleep 1;

_alt1pos = getPosASL _heli;

if ((_altpos distance _alt1pos) > 5) then {_unit setdamage(damage _unit) + 0.01};

sleep 1;

};

I put a value of 5m/s rate of climb and descent max

---------- Post added at 09:19 PM ---------- Previous post was at 09:03 PM ----------

And now, with 2 logic triggers :

trigger1

cond : (getdammage S1 >=0.1) and (getdammage S1 <=0.4)

act : hint"Caution feels badly injured !" -->first warning to the pilot

trigger2

cond : (getdammage S1 >=0.5) and (getdammage S1 <=0.8)

act : hint"Beware, he'll let go !" -->second warning, and then it sucks to hurt more right to pilot error !

I just tested, it is excellent! It's ok for me now ...

Edited by Carbone
I added to _v = [Helico1, S1] execVm "checkFlight.sqf"; and I have no error message

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  

×