Jump to content
Sign in to follow this  
case1489

I'm looking for a simple para drop script

Recommended Posts

The para jump script I am looking four allows me to fly the C130 and eject the AI. where they are all jumping out of the plane one at a time not all at once and it needs to be four MP mission

Share this post


Link to post
Share on other sites

I tried that one out but it is working and what I am looking four is a pair jump script that I can use in co30 domination 2 AI and works on all the players and let's all the players pair jump their AI out of the C130

Share this post


Link to post
Share on other sites

So you want to have the player (pilot) tell the AI when to jump?

If so - addAction is probably best

this addAction ["Green on - GO!", "parascript.sqf"];

parascript would be something like

parascript.sqf

deleted - see below post

Edited by Zodd
Code wrong

Share this post


Link to post
Share on other sites

well that 1 is not working but it did add the "Green on - GO!" to the plane but the AI did not jump out at all when I hit the action

Share this post


Link to post
Share on other sites

ahhh wow.... shocker! Stuffed up the if statement....

Should work now

_player = _this select 1;
_plane = vehicle _player;

{
if (!(_x == _player)) then {
_x action ["eject", _plane];
unassignVehicle _x;
sleep 1.5;
};
}forEach crew _plane

That will work for EVERYONE apart from the player that calls it.

If you will have other human players that you dont want to force out, you can substitute

if (!(_x == _player)) then { (Checks if _x is the player that called green on)

for

if (!(isPlayer _x)) then { (Checks if _x is a human player)

Edited by Zodd
added detail

Share this post


Link to post
Share on other sites

Thank you a lot that is what I was looking for and here's a short question will the ad action respond with the plane when the plane crashes ?

---------- Post added at 05:40 PM ---------- Previous post was at 04:35 PM ----------

Just found out that the ad action will not respond with the plane how can I get the ad action to respond with the plane

this is what i am using

handle = [this, 10, 600, 0, false, false, "this addAction ["Green on - GO!", "parascript.sqf"];nul = [this] execvm ""scripts\ubg\SHK_vehicleMarker.sqf""; this setVariable [""SHK_VehMrkGrp"", "" C130""];"] execVM "vehicle.sqf";this addAction ["Green on - GO!", "parascript.sqf"]; nul = [this] execvm "scripts\ubg\SHK_vehicleMarker.sqf"; this setVariable ["SHK_VehMrkGrp", " C130"];

and it is not working it says add ] to the first entry of "this addAction ["Green on - GO!", "parascript.sqf"];"

Edited by case1489

Share this post


Link to post
Share on other sites

What are you trying to do here ?

handle = [this, 10, 600, 0, false, false, "this addAction ["Green on - GO!", "parascript.sqf"];

That is where you are getting the ] error - there is two [ and only one ] in the above.

I am assuming you missed a ]; prior to addAction

this addAction ["Green on - GO!", "parascript.sqf"];

is all you need for the addAction

Are you having the plane separate to the player?

If you have a separate plane, put the line in its init. If you want the player to be able to do it for any plane (or vehicle for that matter) then put it in the player's init

Share this post


Link to post
Share on other sites

Okay what I'm trying to do is get to where the add action Respawns with the plane with a vehicle marker script

the vehicle marker script is

nul = [this] execvm "scripts\ubg\SHK_vehicleMarker.sqf"; this setVariable ["SHK_VehMrkGrp", " C130"];

SHK_vehicleMarker.sqf

// nul = [this] execvm "SHK_vehicleMarker.sqf";
// nul = [Vehicle,MarkerIconType,MarkerColor,WreckTimer] execvm "SHK_vehicleMarker.sqf";

if !isdedicated then {
 if (isnil "SHK_fnc_VehMrk_showHint") then {
   SHK_fnc_VehMrk_showHint = {
     hint parseText format["<t align='center'>We just lost a(n) %1!</t><br/><br/><t color='#3366ff'><img size='4' image='%2'/></t><br/><t color='#ffcc33'>%1</t><br/><br/><t>This vehicle will respawn back at its original location in 5 minutes. It is NOT able to be picked up by the wreck chopper.</t>",
     getText (configFile >> "cfgVehicles" >> typeOf _this >> "displayName"),
     getText (configFile >> "cfgVehicles" >> typeOf _this >> "picture")
     ];
   };
 };

 if (isnil "SHK_eh_VehMrk_showHint") then {
   SHK_eh_VehMrk_showHint = "";
   "SHK_eh_VehMrk_showHint" addPublicVariableEventHandler {
     (_this select 1) call SHK_fnc_VehMrk_showHint;
   };
 };
};

if !isserver exitWith {};

private ["_veh","_typ","_col","_tmr","_pos","_txt","_str","_mrk","_dmg","_crw","_man","_wrc","_tim"];
_veh = _this select 0;
_typ = if (count _this > 1) then {_this select 1} else {"mil_dot"};
_col = if (count _this > 2) then {_this select 2} else {"ColorOrange"};
_tmr = if (count _this > 3) then {_this select 3} else {1800};

_veh setVariable ["SHK_VehMrkWrecked",false];

_pos = getPos _veh;
_str = format ["SHK_VehicleMarker_%1%2%3",typeOf _veh,(_pos select 0),(_pos select 1)];

_mrk = createMarker [_str,_pos];
_mrk setMarkerAlpha 0;
_mrk setMarkerShape "ICON";
_mrk setMarkerType _typ;
_mrk setMarkerColor _col;

while {sleep 2.345; true} do {
 if (isnull _veh) exitWith {};
 if (count crew _veh > 0) exitWith {};
 if (damage _veh > 0.99) exitWith {};
};

while {sleep 0.567; !isnull _veh} do {
 _mrk setMarkerPos (getPos _veh);
 _dmg = damage _veh;
 _crw = crew _veh;

 //if (count _crw > 0) then {
   //_man = _crw select (count _crw - 1);
   // _txt = _man getVariable ["SHK_VehMrkGrp",str group _man];
   _txt = _veh getVariable "SHK_VehMrkGrp";
 //} else {
   //_txt = "";
 //};

 if (_dmg <= 0.1) then { _mrk setMarkerAlpha 1 };
 if (_dmg > 0.1) then { _mrk setMarkerAlpha 0.5 };
 if (_dmg > 0.99) then {
   _mrk setMarkerColor "ColorBlack";
   _txt = format ["%1",_txt];

   _wrc = _veh getVariable ["SHK_VehMrkWrecked",false];
   if _wrc then {
     _tim = _tmr - (time - (_veh getVariable "SHK_VehMrkWreckTime"));
     private ["_h","_m","_s"];
     _h = floor(_tim / 3600);
     _m = floor((_tim/60)-(_h*60));
     _s = floor(_tim mod 60);
     _txt = format ["%1 %2:%3:%4",_txt,
       if (_h < 10) then {format ["0%1",_h]} else {_h},
       if (_m < 10) then {format ["0%1",_m]} else {_m},
       if (_s < 10) then {format ["0%1",_s]} else {_s}
     ];

   } else {
     _veh setVariable ["SHK_VehMrkWrecked",true];
     _veh setVariable ["SHK_VehMrkWreckTime",time];

     SHK_eh_VehMrk_showHint = _veh;
     publicVariable "SHK_eh_VehMrk_showHint";
     if !isdedicated then {
       _veh call SHK_fnc_VehMrk_showHint;
     };
   };
 };

 _mrk setMarkerText _txt;
};
deleteMarker _mrk;

and the vehicle Respawn code is

veh = [this, 20, 120, 0, FALSE, FALSE] execVM "vehicle.sqf";

vehicle.sqf

/*  
=========================================================
 Simple Vehicle Respawn Script v1.7
 by Tophe of Östgöta Ops [OOPS]

 Put this in the vehicles init line:
 veh = [this] execVM "vehicle.sqf"


 Options:
 There are some optional settings. The format for these are:
 veh = [this, Delay, Deserted timer, Respawns, Effect, Static] execVM "vehicle.sqf"


 Default respawn delay is 30 seconds, to set a custom
 respawn delay time, put that in the init as well. 
 Like this:
 veh = [this, 15] execVM "vehicle.sqf"

 Default respawn time when vehicle is deserted, but not
 destroyed is 120 seconds. To set a custom timer for this 
 first put the respawn delay, then the deserted vehicle timer. (0 = disabled)
 Like this:  
 veh = [this, 15, 10] execVM "vehicle.sqf"

 By default the number of respawns is infinite. To set a limit
 First set the other values then the number of respawns you want (0 = infinite).
 Like this:
 veh = [this, 15, 10, 5] execVM "vehicle.sqf"


 Set this value to TRUE to add a special explosion effect to the wreck when respawning.
 Default value is FALSE, which will simply have the wreck disappear.
 Like this:
 veh = [this, 15, 10, 5, TRUE] execVM "vehicle.sqf"

 By default the vehicle will respawn to the point where it first
 was when the mission started (static). This can be changed to 
 dynamic. Then the vehicle will respawn to the position where it was destroyed. 
 First set all the other values then set TRUE for dynamic or FALSE for static.
 Like this:
 veh = [this, 15, 10, 5, TRUE, TRUE] execVM "vehicle.sqf"

 If you you want to set the INIT field of the respawned vehicle, first set all other 
 values, then set init commands. Those must be inside quotations.
 Like this:
 veh = [this, 15, 10, 5, TRUE, FALSE, "this setDammage 0.5"] execVM "vehicle.sqf"

 Default values of all settings are:
 veh = [this, 20, 120, 0, FALSE, FALSE] execVM "vehicle.sqf"




Contact & Bugreport: harlechin@hotmail.com

=========================================================
*/

if (!isServer) exitWith {};

// Define variables
_unit = _this select 0;
_delay = if (count _this > 1) then {_this select 1} else {30};
_deserted = if (count _this > 2) then {_this select 2} else {120};
_respawns = if (count _this > 3) then {_this select 3} else {0};
_explode = if (count _this > 4) then {_this select 4} else {false};
_dynamic = if (count _this > 5) then {_this select 5} else {false};
_unitinit = if (count _this > 6) then {_this select 6} else {};
_haveinit = if (count _this > 6) then {true} else {false};

_hasname = false;
_unitname = vehicleVarName _unit;
if (isNil _unitname) then {_hasname = false;} else {_hasname = true;};
_noend = true;
_run = true;
_rounds = 0;

if (_delay < 0) then {_delay = 0};
if (_deserted < 0) then {_deserted = 0};
if (_respawns <= 0) then {_respawns= 0; _noend = true;};
if (_respawns > 0) then {_noend = false};

_dir = getDir _unit;
_position = getPosASL _unit;
_type = typeOf _unit;
_dead = false;
_nodelay = false;


// Start monitoring the vehicle
while {_run} do 
{	
sleep (2 + random 10);
     if ((getDammage _unit > 0.8) and ({alive _x} count crew _unit == 0)) then {_dead = true};

// Check if the vehicle is deserted.
if (_deserted > 0) then
{
	if ((getPosASL _unit distance _position > 10) and ({alive _x} count crew _unit == 0) and (getDammage _unit < 0.8)) then 
	{
		_timeout = time + _deserted;
		sleep 0.1;
	 	waitUntil {_timeout < time or !alive _unit or {alive _x} count crew _unit > 0};
		if ({alive _x} count crew _unit > 0) then {_dead = false}; 
		if ({alive _x} count crew _unit == 0) then {_dead = true; _nodelay =true}; 
		if !(alive _unit) then {_dead = true; _nodelay = false}; 
	};
};

// Respawn vehicle
     if (_dead) then 
{	
	if (_nodelay) then {sleep 0.1; _nodelay = false;} else {sleep _delay;};
	if (_dynamic) then {_position = getPosASL _unit; _dir = getDir _unit;};
	if (_explode) then {_effect = "M_TOW_AT" createVehicle getPosASL _unit; _effect setPosASL getPosASL _unit;};
	sleep 0.1;

	deleteVehicle _unit;
	sleep 2;
	_unit = _type createVehicle _position;
	_unit setPosASL _position;
	_unit setDir _dir;

	if (_haveinit) then 
				{_unit setVehicleInit format ["%1;", _unitinit];
				processInitCommands;};
	if (_hasname) then 
				{_unit setVehicleInit format ["%1 = this; this setVehicleVarName ""%1""",_unitname];
				processInitCommands;};
	_dead = false;

	// Check respawn amount
	if !(_noend) then {_rounds = _rounds + 1};
	if ((_rounds == _respawns) and !(_noend)) then {_run = false;};
};
};

What I am needing is the vehicle marker script and the vehicle Respawn strip and the pair jump script in altogether like this

handle = [this, 10, 600, 0, false, false, "this addAction ["Green on - GO!", "parascript.sqf"];nul = [this] execvm ""scripts\ubg\SHK_vehicleMarker.sqf""; this setVariable [""SHK_VehMrkGrp"", "" C130""];"] execVM "vehicle.sqf";this addAction ["Green on - GO!", "parascript.sqf"]; nul = [this] execvm "scripts\ubg\SHK_vehicleMarker.sqf"; this setVariable ["SHK_VehMrkGrp", " C130"];

but as you know it is not working do to that error so I am needing something similar to this that works

Edited by case1489

Share this post


Link to post
Share on other sites

can sum 1 help me out all i need is this code to respawn on my C130j

this addAction ["Green on - GO!", "parascript.sqf"];

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  

×