-
Notifications
You must be signed in to change notification settings - Fork 309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start loadouts Improvement #574
Changes from 5 commits
e6633f9
a81a78b
cd3f2b3
5fbd44e
242a9c8
24900aa
7b24fbd
fd68fe9
8aeef5a
19fe2e7
9b67e86
4a25c79
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,39 @@ | ||||||
class LifeStartupLoadouts { | ||||||
commonItens[] = {"ItemMap","ItemCompass","ItemWatch"}; //Common link items between sides - empty ({} or {""}) will load nothing | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
// COP | ||||||
class WEST { | ||||||
life_loadOutItens[] = { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
"U_Rangemaster", //Uniform - empty ("" or {""} or {}) will load nothing...Otherwise, use "" for a unique uniform or {"",""} for a randomly selected uniform | ||||||
"V_Rangemaster_belt", //Vest - empty ("") will load nothing | ||||||
"", //Backpack - empty ("") will load nothing | ||||||
"hgun_P07_snds_F", //Weapon - empty ("") will load nothing | ||||||
{{"16Rnd_9x21_Mag",6}}, //Mags, amount - empty ({"",0}) will load nothing | ||||||
{} //Specific items to be loaded on player - empty ({}) will load nothing...Otherwise, {"ItemName", Amount} | ||||||
}; | ||||||
}; | ||||||
|
||||||
// CIV | ||||||
class CIV { | ||||||
life_loadOutItens[] = { | ||||||
{"U_C_Poloshirt_blue","U_C_Poloshirt_burgundy","U_C_Poloshirt_stripped","U_C_Poloshirt_tricolour","U_C_Poloshirt_salmon","U_C_Poloshirt_redwhite","U_C_Commoner1_1"}, //Uniform - empty ("" or {""}) will load nothing...Otherwise, use "" for a unique uniform or {"",""} for a randomly selected uniform | ||||||
"", //Vest - empty ("") will load nothing | ||||||
"", //Backpack - empty ("") will load nothing | ||||||
"", //Weapon - empty ("") will load nothing | ||||||
{{"",0}}, //Mags, amount - empty ({"",0}) will load nothing | ||||||
{} //Specific items to be loaded on player - empty ({}) will load nothing...Otherwise, {"ItemName", Amount} | ||||||
}; | ||||||
}; | ||||||
|
||||||
// MED | ||||||
class GUER { | ||||||
life_loadOutItens[] = { | ||||||
"U_Rangemaster", //Uniform - empty ("" or {""}) will load nothing...Otherwise, use "" for a unique uniform or {"",""} for a randomly selected uniform | ||||||
"V_Rangemaster_belt", //Vest - empty ("") will load nothing | ||||||
"", //Backpack - empty ("") will load nothing | ||||||
"hgun_P07_snds_F", //Weapon - empty ("") will load nothing | ||||||
{{"16Rnd_9x21_Mag",1}}, //Mags, amount - empty ({"",0}) will load nothing | ||||||
{{"FirstAidKit",2}} //Specific items to be loaded on player - empty ({}) will load nothing...Otherwise, {"ItemName", Amount} | ||||||
}; | ||||||
}; | ||||||
}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps move the comments to the top of the class, instead of being on every line (like the other configs) |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -22,8 +22,7 @@ if (life_is_alive && !life_is_arrested) then { | |||||
} else { | ||||||
if (!life_is_alive && !life_is_arrested) then { | ||||||
if (LIFE_SETTINGS(getNumber,"save_civilian_positionStrict") isEqualTo 1) then { | ||||||
_handle = [] spawn life_fnc_civLoadout; | ||||||
waitUntil {scriptDone _handle}; | ||||||
[] call life_fnc_startupLoadout; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
CASH = 0; | ||||||
[0] call SOCK_fnc_updatePartial; | ||||||
}; | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,28 +6,13 @@ | |||||
Description: | ||||||
Loads saved civilian gear, this is limited for a reason and that's balance. | ||||||
*/ | ||||||
private ["_itemArray","_handle"]; | ||||||
_itemArray = life_gear; | ||||||
private ["_handle"]; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
private _itemArray = life_gear; | ||||||
waitUntil {!(isNull (findDisplay 46))}; | ||||||
|
||||||
_handle = [] spawn life_fnc_stripDownPlayer; | ||||||
waitUntil {scriptDone _handle}; | ||||||
[] call life_fnc_stripDownPlayer; | ||||||
|
||||||
if (count _itemArray isEqualTo 0) exitWith { | ||||||
switch (playerSide) do { | ||||||
case west: { | ||||||
[] call life_fnc_copLoadout; | ||||||
}; | ||||||
|
||||||
case civilian: { | ||||||
[] call life_fnc_civLoadout; | ||||||
}; | ||||||
|
||||||
case independent: { | ||||||
[] call life_fnc_medicLoadout; | ||||||
}; | ||||||
}; | ||||||
}; | ||||||
if (_itemArray isEqualTo []) exitWith {[] call life_fnc_startupLoadout;}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
_itemArray params [ | ||||||
"_uniform", | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,41 @@ | ||||||
/* | ||||||
File: fn_startupLoadout.sqf | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
Author: Casperento | ||||||
|
||||||
Description: | ||||||
Loads a custom loadout on player | ||||||
*/ | ||||||
private _loadOutCfg = getArray(missionConfigFile >> "LifeStartupLoadouts" >> str(side player) >> "life_loadOutItens"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
private _commonItens = getArray(missionConfigFile >> "LifeStartupLoadouts" >> "commonItens"); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
private _pCloth = if ((_loadOutCfg select 0) isEqualType [] && !((_loadOutCfg select 0) isEqualTo [])) then {selectRandom (_loadOutCfg select 0)} else {(_loadOutCfg select 0)}; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use params for all this:
|
||||||
|
||||||
if !(life_is_arrested) then { | ||||||
if !(_pCloth isEqualTo "") then {player addUniform _pCloth;}; | ||||||
}; | ||||||
if !((_loadOutCfg select 1) isEqualTo "") then {player addVest (_loadOutCfg select 1);}; | ||||||
if !((_loadOutCfg select 2) isEqualTo "") then {player addBackpack (_loadOutCfg select 2);}; | ||||||
if !((_loadOutCfg select 3) isEqualTo "") then {player addWeapon (_loadOutCfg select 3);}; | ||||||
if ((_loadOutCfg select 4) isEqualType [] && !((_loadOutCfg select 4) select 0 isEqualTo "") && !((_loadOutCfg select 4) isEqualTo [])) then { | ||||||
(_loadOutCfg select 4) apply { | ||||||
if ((_x select 1) > 0) then { | ||||||
player addMagazines [(_x select 0),(_x select 1)]; | ||||||
}; | ||||||
}; | ||||||
}; | ||||||
if !((_loadOutCfg select 5) isEqualTo []) then { | ||||||
{ | ||||||
if (((_x select 1) > 0) && !((_x select 0) isEqualTo "")) then { | ||||||
for "_i" from 1 to (_x select 1) step 1 do {player addItem (_x select 0)}; | ||||||
}; | ||||||
} count (_loadOutCfg select 5); | ||||||
}; | ||||||
if !(_commonItens isEqualTo []) then { | ||||||
_commonItens apply { | ||||||
if !(_x isEqualTo "") then { | ||||||
player linkItem _x; | ||||||
}; | ||||||
}; | ||||||
}; | ||||||
|
||||||
[] call life_fnc_playerSkins; | ||||||
[] call life_fnc_saveGear; |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.