As a newbie in scripting and after trying different stuff, i have found a solution to a similar problem that i had with by using BIS_fnc_addRespawnInventory.
It works like this :
1. On the Description.ext i have placed the following code.
respawn = "BASE";
respawnDelay = 10;
respawnTemplates[] = {"MenuInventory","MenuPosition"};
respawnOnStart = 1;
onLoadName = "Testing Stuff";
loadScreen = "";
disabledAI = 1;
disableChannels[]={6}; //set {0,6} to disable global
enableSaving = [false, false];
class CfgRespawnInventory
{
class Gear1
{
displayName = "Loadout01"; // Name visible in the menu
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa"; // Icon displayed next to the name
// Loadout definition, uses same entries as CfgVehicles classes
weapons[] = {
"Binocular",
"hgun_Pistol_heavy_01_F"
};
magazines[] = {
"11Rnd_45ACP_Mag",
"11Rnd_45ACP_Mag",
"11Rnd_45ACP_Mag",
"11Rnd_45ACP_Mag",
"11Rnd_45ACP_Mag"
};
items[] = {
"FirstAidKit"
};
linkedItems[] = {
"H_Watchcap_blk",
"optic_MRD",
"muzzle_snds_acp",
"NVGoggles",
"G_Sport_BlackWhite",
"ItemMap",
"ItemCompass",
"ItemWatch",
"ItemRadio"
};
uniformClass = "U_I_G_Story_Protagonist_F";
backpack = "B_FieldPack_blk";
};
class Gear2
{
displayName = "loadout02";
icon = "\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa";
weapons[] = {
"Binocular",
"arifle_MXM_Black_F"
};
magazines[] = {
"30Rnd_65x39_caseless_mag",
"30Rnd_65x39_caseless_mag",
"30Rnd_65x39_caseless_mag",
"30Rnd_65x39_caseless_mag",
"30Rnd_65x39_caseless_mag"
};
items[] = {
"FirstAidKit"
};
linkedItems[] = {
"H_Watchcap_blk",
"optic_MRD",
"muzzle_snds_acp",
"NVGoggles",
"G_Sport_BlackWhite",
"ItemMap",
"ItemCompass",
"ItemWatch",
"ItemRadio"
};
uniformClass = "U_I_G_Story_Protagonist_F";
backpack = "B_FieldPack_blk";
};
};
2. After i have done the above i have created a loadout.sqf file which contains :
LoadOut01 =
{
[west, "Gear1"] call BIS_fnc_addRespawnInventory;
[east, "Gear1"] call BIS_fnc_addRespawnInventory;
[civilian, "Gear1"] call BIS_fnc_addRespawnInventory;
[resistance, "Gear1"] call BIS_fnc_addRespawnInventory;
};
LoadOut02 =
{
[west, "Gear2"] call BIS_fnc_addRespawnInventory;
[east, "Gear2"] call BIS_fnc_addRespawnInventory;
[civilian, "Gear2"] call BIS_fnc_addRespawnInventory;
[resistance, "Gear2"] call BIS_fnc_addRespawnInventory;
};
3. I have created another sqf file called "CallingLoadout.sqf". Inside i have simply :
[player] call LoadOut01
[player] call LoadOut02
4. i am calling the above script in init.sqf with
execVM "loadout.sqf";
execVM "CallingLoadout.sqf";
By having on description.ext respawnOnStart = 1; and respawnTemplates[] = {"MenuInventory","MenuPosition"}; i can choose the loadout that i want for my unit. Hope that i could help you a bit with the above.
Since i cannot create a thread of my own since i am new to the forum, i might as well ask here and hope that someone can help me. I have the scripts above. I have also created a small rank framework. My question is how can i connect the different loadouts with a rank. For example : My start gear as private rank is the LoadOut01. Once i reach the corporal rank i want to have access to Loadout02 etc. Is there a simple way to achieve that with the above ? Many thanks in advance for the help someone can provide.
Regards
Seed
PS: Sorry for my English