Shaanig03 18 Posted April 16 Survival Pack ---------------------------------------------------------------- this mod allows you to create scenarios with hunger & thirst through a module, and adds some functionality to food items and canister fuel, and that's pretty much it ^_^ Features: - makes basic in game existing items such as foods and a fuel canister usable with animations and sounds, though all items are mostly in game existing there is a new MRE (military ration) throwed in after an update - after an update, item functionality is there without the needing of any modules, you can refill water bottles or refuel canisters, you can have items working without activating Hunger & Thirst - mod items has compatibility or support with other mods or scripts that has a different hunger and water system, but this works if the custom mod/mission uses getVariable to store player's hunger and water, which I'm pretty sure it will be 90% mostly getVariable Modules (Survival): - "Hunger & Thirst" module activates player hunger & thirst (very obvious, why am I typing this? xD) - "Item Properties" module sets item properties food nutrition value, water value and consuming duration - "Settings" module defines the variable names for 'hunger' and 'thirst' to store in player, and sets max hunger & thirst value - "Strings" module for changing texts, action texts, messages and icons of this mod Functions: - eg: retrieves a player's hunger & thirst value: _firstPlayer = allPlayers select 0; [_firstPlayer] call survivalpack_fnc_getHungerWater; waitUntil {!isNil "sp_recievedpacketvar_player"}; waitUntil {_firstPlayer == sp_recievedpacketvar_player}; systemChat format ["player '%1' actual food and water values are %2%4 %3%4", name sp_recievedpacketvar_player, sp_recievedpacketvar_food, sp_recievedpacketvar_water, "%"]; systemChat format ["player '%1' displayed food and water values are %2%4 %3%4", name sp_recievedpacketvar_player, round(sp_recievedpacketvar_food * 100), round(sp_recievedpacketvar_water * 100), "%"] - eg: set hunger & water for player, sets the first player's hunger to 50% and thirst to %20, -1 to ignore [allPlayers select 0, 0.5, 0.2] call survivalpack_fnc_setHungerWater ClassList: - adding items to player inventory: player addItem "SPItem_CanisterFuel"; player addItem "SPItem_CanisterFuelEmpty"; player addItem "SPItem_TacticalBacon"; player addItem "SPItem_CanSpirit"; player addItem "SPItem_CanFranta"; player addItem "SPItem_CanRedGull"; player addItem "SPItem_Waterbottle"; player addItem "SPItem_WaterbottleEmpty"; player addItem "SPItem_Canteen"; player addItem "SPItem_CanteenEmpty"; player addItem "SPItem_Cerealbox"; player addItem "SPItem_PowderedMilk"; player addItem "SPItem_RiceBox"; player addItem "SPItem_Pumpkin"; player addItem "SPItem_Orange"; player addItem "SPItem_BakedBeans"; player addItem "SPItem_MRE"; - adding items to container: this addItemCargoGlobal ["SPItem_CanisterFuel", 10]; this addItemCargoGlobal ["SPItem_CanisterFuelEmpty", 10]; this addItemCargoGlobal ["SPItem_TacticalBacon", 10]; this addItemCargoGlobal ["SPItem_CanSpirit", 10]; this addItemCargoGlobal ["SPItem_CanFranta", 10]; this addItemCargoGlobal ["SPItem_CanRedGull", 10]; this addItemCargoGlobal ["SPItem_Waterbottle", 10]; this addItemCargoGlobal ["SPItem_WaterbottleEmpty", 10]; this addItemCargoGlobal ["SPItem_Canteen", 10]; this addItemCargoGlobal ["SPItem_CanteenEmpty", 10]; this addItemCargoGlobal ["SPItem_Cerealbox", 10]; this addItemCargoGlobal ["SPItem_PowderedMilk", 10]; this addItemCargoGlobal ["SPItem_RiceBox", 10]; this addItemCargoGlobal ["SPItem_Pumpkin", 10]; this addItemCargoGlobal ["SPItem_Orange", 10]; this addItemCargoGlobal ["SPItem_BakedBeans", 10]; this addItemCargoGlobal ["SPItem_MRE", 10]; - animation classes: sp_anim_start_eating sp_anim_eating sp_anim_end_eating sp_anim_start_drinking_waterbottle sp_anim_drinking_waterbottle sp_anim_end_drinking_waterbottle sp_anim_start_canister_fuel sp_anim_canister_fuel sp_anim_end_canister_fuel 5 Share this post Link to post Share on other sites
Callsign 128 Posted April 16 Nice work - I've always thought about doing something like this. Have you thought about modelling some real military ration packs for more of the military side of things? 1 Share this post Link to post Share on other sites
Shaanig03 18 Posted April 16 5 hours ago, Callsign said: Nice work - I've always thought about doing something like this. Have you thought about modelling some real military ration packs for more of the military side of things? wooow you joined in 2006, which means you have played most of the arma series right?, I just happen to be in the same boat, never done much modding but have been always coding in Arma ^_^, but that aside I haven't got to properly import custom models into Arma, I seem to have some weird issues with the shadow geometry thing in Object builder, I'm a modeler though, will look into this since my first mod got some favorites heheheheh.... Share this post Link to post Share on other sites
Nemanjic 71 Posted August 10 I don't know how long this mod takes you to create, but this is 5K in the world of survival mods! Already implementing it in all aspects of my community, especially because of the many options for custom things like slaughtering tuna and making water spaces reliable food sources. With my limited knowledge of coding I can't do one thing very important for me and the players so please help with a few obstacles: ●mandatory -How to make sure that every playable unit is under the hunger/thirst circumstances (monitoring) of the mod not just the player? (just like ACE field rations or Ravage is eg)? Is there a code that makes every unit in SP dependent on the survival system? Synchronizing modules to units does not fix things so I assume there is some line in the code that prevents this but I can't trace it at all while reading the codes. Please guys any point in the right direction will be appreciated. ●minnor -Butchering underwater makes the unit stuck after inventory is opened on killed fish so another diver needs to recapture the first hunter to make him free again. (this is expected probably because looting underwater is impossible and code tries to do it anyway after butchering the animal. Thanks in advance arMATES! Share this post Link to post Share on other sites
Nemanjic 71 Posted August 13 I assume this has some connection with if (!hasInterface) exitWith {}; or [player] call survivalpack_fnc_hungerandthirst_playerInit;} remoteExec ["bis_fnc_call", 0, true]; or if (!isServer) exitWith {}; Still can't make this work please guys any help? progress: I have already made some progress with calling {[player] call survivalpack_fnc_hungerandthirst_playerInit;} remoteExec ["bis_fnc_call", 0, true]; (put unit under hunger and thirst regime), [player] call survivalpack_fnc_playerInit_harvestAnimal; (allow playable unit to harvest killed animal) and [player] spawn survivalpack_fnc_take_raw_and_cooked; (manipulate with food on and off cooker place), but [player] call survivalpack_fnc_playerInit_cooking; All these lines I have found in "fn_playerInitItemFunctionality.sqf" file but first two works weird for the script caller (it adds and remove action on object every frame continuously) and fourth one don't work at all. Something else is a problem but I can't figure out what line is forcing functions to work only for the original player unit and not on all playable units in the mission. (at mission starts) Any advice? Share this post Link to post Share on other sites