Open SavageCDN opened 7 years ago
Dont think this is an ALiVE issue, but general init order issue.
Ran the supplied repro mission and indeed the delivered box had default items. Optimized the used scripts and XEH a bit and got desired result.
description.ext
class Extended_Init_EventHandlers {
class Box_NATO_Ammo_F {
initServer = "(_this select 0) call (compile preprocessFileLineNumbers 'scripts\ammo.sqf')";
};
};
ammo.sqf
params [
["_crate", objNull]
];
if !(isServer) exitWith {};
if (isNull _crate) exitWith {diag_log "ammo.sqf :: input is objNull"};
_crate allowDamage false;
clearWeaponCargoGlobal _crate;
clearMagazineCargoGlobal _crate;
clearItemCargoGlobal _crate;
clearBackpackCargoGlobal _crate;
_crate addMagazineCargoGlobal ["30Rnd_65x39_caseless_mag", 20];
Running on dedicated server:
One Box_NATO_Ammo_F begins the mission at my base (was placed in the editor) and then I requested another one via Combat Logistics (Helo, Airdrop or Convoy). The Box_NATO_Ammo_F that was placed on the map in the editor has the custom item in it but the Box_NATO_Ammo_F that came in by Combat Logistics has the default items (Same thing happens if I use Zues to drop one into the mission also, it has all the default items).
When testing thru the Editor/Single player everything works, both boxes contain just the custom item.
See this forum thread for more info and script used to customize crates: http://alivemod.com/forum/2062-modify-ammo-supply-crates
Repro mission attached @CBA @ALiVE
ammocrate.Stratis.pbo.zip