Comrades in Arms Discussion Board
FHQ EdenTool - Printable Version

+- Comrades in Arms Discussion Board (http://forum.ciahome.net)
+-- Forum: Comrades in Arms Life (http://forum.ciahome.net/forumdisplay.php?fid=3)
+--- Forum: Mission Making (http://forum.ciahome.net/forumdisplay.php?fid=8)
+--- Thread: FHQ EdenTool (/showthread.php?tid=3875)



FHQ EdenTool - Alwarren - 09-11-2019

FHQ Eden Tool is the start of a collection of utilities for Eden to make mission editing easier. The addon must only be loaded in your editor config, and will not influence the mission's dependencies. 

Right now, the following functions are implemented:

"Difficulty Level":
This requires a parameter "FHQ_Difficulty" in your mission's parameter, and it can have values 0 ("Easy"), 1 ("Normal") and 2 ("Hard"). There are three Checkboxes marked Easy, Normal and Hard:
[Image: gJNYwdG.png]

The unit will spawn if the difficulty set has a checkbox in it. For example, to make a unit NOT spawn when the difficulty is set to 0 (Easy), uncheck that box. That way, you can easily control what spawns under what difficulty.

"Tagging"

Each group and unit can be tagged with a letter from A to F. What you use these for is up to you, but check below for a script that deletes units based on player numbers and tags.

"ACE Equipment"
[Image: nmk22qW.png]

This works with or without ACE loaded. If ACE is not loaded, the settings here are ignored. If ACE is loaded, the checked items are automatically added to the unit's inventory (space permitting). Default is a flashlight and ear plugs. The rest is pretty much self-explanatory. Vector (Nite) and Vector (day) will replace the binocs slot with the appropriate ACE binocs. Extra Grenades can be used to add Flashbangs to the inventory.

Scripts:
The following script deletes tagged units based on a calculated difficulty based on the number of slotted players. It assumes three player teams called team1, team2 and team3:

Code:
if (isServer) then {

_difficulty = 12;
// Determine difficulty and delete excessive units
if (!isMultiplayer) then {
{deleteVehicle _x} forEach units team2 + units team3;
_difficulty = 4;
} else {
_n = count units team1
   + count units team2
   + count units team3;

/*
** This gives better results than just using floor. Using floor will
** yield 4 even with 7 people. Just using round will yield 8 even with six.
** This will yield 5 with 4, 5 and 6, and 8 with 7 and 8
*/
if (_n > 1) then {
_n = _n - 1 ;
};

_difficulty = round(_n/4) * 4;

};

if (FHQ_Difficulty == 0) then {
if (_difficulty > 4) then {
_difficulty = _difficulty - 4;
};
};

if (FHQ_Difficulty == 2) then {
if (_difficulty < 16) then {
_difficulty = _difficulty + 4;
};
};

FHQ_DifficultyPlayers = _difficulty;
publicVariable "FHQ_DifficultyPlayers";

if (_difficulty <= 4) then {
["A"] call FHQ_fnc_deleteTagged;
};

if (_difficulty <= 8) then {
["B"] call FHQ_fnc_deleteTagged;
};
};
It uses a function FHQ_fnc_deleteTagged:
Code:
params 
[
["_tagName", "A", [""]]
];

_varName = format ["FHQ_Tag%1", _tagName];

{
if (_x getVariable [_varName, false]) then {
[_x] call FHQ_fnc_deleteGroup;
};
} forEach allGroups;

{
if (_x getVariable [_varName, false]) then {
deleteVehicle _x;
};
} forEach allUnits;
So what this does is, it calculates _difficulty as a function of the player number. If _difficulty is 4 or less, it deletes all units/groups tagged with "A". If _difficulty is less than or equal to 8, it deletes all units/groups tagged with "B". That means that in the case of difficulty of 4 or less, both tags (A and B) are deleted. 

On the surface, it means that all units that are tagged A or B will be deleted on low player count. On medium player count, only those tagged B will be deleted. For all other player counts, it will remain the same.


FHQ EdenTool - Variable - 09-16-2019

Thank you for this!
Question. Why earplugs and flashlights considered default? At least for us, one is not used at all and the other is situational. How about splitting it and letting the author choose?


RE: FHQ EdenTool - Alwarren - 09-16-2019

I was actually thinking of making the whole thing a bit different, more like the cargo section for crates etc.. i.e. a list of items with a plus and minus button where you can say how many of those you want.

Just need to find the time to work on it... and so many ongoing projects :|