RobBrown4PM 0 Posted October 23, 2022 Making a mission where in which I want all units on one side having a specific item (In this case an arm band) on every unit on BLUFOR. Similarly, one for OPFOR as well. Secondly, is there a way to mass add a insignia to specified units all at once. Like adding specific items to individual units, it's time consuming. How, if possible, do I go about adding these types of directives in Eden (or where ever it needs to go)? Share this post Link to post Share on other sites
Larrow 2828 Posted October 26, 2022 You could do something like... Reveal hidden contents //initServer.sqf TAG_fnc_addUnitInventory = { params[ "_unit" ]; switch ( side _unit ) do { case east : { //Add items here for east units }; case west : { //Add items here for west units }; }; }; addMissionEventHandler[ "EntityCreated", { params[ "_entity" ]; if ( _entity isKindOf "CAManBase" ) then { _entity call TAG_fnc_addUnitInventory; }; }]; //Catch all editor placed units { _x call TAG_fnc_addUnitInventory; }forEach allUnits; ...although some people do not like the EH EntityCreated as it fires for many things, even though the code above filters immediately for units only( CAManBase ). Another possible solution is to instead use the GroupCreated EH and monitor for any units joining the said group. Reveal hidden contents //initServer.sqf TAG_fnc_addUnitInventory = { params[ "_unit" ]; if ( _unit getVariable[ "inventoryUpdated", false ] ) exitWith {}; switch ( side _unit ) do { case east : { //Add items here for east units }; case west : { //Add items here for west units }; }; _unit setVariable[ "inventoryUpdated", true ]; }; TAG_fnc_addGroupJoinedEvent = { params[ "_group" ]; _group addEventHandler[ "UnitJoined", { params[ "", "_unit" ]; _unit call TAG_fnc_addUnitInventory; }]; }; //Catch all created groups addMissionEventHandler[ "GroupCreated", { _this call TAG_fnc_addGroupJoinedEvent; }]; //catch all groups already existing( placed in the editor ) { _x call TAG_fnc_addGroupJoinedEvent; }forEach allGroups; //catch all units already existing( placed in the editor ) { _x call TAG_fnc_addUnitInventory; }forEach allUnits; If your talking about config-wise ( as your post is in the config section ) then you could always create a mod that adds an Init EH to SoldierEB, SoldierWB and SoldierGB ( being east, west and independent respectively ) that runs a function to change their Insignia/items. Or if you are using ACE then they have the ability to add Init handlers by script/config(description.ext). Share this post Link to post Share on other sites