staticData

  1. 7 years ago
    Edited 7 years ago by Opendome

    Hey everyone!

    Im sort of stuck, Im suing the template that I got working on my last mission but I Keep finding that the OPFOR units (African Regime) just keep spawning vanilla regular OPFOR vehicles/supply crates? Im using

    if (!isServer) exitWith {};
    
    waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"};
    
    
    ALIVE_factionDefaultTransport = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultTransport, "LOP_AFR", ["LOP_AFR_BTR60","LOP_AFR_Landrover","LOP_AFR_Landrover_M2","LOP_AFR_Offroad","LOP_AFR_Truck"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultTransport, "AFR_Regime", ["O_AFRRegime_UAZ_3151_Open_01","O_AFRRegime_UAZ_3151_01","O_AFRRegime_BMP_1P_01","O_AFRRegime_Ural_4320_01","O_AFRRegime_BRDM_2UM_01","O_AFRRegime_Ural_4320_Open_01","O_AFRRegime_Ural_4320_Flatbed_01","O_AFRRegime_BTR_80A_01","O_AFRRegime_BMP_1K_01","O_AFRRegime_BRDM_2UM_Armed_01","O_AFRRegime_Ural_4320_Open_Flatbed_01","O_AFRRegime_BRDM_2_01","O_AFRRegime_BRDM_29P148_01","O_AFRRegime_BMP_1_01","O_AFRRegime_BTR_80_01","O_AFRRegime_BTR_70_01","O_AFRRegime_BRM_1K_01","O_AFRRegime_BMP_2K_01","O_AFRRegime_BMP_3early_01","O_AFRRegime_BMP_2D_01","O_AFRRegime_BMP_2obr_1986g_01","O_AFRRegime_BMP_2obr_1980g_01","O_AFRRegime_PRP_3_01","O_AFRRegime_BMP_1D_01"]] call ALIVE_fnc_hashSet;
    
    ALIVE_factionDefaultAirTransport = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultAirTransport, "AFR_Regime", ["O_AFRRegime_Mi24V_CAS_01","O_AFRRegime_Mi8_MTSh_01","O_AFRRegime_Mi8AMT_01"]] call ALIVE_fnc_hashSet;
    
    
    ALIVE_factionDefaultSupports = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultSupports, "LOP_AFR", ["LOP_AFR_BTR60","LOP_AFR_Landrover","LOP_AFR_Landrover_M2","LOP_AFR_Offroad","LOP_AFR_Truck"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultSupports, "AFR_Regime", ["O_AFRRegime_GAZ_66_AP_2_01","O_AFRRegime_Ural_4320_Fuel_01","O_AFRRegime_GAZ_66_Ammo_01","O_AFRRegime_GAZ_66_ESB_8IM_01"]] call ALIVE_fnc_hashSet;
    
    
    ALIVE_factionDefaultSupplies = [] call ALIVE_fnc_hashCreate;
    [ALIVE_factionDefaultSupplies, "LOP_AFR", ["rhs_gear_crate","rhs_mags_crate","rhs_launcher_crate","rhs_spec_weapons_crate","rhs_3Ya40_1_single","rhs_7ya37_1_single"]] call ALIVE_fnc_hashSet;
    [ALIVE_factionDefaultSupplies, "AFR_Regime", ["rhs_gear_crate","rhs_mags_crate","rhs_launcher_crate","rhs_spec_weapons_crate","rhs_3Ya40_1_single","rhs_7ya37_1_single"]] call ALIVE_fnc_hashSet;
    
    ALIVE_civilianWeapons = [] call ALIVE_fnc_hashCreate;
    [ALIVE_civilianWeapons, "CUP_AFR_CIV", [["rhs_weap_aks74","rhs_30Rnd_545x39_AK"],["rhs_weap_aks74u","rhs_30Rnd_545x39_AK"],["rhs_weap_akm","rhs_30Rnd_762x39mm"],["rhs_weap_akms","rhs_30Rnd_762x39mm"],["rhs_weap_svd","rhs_10Rnd_762x54mmR_7N1"],["rhs_weap_pkm","rhs_100Rnd_762x54mmR"],["rhs_weap_makarov_pm","rhs_mag_9x18_8_57N181S"],["rhs_weap_rpg7","rhs_rpg7_PG7V_mag"]]] call ALIVE_fnc_hashSet;

    and Im using

    0 = [] spawn { 
    if (isDedicated) then { 
    waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"}; 
    call compile (preprocessFileLineNumbers "staticData.sqf"); 
    }; 
    };

    in the init field of the ALiVE required module?

    Thanks!

  2. Edited 7 years ago by marceldev89

    Your static data is loading after the modules have done their thing, it seems. You'll have to get rid of the spawn in init.sqf, I think.

  3. Hey bud! Thanks! What spawn in init.sqf?

  4. 0 = [] spawn {
  5. Edited 7 years ago by Opendome

    ahhh so use

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

    in the ALiVE required modules init field?

  6. I tried it but it didnt work, I always used

    0 = [] spawn {
    if (isDedicated) then {
    waitUntil {!isNil "ALiVE_STATIC_DATA_LOADED"};
    call compile (preprocessFileLineNumbers "staticData.sqf");
    };
    };

    before and it worked

  7. Edited 7 years ago by HeroesandvillainsOS

    Sorry I'm not really a coding guy with all the spawns, execVM's all the other confusing things to execute scripts. Lol

    @marceldev89 ?

  8. It's basically the process as explained at http://alivemod.com/wiki/index.php/Declaring_Faction_Mappings . It's possible something else is up though but it should just work.

  9. Yea its strange the method Im using used to work fine until I moved to a new map with new factions then it kept spawning vanilla Opfor support vehicles and weapons/ammo crates

  10. @marceldev89 @SpyderBlack723 can hashCreate still be used for this purpose?

  11. Edited 7 years ago by HeroesandvillainsOS

    ^^^ I'm guessing it will work if you remove the hashCreate parts but please don't rely on me for this. Wait for an expert. :)

    EDIT: 99% certain I'm right (which means there's like a 1% chance or less I am actually right :) ). Remove the whole line from each section (make a backup).

  12. @HeroesandvillainsOS Good point, the hashCreate wipes out all the static data for all other factions not part of your personal staticData.

  13. Edited 7 years ago by Whigital

    Maybe do a ALIVE_fnc_inspectHash on a few of the ALIVE_factionDefault<ssss> hashes after startup to see whats actually in there. Might give a hint to if or where it might get overwritten with new data.

  14. Also, it would probably be best to do a check before calling ALIVE_fnc_hashCreate to not overwrite any static data set by ALiVE:

    if (isNil "ALIVE_factionDefault<ssss>") then {
        ALIVE_factionDefault<ssss> = [] call ALIVE_fnc_hashCreate;
    };
 

or Sign Up to reply!