Jump to content
Sign in to follow this  
anthonyfromtheuk

UAV respawn

Recommended Posts

When I place an Empty UAV and I put

CreateVehicleCrew this;

in its INIT I am able to connect to it using the terminal. but if I use a respawn script to try and run that code on respawn it doesn't seem to do anything? Does anybody have a working UAV respawn script? or is this just still really bugged, I was reading some feedback tickets about this and Im not sure this is possible

Share this post


Link to post
Share on other sites

How are you respawning the UAV? Post dat code.

---------- Post added at 10:23 ---------- Previous post was at 09:32 ----------

The reason I ask, is for all I know you're trying to use a respawn EH on the vehicle to run the code after it respawns (via the respawn script you're using) or something. Which wouldn't work. I've absolutely no idea where/how to start helping you. Though, you mentioned a ticket about the command so that could come into play. I've no idea though, there isn't enough code posted.

Edited by Iceman77

Share this post


Link to post
Share on other sites

if you use iceman`s Light Vehicle Respawn Script... advansed version it will work

i use it to respawn uavs

i got this in uav init in editor:

_nul = [this, 1, 1, {[_this] call TAG_FNC_HunterInit}] execVM "vehRespawn.sqf"; this setFuel 0.3;this addweapon "HMG_127"; this addmagazine "500Rnd_127x99_mag_Tracer_Red";this addweapon "gatling_25mm"; this addmagazine "300Rnd_25mm_shells";

and this in vehInitFunctions.sqf:

TAG_FNC_HunterInit = {

// -- Example code. You can work with the vehicle anyway you like here!! -- //

_veh = _this select 0;

createVehicleCrew _veh; _veh setFuel 0.1;_veh addweapon "HMG_127"; _veh addmagazine "500Rnd_127x99_mag_Tracer_Red";_veh addweapon "gatling_25mm"; _veh addmagazine "300Rnd_25mm_shells";

};

works fine for me

Edited by Schmoking

Share this post


Link to post
Share on other sites

I was using Simple Vehicle Respawn Script v1.81 for Arma 3 by Tophe, custom init works for everything apart from adding crew to UAVs or so it seems once they respawn they just do not show in the terminal.

I also have tried with the advanced vehicle respawn script using

TAG_FNC_UAVInit = {

_veh = _this select 0;

createVehicleCrew _veh; 

};

It works perfectly for everything but UAVs I found. Just cannot see them in the terminal after respawn.

I also tried another respawn script again with the option to set a custom init and even though it works on other vehicles it didn't work on UAVs

Share this post


Link to post
Share on other sites

are you spawning the right class terminal and uav?

a blufor soldier cant use an opfor or independant terminal or uav... i think

B_UavTerminal = blufor

O_UavTerminal = opfor

I_UavTerminal = independant

blufor:

AR-2 Darter B_UAV_01_F

MQ4A Greyhawk B_UAV_02_F

MQ4A Greyhawk (CAS) B_UAV_02_CAS_F

opfor:

Tayran AR-2 O_UAV_01_F

K40 Ababil-3 O_UAV_02_F

K40 Ababil-3 (CAS) O_UAV_02_CAS_F

independant:

AR-2 Darter I_UAV_01_F

K40 Ababil-3 I_UAV_02_F

K40 Ababil-3 (CAS) I_UAV_02_CAS_F

i got uavs respawning and they do show up in the terminal after respawn.

Edited by Schmoking

Share this post


Link to post
Share on other sites

Empty UAVs are what i wanted to use. When i put it down in the editor and put createVehicleCrew this; in the INIT it works fine but not when it respawns. Will look into just using non empty versions

Share this post


Link to post
Share on other sites

dont think it works with empty uav... u need to use blufor uav for blufor soldier.

when i place uav in editor i dont use createvehiclecrew... only in respawn script i use that

Edited by Schmoking

Share this post


Link to post
Share on other sites
dont think it works with empty uav... u need to use blufor uav for blufor soldier.

Got it working it with Icemans Script on empty UAVs, Stupid here didn't save the TAG_FNC_UAVInit when i tried it last time i noticed it was still open in my text editor and once i saved it works like a charm. Sorry to have wasted your time.

Share this post


Link to post
Share on other sites
Got it working it with Icemans Script on empty UAVs, Stupid here didn't save the TAG_FNC_UAVInit when i tried it last time i noticed it was still open in my text editor and once i saved it works like a charm. Sorry to have wasted your time.

Hiya buddy, would you mind sharing the script that you're using for the working UAV respawn, using empty UAVs and still being able to connect to them after respawn.. Thanks!

Share this post


Link to post
Share on other sites

init.sqf

[] call compile preProcessFile "vehInitFunctions.sqf";

vehInitFunctions.sqf

TAG_FNC_TankInit = {


_veh = _this select 0;
_veh disableTIEquipment true;

};

TAG_FNC_UAVInit = {

_veh = _this select 0;
createVehicleCrew _veh;

};

VehRespawn.sqf

/* ---------------------------------------------------------------------------------------------------

File: vehRespawn.sqf
Author: Iceman77

Description:
Respawn destroyed and abandoned vehicles

Parameter(s):
_this select 0: vehicle 
_this select 1: abandoned delay in minute(s) - Required
_this select 2: destroyed delay in minute(s) - Required
_this select 3: Function to call for the newly spawned vehicle (for custom armaments etc) - Optional

How to use - Vehicle Init Line: 
_nul = [this, 2, 1, {[_this] call TAG_FNC_TankInit}] execVM "vehRespawn.sqf"; << 2 minute abandoned delay, 1 minute destroyed delay, call the function that disables the TI
_nul = [this, 2, 1, {}] execVM "vehrespawn.sqf"; << 2 minute abandoned delay, 1 minute destroyed delay, NO function called for the newly respawned vehicle (standard way)

---------------------------------------------------------------------------------------------------- */


private "_veh";

_veh = _this select 0;
_abandonDelay = (_this select 1) * 60;
_deadDelay = (_this select 2) * 60;
_vehInit = _this select 3;
_dir = getDir _veh; 
_pos = getPos _veh; 
_vehtype = typeOf _veh; 
_vehName = vehicleVarName _veh;

if (isServer) then {
   While {True} Do {
       sleep 1;
       if ((alive _veh) && {canMove _veh} && {{alive _x} count crew _veh == 0}) then {
           _abandoned = true;

               for "_i" from 0 to _abandonDelay do {  
                   if (({alive _x} count (crew _veh) > 0) || (!alive _veh) || (!canMove _veh)) exitWith {_abandoned = false;};
                   sleep 1;  
               };

           if ((_abandoned) && {_veh distance _pos > 10}) then {
               deleteVehicle _veh;
               sleep 1;
               _veh = createVehicle [_vehtype, _pos, [], 0, "CAN_COLLIDE"];
               _veh setDir _dir;
               _veh setPos [_pos select 0, _pos select 1,0];
			missionNamespace setVariable [_vehName, _veh]; 
               publicVariable _vehName;
               _veh call _vehInit;
           };
       };

       if ((!alive _veh) || (!canMove _veh)) then {
           _dead = true;

               for "_i" from 0 to _deadDelay do {  
                   if (({alive _x} count (crew _veh) > 0) || (canMove _veh)) exitWith {_dead = false;};
                   sleep 1;  
               };

           if (_dead) then {
               deleteVehicle _veh;
               sleep 1;
               _veh = createVehicle [_vehtype, _pos, [], 0, "CAN_COLLIDE"];
               _veh setDir _dir;
               _veh setPos [_pos select 0, _pos select 1,0];
			missionNamespace setVariable [_vehName, _veh]; 
               publicVariable _vehName;
               _veh call _vehInit;
           };
       };
   };
};

In the editor i had an empty UAV named uav with this in its init

_nul = [this, 1, 1, {[_this] call TAG_FNC_UAVInit}] execVM "vehRespawn.sqf"; this disableTIEquipment true; createVehicleCrew this;

Still seems to work so hope that helps you.

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  

×