Jump to content
Sign in to follow this  
denial

(request) Respawn with custom loadout

Recommended Posts

Hi all,

i'm at my first mission editing, copy and paste based scripting :)

i have set up a simple respawn script with description.ext

and a custom civilian loadout with no weapon, based on a sqf file

i need to reload the basic custom loadout at respawn for each faction (blufor, opfor and civilian)

i found some scripts that's looks like but i can't make this working.

http://www.ofpec.com/forum/index.php?topic=34253.0

http://forums.bistudio.com/showthread.php?101419-Save-loadout-script

any other solution or simple solution with the new arma3 scripting?

thanks in advance and sorry for bad grammar :)

Edited by denial

Share this post


Link to post
Share on other sites

Easiest way to do this is to set the intial spawn kit and then a function to execute a script to reassign the items on repsawn.

In your unit's init field (I'm doing it per player, but you can do it as a group as well to save time):

removeallweapons this; this unassignItem "NVGoggles"; this removeItem "NVGoggles"; removeHeadgear this; removeUniform this; this addMagazines ["100Rnd_65x39_caseless_mag_Tracer", 3]; this addWeapon "arifle_MX_F"; this addPrimaryWeaponItem "optic_Holosight"; this addEventHandler ["Respawn","_this execvm 'gear_east.sqf'"];

Just change out the gear_east with your script name.

gear_east.sqf:

removeallweapons player; 
player unassignItem "NVGoggles";
player removeItem "NVGoggles";
removeHeadgear player; 
removeUniform player; 
player addMagazines ["100Rnd_65x39_caseless_mag_Tracer", 3]; 
player addWeapon "arifle_MX_F"; 
player addPrimaryWeaponItem "optic_Holosight"; 

Obviously you don't have to add/remove this exact stuff but change it up to your needs, set the two kits to be then just add the eventHandler in. If you still need any help feel free to add me on steam "Pandi0".

Share this post


Link to post
Share on other sites
Easiest way to do this is to set the intial spawn kit and then a function to execute a script to reassign the items on repsawn.

In your unit's init field (I'm doing it per player, but you can do it as a group as well to save time):

Thank u so much! this work perfectly.

i tryied to use only the eventhandler by recall my previous sqf but didnt work, now i need only to create a single gear sqf for each unit, player. the only problem is the Carrier Lite, i cant remove it.

id = ["rifleman2", this] call compile preprocessFileLineNumbers "gear.sqf"; this addEventHandler ["Respawn","_this execvm 'gear.sqf'"];

gear.sqf

private ["_type", "_unit"];

_type = _this select 0;
_unit = _this select 1;

removeallweapons _unit;
removeAllAssignedItems _unit;
removebackpack _unit;
removeVest _unit;
removeUniform _unit;
removeHeadGear _unit;
_unit addWeapon "ItemMap";
_unit addWeapon "ItemCompass";
_unit addItem "NVGoggles";


switch (_type) do
{	
case "rifleman":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_Cap_red";
};	

case "rifleman2":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_Cap_blu";
};	

case "rifleman3":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_Cap_brn_SERO";
};	
case "rifleman4":
{
_unit addUniform "U_C_Commoner1_1";
_unit addHeadgear "H_MilCap_ocamo";
};
case "pellegrino":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_Cap_red";
};	

case "pellegrino2":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_Cap_blu";
};	

case "pellegrino3":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_Cap_brn_SERO";
};	

case "pellegrino4":
{
_unit addUniform "U_C_Poloshirt_tricolour";
_unit addHeadgear "H_MilCap_ocamo";
};
case "pupino":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_Cap_red";
};	

case "pupino2":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_Cap_blu";
};	

case "pupino3":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_Cap_brn_SERO";
};	

case "pupino4":
{
_unit addUniform "U_C_Poloshirt_burgundy";
_unit addHeadgear "H_MilCap_ocamo";
};	
};

Edited by denial

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  

×