This repository has been archived by the owner on Oct 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: freghar <[email protected]>
- Loading branch information
Showing
7 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Copyright 2016 Freghar (https://forums.bistudio.com/user/1115862-freghar/) | ||
|
||
Content licensed under CC BY 4.0 | ||
https://creativecommons.org/licenses/by/4.0/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
class CfgPatches | ||
{ | ||
class Chestpack | ||
{ | ||
units[] = {}; | ||
weapons[] = {}; | ||
//requiredAddons[] = {}; | ||
requiredAddons[] = {"ace_interact_menu"}; | ||
}; | ||
}; | ||
|
||
class CfgVehicles { | ||
class Man; | ||
class CAManBase : Man { | ||
class ACE_SelfActions { | ||
class ACE_Equipment { | ||
class Chestpack_onChest { | ||
displayName = "Backpack on Chest"; | ||
statement = "[(_this select 0), ((_this select 0) call Chestpack_fnc_removeBackpack)] call Chestpack_fnc_setChestpack;"; | ||
condition = "isNil {(_this select 0) getVariable ""Chestpack_pack""} && !isNull unitBackpack (_this select 0)"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
}; | ||
class Chestpack_onBack { | ||
displayName = "Chestpack on Back"; | ||
statement = "[(_this select 0), ((_this select 0) call Chestpack_fnc_removeChestpack)] call Chestpack_fnc_setBackpack;"; | ||
condition = "!isNil {(_this select 0) getVariable ""Chestpack_pack""} && isNull unitBackpack (_this select 0)"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
}; | ||
/*class Chestpack_onGround { | ||
displayName = "Chestpack on Ground"; | ||
statement = "call Chestpack_onGround"; | ||
condition = "!isNil {(_this select 0) getVariable ""Chestpack_pack""}"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
};*/ | ||
class Chestpack_swapPacks { | ||
displayName = "Swap Chest/Back packs"; | ||
statement = "private _back = (_this select 0) call Chestpack_fnc_removeBackpack; [(_this select 0), ((_this select 0) call Chestpack_fnc_removeChestpack)] call Chestpack_fnc_setBackpack; [(_this select 0), _back] call Chestpack_fnc_setChestpack;"; | ||
condition = "!isNil {(_this select 0) getVariable ""Chestpack_pack""} && !isNull unitBackpack (_this select 0)"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
}; | ||
}; | ||
}; | ||
class ACE_Actions { | ||
class ACE_MainActions { | ||
/* corpse or unconscious */ | ||
class Chestpack_onChest { | ||
displayName = "Backpack on Chest"; | ||
statement = "[(_this select 0), ((_this select 0) call Chestpack_fnc_removeBackpack)] call Chestpack_fnc_setChestpack;"; | ||
condition = "isNil {(_this select 0) getVariable ""Chestpack_pack""} && !isNull unitBackpack (_this select 0) && {!alive (_this select 0) || (_this select 0) getVariable [""ACE_isUnconscious"", false]}"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
}; | ||
class Chestpack_onBack { | ||
displayName = "Chestpack on Back"; | ||
statement = "[(_this select 0), ((_this select 0) call Chestpack_fnc_removeChestpack)] call Chestpack_fnc_setBackpack;"; | ||
condition = "!isNil {(_this select 0) getVariable ""Chestpack_pack""} && isNull unitBackpack (_this select 0) && {!alive (_this select 0) || (_this select 0) getVariable [""ACE_isUnconscious"", false]}"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
}; | ||
/*class Chestpack_onGround { | ||
displayName = "Chestpack on Ground"; | ||
statement = "call Chestpack_onGround"; | ||
condition = "!isNil {(_this select 0) getVariable ""Chestpack_pack""} && {!alive (_this select 0) || (_this select 0) getVariable [""ACE_isUnconscious"", false]}"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
};*/ | ||
class Chestpack_swapPacks { | ||
displayName = "Swap Chest/Back packs"; | ||
statement = "private _back = (_this select 0) call Chestpack_fnc_removeBackpack; [(_this select 0), ((_this select 0) call Chestpack_fnc_removeChestpack)] call Chestpack_fnc_setBackpack; [(_this select 0), _back] call Chestpack_fnc_setChestpack;"; | ||
condition = "!isNil {(_this select 0) getVariable ""Chestpack_pack""} && !isNull unitBackpack (_this select 0) && {!alive (_this select 0) || (_this select 0) getVariable [""ACE_isUnconscious"", false]}"; | ||
exceptions[] = {"isNotInside", "isNotSwimming"}; | ||
}; | ||
}; | ||
}; | ||
/* vanilla Actions */ | ||
/*class UserActions { | ||
class Chestpack_onChest {}; | ||
class Chestpack_onBack {}; | ||
};*/ | ||
}; | ||
/*class Reammobox; | ||
class Bag_base : Reammobox { | ||
class ACE_Actions { | ||
class ACE_MainActions { | ||
class Chestpack_onChest { | ||
displayName = "Groundpack on Chest"; | ||
statement = "call Chestpack_fromGround"; | ||
condition = "!isNil {(_this select 1) getVariable ""Chestpack_pack""}"; | ||
}; | ||
}; | ||
}; | ||
};*/ | ||
}; | ||
|
||
class CfgFunctions { | ||
class Chestpack { | ||
class All { | ||
file = "\chestpack\functions"; | ||
//class init { postInit = 1; }; | ||
class setChestpack; | ||
class removeChestpack; | ||
class setBackpack; | ||
class removeBackpack; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* delete the backpack of '_unit', returning its class and contents, | ||
* as getUnitLoadout provides it */ | ||
|
||
params ["_unit"]; | ||
|
||
private _packinfo = getUnitLoadout _unit; | ||
if (count _packinfo > 0) then { | ||
/* https://community.bistudio.com/wiki/Talk:getUnitLoadout */ | ||
_packinfo = _packinfo select 5; | ||
removeBackpackGlobal _unit; | ||
}; | ||
_packinfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* delete the chestpack of '_unit', returning its class and contents, | ||
* as getUnitLoadout provides it */ | ||
|
||
params ["_unit"]; | ||
|
||
private _chestpack = _unit getVariable "Chestpack_pack"; | ||
if (isNil "_chestpack") exitWith {}; | ||
_unit setVariable ["Chestpack_pack", nil, true]; | ||
_unit forceWalk false; | ||
|
||
_chestpack params ["_obj", "_packinfo"]; | ||
deleteVehicle _obj; | ||
_packinfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* add backpack to '_unit', according to getUnitLoadout-formatted | ||
* '_backinfo' (backpack array), saved by fn_delBackpack */ | ||
|
||
params ["_unit", "_packinfo"]; | ||
|
||
private _loadout = getUnitLoadout _unit; | ||
/* https://community.bistudio.com/wiki/Talk:getUnitLoadout */ | ||
_loadout set [5, _packinfo]; | ||
_unit setUnitLoadout _loadout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* add chestpack to '_unit', according to getUnitLoadout-formatted | ||
* '_backinfo' (backpack array), saved by fn_delBackpack */ | ||
|
||
params ["_unit", "_packinfo"]; | ||
_packinfo params ["_packclass"]; | ||
|
||
/* sometimes has .p3d, sometimes doesn't, starts with leading \, etc. */ | ||
//getText (configFile >> "CfgVehicles" >> _packclass >> "model"); | ||
|
||
private _temp = _packclass createVehicleLocal [0,0,0]; | ||
private _model = (getModelInfo _temp) select 1; | ||
deleteVehicle _temp; | ||
|
||
private _obj = createSimpleObject [_model, [0,0,0]]; | ||
_obj attachTo [_unit, [0.02,-0.04,-0.3], "pelvis"]; | ||
|
||
_unit forceWalk true; | ||
_unit setVariable ["Chestpack_pack", [_obj, _packinfo], true]; | ||
|
||
|
||
/* | ||
obj = createVehicle ["GroundWeaponHolder", player, [], 0, "CAN_COLLIDE"]; | ||
obj addBackpackCargoGlobal [(typeof unitbackpack player), 1]; | ||
obj attachTo [player, [0.02,-0.04,-0.3], "pelvis"]; | ||
obj setVectorUp [0,1,0]; | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name = "Chestpack"; | ||
author = "Freghar"; | ||
hideName = 0; | ||
overview = "Yet another mod for moving backpacks on one's chest/belly."; |