Military Logistics question

  1. 2 months ago

    Hi guys it's me again.

    So I've got a question about the Military Logistics module. After I finished my mission with Alive (WW2 based), it worked perfectly on a test that I hold yesterday but for one thing: the reinforcement infantry called by the German commander came in on a vanilla truck. On my search for fixing this I ran onto this code posted in this forum: https://pastebin.com/rJv0rqcF

    After tinkering for a while (I'm pretty bad at scripting), I made myself this code:

    /*
     * Custom transport,support, and ammo classes for factions
     * Used by MP,MCP,ML to place support vehicles and ammo boxes
     * If no faction specific settings are found will fall back to side
     */
    
    /*
     * Mil placement ambient vehicles for sides
     */
    
     waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"};
    
    
    ALIVE_sideDefaultSupports = [] call ALIVE_fnc_hashCreate;
    [ALIVE_sideDefaultSupports, "EAST", ["O_RU_ZiS_5V_Repair_01","O_RU_ZiS_5V_Fuel_01","O_RU_GAZ_AA_Sapper_car_ifa3_01","O_RU_Prestamo_yarriendo_Jeep_01"]] call ALIVE_fnc_hashSet; // ,"Box_East_AmmoVeh_F"
    [ALIVE_sideDefaultSupports, "WEST", ["B_DE_Kbelwagen_01","B_DE_Kubelwagen_camo_01","B_BDEKessel_OpelBlitz_Open_01","B_BDEKessel_OpelBlitz_Fuel_01"]] call ALIVE_fnc_hashSet; // ,"Box_IND_AmmoVeh_F"
    
    
    /*
     * Mil placement random supply boxes for sides
     */
    
    ALIVE_sideDefaultSupplies = [] call ALIVE_fnc_hashCreate;
    [ALIVE_sideDefaultSupplies, "EAST", ["LIB_WeaponsBox_Big_SU","LIB_BasicWeaponsBox_SU","LIB_BasicAmmunitionBox_SU","LIB_Mine_Ammo_Box_Su"]] call ALIVE_fnc_hashSet;
    [ALIVE_sideDefaultSupplies, "WEST", ["csa38_bedna1","csa38_bedna6","LIB_BasicAmmunitionBox_GER","LIB_Mine_Ammo_Box_Ger"]] call ALIVE_fnc_hashSet;
    
    /*
     * Mil logistics convoy transport vehicles fallback for sides
     */
    
    ALIVE_sideDefaultTransport = [] call ALIVE_fnc_hashCreate;
    [ALIVE_sideDefaultTransport, "EAST", ["ifa3_gaz","ifa3_gaz2","O_RU_Zis_5V_01"]] call ALIVE_fnc_hashSet;
    [ALIVE_sideDefaultTransport, "WEST", ["B_BDEKessel_OpelBlitz_Open_01","B_BDEKessel_OpelBlitz_Tarpaulin_01"]] call ALIVE_fnc_hashSet;
    
    /*
     * Mil logistics air transport vehicles fallback for sides
     */
    
    ALIVE_sideDefaultAirTransport = [] call ALIVE_fnc_hashCreate;
    [ALIVE_sideDefaultAirTransport, "EAST", []] call ALIVE_fnc_hashSet;
    [ALIVE_sideDefaultAirTransport, "WEST", []] call ALIVE_fnc_hashSet;
    
    /*
     * Mil logistics airdrop containers fallback for sides
     */
    
    ALIVE_sideDefaultContainers = [] call ALIVE_fnc_hashCreate;
    [ALIVE_sideDefaultContainers, "EAST", []] call ALIVE_fnc_hashSet;
    [ALIVE_sideDefaultContainers, "WEST", ["LIB_BasicAmmunitionBox_GER"]] call ALIVE_fnc_hashSet;
    
    /*
     * Mil placement ambient vehicles per faction
     */
    
    ALIVE_factionDefaultSupports = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultSupports, "O_RU_608th_RR", ["O_RU_ZiS_5V_Repair_01","O_RU_ZiS_5V_Fuel_01","O_RU_GAZ_AA_Sapper_car_ifa3_01","O_RU_Prestamo_yarriendo_Jeep_01"]] call ALIVE_fnc_hashSet; // ,"Box_East_AmmoVeh_F"
    [ALIVE_factionDefaultSupports, "B_DE_Kessel", ["B_DE_Kbelwagen_01","B_DE_Kubelwagen_camo_01","B_BDEKessel_OpelBlitz_Open_01","B_BDEKessel_OpelBlitz_Fuel_01"]] call ALIVE_fnc_hashSet; // ,"Box_NATO_AmmoVeh_F"
    
    /*
     * Mil placement random supply boxes per faction
     */
    
    ALIVE_factionDefaultSupplies = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultSupplies, "O_RU_608th_RR", ["LIB_WeaponsBox_Big_SU","LIB_BasicWeaponsBox_SU","LIB_BasicAmmunitionBox_SU","LIB_Mine_Ammo_Box_Su"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultSupplies, "B_DE_Kessel", ["csa38_bedna1","csa38_bedna6","LIB_BasicAmmunitionBox_GER","LIB_Mine_Ammo_Box_Ger"]] call ALIVE_fnc_hashSet;
    
    /*
     * Mil logistics convoy transport vehicles per faction
     */
    
    ALIVE_factionDefaultTransport = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultTransport, "O_RU_608th_RR", ["O_Truck_02_transport_F","O_Truck_02_covered_F"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultTransport, "B_DE_Kessel", ["B_Truck_01_transport_F","B_Truck_01_covered_F"]] call ALIVE_fnc_hashSet;
    
    /*
     * Mil logistics air transport vehicles per faction
     */
    
    
    /*
     * Mil logistics airdrop containers per faction
     */
    

    So my questions would be: Will my code work or is it outdated by now? In that case, how should I call it in the init.sqf?

    Thanks in advance guys!

    Ps.: I'm using two custom factions made with ORBAT, don't know if that would cause any trouble...

  2. Edited 2 months ago by DrDetroit

    So what I use for Unsung Vietnam mod is below. This allows logistics to only bring troops in with defined classes. Use the StaticData in conjunction with the init code and it will work fine, change the faction to your liking/needs.

    NOTE: I have a small code in the Staticdata file ("respwn" at bottom of staticdata), to start script for killed AI to spawn with custom gear - ignore that.

    StaticData file

    if (!isServer) exitWith {};
     
    waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"};
     
    /*
     * Mil logistics convoy transport vehicles per faction
     */
     
    [ALIVE_factionDefaultTransport, "UNSUNG_W", ["uns_M35A2","uns_M35A2_Open"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultTransport, "UNSUNG_E", ["uns_BTR152_DSHK","uns_nvatruck_open"]] call ALIVE_fnc_hashSet;
     
    /*
     * Mil logistics air transport vehicles per faction
     */
     
    [ALIVE_factionDefaultAirTransport, "UNSUNG_W", ["uns_UH1H_m60","uns_ch34_army_M60"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultAirTransport, "UNSUNG_E", ["uns_Mi8T_VPAF"]] call ALIVE_fnc_hashSet;
    
    this addEventHandler ["respawn", { 
     _x setVariable ["LoadoutManager_Settings", [true,true]]; 
     _x addAction ["Access Loadout Manager", {[nil,"open", _this] call SpyderAddons_fnc_loadoutManager}]; 
    }];

    INIT (ADD TO TOP LINE IN INIT FILE):

    call compile preprocessFile "staticData.sqf";
    
     if(isServer) then {
     	waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"};
    	call compile (preprocessFileLineNumbers "staticData.sqf");
    };

    Good luck!
    DrDetroit

  3. Hi @DrDetroit, I've tweaked your script and it works as intended. Thank you very much :D

  4. Glad it worked for you. Enjoy!

  5. Tanks, may you happen to know the code for ambient vehicles and ammoboxes as well? :P

  6. Edited 2 months ago by DrDetroit

    I've not tried to setup a script with those requirements in mind - yet. I would think changing the [ALIVE_factionDefaultAirTransport, "UNSUNG_W", ["uns_UH1H_m60","uns_ch34_army_M60"]
    to the classname of the supply boxes and the string to something like factionDefaultAmmoCrate or whatever name Arma assigns the box you need to use exclusively, and adding that string to the StaticData code.

  7. Ok, thank you for your help!

  8. Check this for script to limit arsenals ect.

    https://forums.bohemia.net/forums/topic/219355-how-can-i-restrict-arsenal/

  9. 8 weeks ago
    Edited 8 weeks ago by xetra11

    May I ask what this

    this addEventHandler ["respawn", { 
     _x setVariable ["LoadoutManager_Settings", [true,true]]; 
     _x addAction ["Access Loadout Manager", {[nil,"open", _this] call SpyderAddons_fnc_loadoutManager}]; 
    }];

    Snippet is supposed to do?

  10. SavageCDN

    Oct 19 Moderator

    My guess is it gives you scroll-wheel access to the loadout manager after respawn.

  11. Edited 8 weeks ago by DrDetroit

    That is custom gear loadout when respawn occurs. Without it, you respawn with original faction gear.

    I have custom loadout, for my platoon AI and players, via Spyder Loadout manager, so it pulls the custom loadout gear when respawning.

 

or Sign Up to reply!