Hi there.
If you want to create missions without ACE dependencies but still want to use ACE Medical and Food stuff when ACE is available on the server, you might use this code in your initServer.sqf, for example.
initServer.sqf
// If ACE Medical is activated on the server, do it:
if ( isClass(configfile >> "CfgPatches" >> "ace_medical") ) then {
supply_crate1 = createVehicle ["CargoNet_01_box_F", [1876.54,9278.19,200], [], 0, "NONE"];
chute1 = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "FLY"];
chute1 setPos (getPos supply_crate1); // getPos was designed to take the altitude pos obj from the surface below it.
supply_crate1 attachTo [chute1, [0,0,-0.6]]; // attach the chute to the crate
// Supply items > Medical:
supply_crate1 addItemCargo ["ACE_fieldDressing", 36];
supply_crate1 addItemCargo ["ACE_elasticBandage", 18];
supply_crate1 addItemCargo ["ACE_splint", 9];
supply_crate1 addItemCargo ["ACE_quikclot", 18];
supply_crate1 addItemCargo ["ACE_tourniquet", 18];
supply_crate1 addItemCargo ["ACE_packingBandage", 9];
supply_crate1 addItemCargo ["ACE_bloodIV", 9];
supply_crate1 addItemCargo ["ACE_plasmaIV_500", 5];
supply_crate1 addItemCargo ["ACE_salineIV", 5];
supply_crate1 addItemCargo ["ACE_bodyBag", 5];
supply_crate1 addItemCargo ["ACE_morphine", 18];
supply_crate1 addItemCargo ["ACE_epinephrine", 18];
supply_crate1 addItemCargo ["ACE_adenosine", 18];
supply_crate1 addItemCargo ["ACE_painkillers", 18];
supply_crate1 addItemCargo ["ACE_surgicalKit", 3];
supply_crate1 addItemCargo ["ACE_suture", 3];
supply_crate1 addItemCargo ["ACE_personalAidKit", 3];
supply_crate1 addItemCargo ["Medikit", 1];
// Supply items > Food:
supply_crate1 addItemCargo ["ACE_Banana", 18];
supply_crate1 addItemCargo ["ACE_MRE_SteakVegetables", 9];
// Supply items > Water:
supply_crate1 addItemCargo ["ACE_WaterBottle", 18];
supply_crate1 addItemCargo ["ACE_Canteen", 9];
// Supply items > Extra:
supply_crate1 addItemCargo ["ACE_EarPlugs", 9];
// Waiting the crate get closer to the ground:
waitUntil { sleep 0.1; ((getPosATL supply_crate1) # 2) < 2 || !alive supply_crate1 };
// Adjust to crate velocity after the parachute detachment:
_velocity = velocity supply_crate1; // [x,y,z]
detach supply_crate1;
supply_crate1 setVelocity _velocity;
// Detachment of parachute from the crate:
playSound3D ["a3\sounds_f\weapons\Flare_Gun\flaregun_1_shoot.wss", supply_crate1];
detach chute1;
chute1 disableCollisionWith supply_crate1;
// Animation breather:
sleep 5;
// Delete the parachute:
if ( !isNull chute1 ) then { deleteVehicle chute1 }
};
Pay attention to this line down below. You should set the classname of the asset of your taste. You MUST replace "[XXX, YYY, 200]" for other X and Y positions on the map.
supply_crate1 = createVehicle ["CargoNet_01_box_F", [1876.54,9278.19,200], [], 0, "NONE"];
Enjoy.
your code is throwing a error even after I replace "thisTrigger" with a trigger I created from code, I think your forEach this part "(units independent inAreaArray thisTrigger);" is whats the issue, your trying to make a if statement in your hashMap parameter
https://community.bistudio.com/wiki/forEach
try using InAreaArray in a if statement like this:,
{
if (_x inAreaArray thisTrigger) then {
wp = group _x addWaypoint [getMarkerPos "TaskAssault_Mark",0];
wp setWaypointType "MOVE";
};
} forEach (units resistance);
My apologies: now, after your latest message, I've read once more your previous issue and realized that it was I who has misunderstood what was actually the difficulty.
Cheers!
Thank you, Janez.
But for the record, I gotta mention that, at least for me, it worked just perfectly from the very first attempt on my recently restart on "Old Man". 😎
Stored the faction as a variable in the player once they are "in game".
in initplayerlocal.ini:
params[ "_player" ];
//Draw player side icons
[] spawn NUP_fnc_playerMarkers;
waitUntil {getClientStateNumber > 7};
player setVariable ["playerFaction", faction player];
in fn_playerMarkers:
if (isServer) then
{
waitUntil { !isNull findDisplay 12 };
((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw",
{
private ["_color", "_playerFaction"];
diag_log format ["step 1 faction player: %1",_playerFaction];
_playerFaction = player getVariable "playerFaction";
switch (_playerFaction) do
{
case "BLU_F":
{
_color = [0, 0.3, 0.6, 1]; // Blue color for BLUFOR
};
case "OPF_F":
{
_color = [0.5, 0, 0, 1]; // Red color for OPFOR
};
case "IND_F":
{
_color = [0, 0.5, 0, 1]; // Green color for Independent
};
default
{
_color = [0.4, 0, 0.5, 1]; // Purple color for Civilian
};
};