curtcooll 1 Posted September 2, 2014 I made a game mode a while ago using vehicle re spawn but implemented my own part to the script which allows for Ai pilot to re spawn and re sync the module to call for helicopter, I made this during beta and the script no longer works. If someone could help me out. /* ================================================================================================================== Simple Vehicle Respawn Script v1.8 for Arma 3 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 = [object, Delay, Deserted timer, Respawns, Effect, Dynamic] 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 set 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 preceding 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 preceding 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, 30, 120, 0, FALSE, FALSE] execVM "vehicle.sqf" Contact & Bugreport: cwadensten@gmail.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; _crew = crew _unit; // 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_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;}; sleep 1; _unitsgrp = creategroup east; { typeof _x createUnit [getpos _unit, _unitsgrp];} foreach _crew; //helicoptertransport synchronizeObjectsAdd [_unitsGroup]; _unitsGroup = units _unitsgrp; //_unitsgroup = synchronizeObjectsAdd [helicoptertransport]; for [{ _loop = 0 },{ _loop < count _unitsGroup},{ _loop = _loop + 1}] do { _guy = _unitsGroup select _loop; //_guy setSkill (_AI_skillArray select _loop); if (_loop == 0) then {_guy moveInDriver _unit}; if (_loop == 0) then {_guy synchronizeObjectsAdd [helicopter]}; if (_loop == 1) then {_guy moveInTurret [_unit,[0]]}; //if (_loop == 1) then {_guy moveinturret _vcl_new}; sleep 0.1; }; }; }; Share this post Link to post Share on other sites
Heeeere's johnny! 51 Posted September 2, 2014 The commands "setVehicleInit" and "processInitCommands" do not exist (anymore if they ever existed, I honestly don't know). Since you didn't provide an example of what a spawn of that function might look like, especially since there's no example of the initCode, I cannot tell how you may have to change it. I don't know much about vehicle respawning as I haven't used it yet, but you may wanna know about the respawnVehicle command. I hope that helped a bit. Regards, Johnny Share this post Link to post Share on other sites
curtcooll 1 Posted September 2, 2014 Dammit i have tried using other re spawn scripts but they don't do much they re spawn vehicle but not original vehicle the script i had re spawned the vehicle and the pilot and co pilot , is there anyone that knows a workaround ---------- Post added at 12:28 ---------- Previous post was at 12:00 ---------- Fixed it now Share this post Link to post Share on other sites
Beerkan 71 Posted September 2, 2014 You are using an outdated version of the script. The latest version of this script is 1.81. However Tophe has removed this script as there are known issues with it. Use Icemans Light-Vehicle-Respawn-Script instead Share this post Link to post Share on other sites