Jump to content
  • 0
Sign in to follow this  
nidico100

How to spawn WAI Mission on server restart

Question

I created a mission with the WAI Example.

this is the result:

Spoiler

if(isServer) then {
     
    private         ["_mission","_position","_crate1","_crate2","_crate3","_crate4","_fiberplants"];

    // Get a safe position 80 meters from the nearest object
    _position        = [9015.7412, 12935.761];
    
    // Initialise the mission variable with the following options, [position, difficulty, mission name, mission type (MainHero/Mainbandit), minefield (true or false)] call mission_init;
    [_mission,_position,"hard","Weed Delivery","MainBandit",false] call mission_init;

    diag_log         format["WAI: Mission Weed Delivery started at %1",_position];

    //Setup the crate
    _crate1         = createVehicle ["SpecialWeaponsBox",[9016.3799, 12927.087, 3.5677726],[],0,"CAN_COLLIDE"]; //weapons
    _crate2         = createVehicle ["GuerillaCacheBox",[9009.8037, 12930.672, 3.6088436],[],0,"CAN_COLLIDE"]; //hemp
    _crate3         = createVehicle ["USOrdnanceBox",[9013.2539, 12930.277, 0.34331667],[],0,"CAN_COLLIDE"]; //zombieparts
    _crate4         = createVehicle ["USOrdnanceBox",[9027.3027, 12928.585, 0.02336337],[],0,"CAN_COLLIDE"]; //hemp
    _crate1 addweaponCargoGlobal [["AK_74",5],["AK_74_Kobra",3],["AK_47_M",1],["AK_47_S",1]];
    _crate1 addmagazineCargoGlobal [["30Rnd_762x39_AK47",10],["30Rnd_545x39_AK",40]];
    _crate2 addmagazineCargoGlobal [["ItemKiloHemp",50]];
    _crate3 addmagazineCargoGlobal [["ItemZombieParts",12]];
    _crate4 addmagazineCargoGlobal [["ItemKiloHemp",7]];     
     
    // Create some Buildings
_vehicle_279 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9021.6475, 12941.2, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_279 = _this;
  _this setPos [9021.6475, 12941.2, 7.6293945e-006];
};

_vehicle_281 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9023.8242, 12943.091, -4.5776367e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_281 = _this;
  _this setPos [9023.8242, 12943.091, -4.5776367e-005];
};

_vehicle_283 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9024.2988, 12945.313], [], 0, "CAN_COLLIDE"];
  _vehicle_283 = _this;
  _this setPos [9024.2988, 12945.313];
};

_vehicle_285 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9021.1719, 12944.113, 8.392334e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_285 = _this;
  _this setPos [9021.1719, 12944.113, 8.392334e-005];
};

_vehicle_287 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9018.8135, 12941.938, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_287 = _this;
  _this setPos [9018.8135, 12941.938, 3.0517578e-005];
};

_vehicle_289 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9020.6094, 12938.231, -6.1035156e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_289 = _this;
  _this setPos [9020.6094, 12938.231, -6.1035156e-005];
};

_vehicle_291 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9020.3262, 12946.362, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_291 = _this;
  _this setPos [9020.3262, 12946.362, 7.6293945e-006];
};

_vehicle_293 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9018.3203, 12944.568, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_293 = _this;
  _this setPos [9018.3203, 12944.568, 3.0517578e-005];
};

_vehicle_301 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9026.6826, 12946.492, 6.1035156e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_301 = _this;
  _this setPos [9026.6826, 12946.492, 6.1035156e-005];
};

_vehicle_303 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9029.8789, 12941.016, 2.2888184e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_303 = _this;
  _this setPos [9029.8789, 12941.016, 2.2888184e-005];
};

_vehicle_305 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9024.502, 12947.974, 0.00015258789], [], 0, "CAN_COLLIDE"];
  _vehicle_305 = _this;
  _this setPos [9024.502, 12947.974, 0.00015258789];
};

_vehicle_307 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9022.1025, 12947.898, 6.8664551e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_307 = _this;
  _this setPos [9022.1025, 12947.898, 6.8664551e-005];
};

_vehicle_311 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9016.8174, 12947.158, -5.3405762e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_311 = _this;
  _this setPos [9016.8174, 12947.158, -5.3405762e-005];
};

_vehicle_313 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9019.251, 12948.965, -2.2888184e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_313 = _this;
  _this setPos [9019.251, 12948.965, -2.2888184e-005];
};

_vehicle_315 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9015.417, 12944.541, -2.2888184e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_315 = _this;
  _this setPos [9015.417, 12944.541, -2.2888184e-005];
};

_vehicle_317 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9017.5029, 12939.988, 5.3405762e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_317 = _this;
  _this setPos [9017.5029, 12939.988, 5.3405762e-005];
};

_vehicle_319 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9016.2764, 12942.37, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_319 = _this;
  _this setPos [9016.2764, 12942.37, 7.6293945e-006];
};

_vehicle_321 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9026.7568, 12941.954, 3.8146973e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_321 = _this;
  _this setPos [9026.7568, 12941.954, 3.8146973e-005];
};

_vehicle_323 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9027.7598, 12939.567, 6.8664551e-005], [], 0, "CAN_COLLIDE"];
  _vehicle_323 = _this;
  _this setPos [9027.7598, 12939.567, 6.8664551e-005];
};

_vehicle_325 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9029.4951, 12943.715, -7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_325 = _this;
  _this setPos [9029.4951, 12943.715, -7.6293945e-006];
};

_vehicle_329 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9026.4277, 12937.903, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
  _vehicle_329 = _this;
  _this setPos [9026.4277, 12937.903, 7.6293945e-006];
};

_vehicle_333 = objNull;
if (true) then
{
  _this = createVehicle ["fiberplant", [9027.1074, 12944.475, 0.00015258789], [], 0, "CAN_COLLIDE"];
  _vehicle_333 = _this;
  _this setPos [9027.1074, 12944.475, 0.00015258789];
};

    _fiberplants = [_vehicle_279,_vehicle_281,_vehicle_283,_vehicle_285,,_vehicle_289,,_vehicle_293,_vehicle_301,_vehicle_303,,_vehicle_307,_vehicle_311,_vehicle_313,_vehicle_315,_vehicle_317,_vehicle_319,_vehicle_321,_vehicle_323,_vehicle_325,_vehicle_329,_vehicle_333];

    [[9015.7412, 12935.761],1,"extreme","ai_wep_machine",6,"Random","ai_hempchef","ai_gear_hempfarm","Bandit"] call spawn_group;
    [[9015.7412, 12935.761],3,"hard","ai_wep_sniper",3,"Random","ai_hempfarm","ai_gear_hempfarm","Bandit"] call spawn_group;
    [[9015.7412, 12935.761],8,"hard","ai_wep_hempfarm",6,"Random","ai_hempfarm","ai_gear_hempfarm","Bandit"] call spawn_group;
    // Mission objective options and messages
    [
        [_mission,_crate1,crate2,crate3,crate4],    // mission variable (from line 9) and crate
        ["kill"],             // Mission objective type (["crate"], or ["kill"], or ["assassinate", _assassinate])
        [],     // buildings to cleanup after mission is complete, does not include the crate
        "A drug delivery is up to go out, hurry up to claim the weed!",    // mission announcement
        "The weed was taken by survivors!",            // mission success
        "The delivery is gone!!"    // mission fail
    ] call mission_winorfail;

    // End of mission
    diag_log format["WAI: Mission Weed Delivery ended at %1 ended",_position];

    h_missionsrunning = h_missionsrunning - 1;
};

i placed some other buildings on that location in another file (which works fine), which are standing there all the time (i wanted that so)

my question is how can i make this mission spawn always on restart and then not again?

also that the fiberplants don't despawn after mission cleared?

also no timeout for the mission?

and is there any other mistake in that script?

Here is my WAI config.sqf because of the loadouts:

Spoiler

if(isServer) then {

    /* GENERAL CONFIG */

        debug_mode                    = false;        // enable debug
        use_blacklist                = true;            // use blacklist
        blacklist                    = [
            [[0,16000,0],[1000,-0,0]],                // Left
            [[0,16000,0],[16000.0,14580.3,0]]        // Top
        ];

    /* END GENERAL CONFIG */

    /* AI CONFIG */

        ai_clear_body                 = false;        // instantly clear bodies
        ai_clean_dead                 = true;            // clear bodies after certain amount of time
        ai_cleanup_time             = 3600;            // time to clear bodies in seconds
        ai_clean_roadkill            = false;         // clean bodies that are roadkills
        ai_roadkill_damageweapon    = 0;            // percentage of chance a roadkill will destroy weapon AI is carrying

        ai_bandit_combatmode        = "RED";        // combatmode of bandit AI
        ai_bandit_behaviour            = "COMBAT";        // behaviour of bandit AI

        ai_hero_combatmode            = "RED";        // combatmode of hero AI
        ai_hero_behaviour            = "COMBAT";        // behaviour of hero AI

        ai_friendly_behaviour        = true;        // make ai friendly towards comrades

        player_bandit                = -5000;        // this is the amount you declare someone to be a bandit on your server, bandit AI will not attack you if ai_friendly_behaviour is true
        player_hero                    = 5000;            // this is the amount you declare someone to be a hero on your server, hero AI will not attack you if ai_friendly_behaviour is true

        ai_share_info                = true;            // AI share info on player position
        ai_share_distance            = 300;            // distance from killed AI for AI to share your rough position

        ai_kills_gain                = true;            // add kill to bandit/human kill score
        ai_humanity_gain            = true;            // gain humanity for killing AI
        ai_add_humanity                = 10;            // amount of humanity gained for killing a bandit AI
        ai_remove_humanity            = 0;            // amount of humanity lost for killing a hero AI
        ai_special_humanity            = 0;            // amount of humanity gain or loss for killing a special AI dependant on player alignment
        
        ai_skill_extreme            = [["aimingAccuracy",1.00],["aimingShake",1.00],["aimingSpeed",1.00],["endurance",1.00],["spotDistance",1.00],["spotTime",1.00],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];     // Extreme
        ai_skill_hard                = [["aimingAccuracy",0.80],["aimingShake",0.80],["aimingSpeed",0.80],["endurance",1.00],["spotDistance",0.80],["spotTime",0.80],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];     // Hard
        ai_skill_medium                = [["aimingAccuracy",0.60],["aimingShake",0.60],["aimingSpeed",0.60],["endurance",1.00],["spotDistance",0.60],["spotTime",0.60],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];    // Medium
        ai_skill_easy                = [["aimingAccuracy",0.40],["aimingShake",0.50],["aimingSpeed",0.50],["endurance",1.00],["spotDistance",0.50],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];    // Easy
        ai_skill_random                = [ai_skill_extreme,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_hard,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_medium,ai_skill_easy];

        ai_static_useweapon            = true;    // Allows AI on static guns to have a loadout     
        ai_static_weapons            = [];    // static guns

        ai_static_skills            = false;    // Allows you to set custom array for AI on static weapons. (true: On false: Off) 
        ai_static_array                = [["aimingAccuracy",0.20],["aimingShake",0.70],["aimingSpeed",0.75],["endurance",1.00],["spotDistance",0.70],["spotTime",0.50],["courage",1.00],["reloadSpeed",1.00],["commanding",1.00],["general",1.00]];

        ai_gear0                    = [["ItemBandage","ItemBandage","ItemAntibiotic"],["ItemRadio","ItemMachete","ItemCrowbar"]];
        ai_gear1                    = [["ItemBandage","ItemSodaPepsi","ItemMorphine"],["Binocular_Vector"]];
        ai_gear2                    = [["ItemDocument","FoodCanFrankBeans","ItemHeatPack"],["ItemToolbox"]];
        ai_gear3                    = [["ItemWaterbottle","ItemBloodbag"],["ItemCompass","ItemCrowbar"]];
        ai_gear4                    = [["ItemBandage","ItemEpinephrine","ItemPainkiller"],["ItemGPS","ItemKeyKit"]];
        ai_gear_random                = [ai_gear0,ai_gear1,ai_gear2,ai_gear3,ai_gear4];    // Allows the possibility of random gear
        ai_gear5                    = [["ItemMorphine","ItemSodaPepsi","ItemKiloHemp"],["Binocular_Vector"]];
        ai_gear6                    = [["ItemKiloHemp","FoodCanFrankBeans","ItemWaterbottle"],["ItemToolbox"]];
        ai_gear7                    = [["ItemWaterbottle","ItemBloodbag"],["ItemMachete","Binocular_Vector"]];
        ai_gear_hempfarm            = [ai_gear5,ai_gear6,ai_gear7];    // Allows the possibility of random gear
        
        ai_wep_assault                = ["M16A4_ACG","Sa58V_RCO_EP1","SCAR_L_STD_Mk4CQT","M8_sharpshooter","M4A1_HWS_GL_camo","SCAR_L_STD_HOLO","M4A3_CCO_EP1","M4A3_CCO_EP1","M4A1_AIM_SD_camo","M16A4","m8_carbine","BAF_L85A2_RIS_Holo","Sa58V_CCO_EP1"];    // Assault
        ai_wep_machine                = ["RPK_74","MK_48_DZ","M249_EP1_DZ","Pecheneg_DZ","M240_DZ"];    // Light machine guns
        ai_wep_sniper                = ["M14_EP1","SCAR_H_LNG_Sniper_SD","M110_NVG_EP1","SVD_CAMO","VSS_Vintorez","DMR_DZ","M40A3"];    // Sniper rifles
        ai_wep_random                = [ai_wep_assault,ai_wep_assault,ai_wep_assault,ai_wep_sniper,ai_wep_machine];    // random weapon 60% chance assault rifle,20% light machine gun,20% sniper rifle
        ai_wep_launchers_AT            = ["M136","RPG18","JAVELIN"];
        ai_wep_launchers_AA            = ["Strela","Igla","STINGER"];
        ai_wep_hempfarm                = ["AK_74","AKS_74_Kobra","AK_47_M","AK_47_S"];
        
        ai_packs                    = ["DZ_Czech_Vest_Puch","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_British_ACU","DZ_GunBag_EP1","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_LargeGunBag_EP1"];
        ai_hero_skin                = ["FR_AC","FR_AR","FR_Corpsman","FR_GL","FR_Marksman","FR_R","FR_Sapper","FR_TL"];
        ai_bandit_skin                = ["Ins_Soldier_GL_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","GUE_Commander_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_2_DZ","GUE_Soldier_CO_DZ","BanditW1_DZ","BanditW2_DZ","Bandit1_DZ","Bandit2_DZ"];
        ai_special_skin                = ["Functionary1_EP1_DZ"];
        ai_all_skin                    = [ai_hero_skin,ai_bandit_skin,ai_special_skin];
        ai_hempfarm                    = ["GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_2_DZ"];
        ai_hempchef                    = ["Soldier_Sniper_PMC_DZ"];

        ai_add_skin                    = false;            // adds unit skin to inventory on death
        
    /* END AI CONFIG */

    /* WAI MISSIONS CONFIG */
        wai_mission_system            = true;    // use built in mission system

        wai_mission_markers            = ["DZMSMajMarker","DZMSMinMarker","DZMSBMajMarker","DZMSBMinMarker"];
        wai_avoid_missions            = 750;                                // avoid spawning missions this close to other missions, these are defined in wai_mission_markers
        wai_avoid_traders            = 750;                                // avoid spawning missions this close to traders
        wai_avoid_town                = 0;                                // avoid spawning missions this close to towns, *** doesn't function with infiSTAR enabled ***
        wai_avoid_road                = 0;                                // avoid spawning missions this close to roads
        wai_avoid_water                = 50;                                // avoid spawning missions this close to water

        
        wai_mission_timer            = [30,900];                            // time between missions 5-15 minutes
        wai_mission_timeout            = [900,1800];                         // time each missions takes to despawn if inactive 15-30 minutes
        wai_timeout_distance        = 1000;                                // if a player is this close to a mission then it won't time-out
        
        wai_clean_mission            = true;                                // clean all mission buildings after a certain period
        wai_clean_mission_time        = 1800;                                // time after a mission is complete to clean mission buildings

        wai_mission_fuel            = [5,60];                            // fuel inside mission spawned vehicles [min%,max%]
        wai_vehicle_damage            = [20,70];                            // damages to spawn vehicles with [min%,max%]
        wai_keep_vehicles            = false;                            // save vehicles to database and keep them after restart
        wai_linux_server            = false;                            // false = Windows (HiveExt.dll)        true = Linux Server (writer.pl)        has no effect when "wai_keep_vehicles = false;"
        wai_lock_vehicles            = false;                            // lock mission vehicles and add keys to random AI bodies (be careful with ai_clean_dead if this is true

        wai_crates_smoke            = true;                                // pop smoke on crate when mission is finished during daytime
        wai_crates_flares            = true;                                // pop flare on crate when mission is finished during nighttime
        
        wai_players_online            = 1;                                 // number of players online before mission starts
        wai_server_fps                = 5;                                 // missions only starts if server FPS is over wai_server_fps
        
        wai_kill_percent            = 30;                                // percentage of AI players that must be killed at "crate" missions to be able to trigger completion

        wai_high_value                = true;                                // enable the possibility of finding a high value item (defined below crate_items_high_value) inside a crate
        wai_high_value_chance        = 5;                                // chance in percent you find above mentioned item

        wai_enable_minefield        = false;                                // enable minefields to better defend missions
        wai_use_launchers            = false;                            // add a rocket launcher to each spawned AI group
        wai_remove_launcher            = true;                                // remove rocket launcher from AI on death

        // Missions
        wai_radio_announce            = true;                                // Setting this to true will announce the missions to those that hold a radio only
        wai_hero_limit                = 1;                                // define how many hero missions can run at once
        wai_bandit_limit            = 1;                                // define how many bandit missions can run at once

        wai_hero_missions            = [                                 // ["mission filename",% chance of picking this mission],Make sure the chances add up to 100,or it will not be accurate percentages
                                        ["patrol",10],
                                        ["black_hawk_crash",11],
                                        ["armed_vehicle",11],
                                        ["bandit_base",7],
                                        ["captured_mv22",6],
                                        ["ikea_convoy",7],
                                        ["destroyed_ural",10],
                                        ["disabled_milchopper",9],
                                        ["mayors_mansion",9],
                                        ["weapon_cache",10],
                                        ["bandit_patrol",10]
                                    ];
        wai_bandit_missions            = [
                                        ["patrol",10],
                                        ["armed_vehicle",10],
                                        ["black_hawk_crash",10],
                                        ["captured_mv22",6],
                                        ["broken_down_ural",12],
                                        ["hero_base",6],
                                        ["ikea_convoy",8],
                                        ["medi_camp",14],
                                        ["presidents_mansion",6],
                                        ["sniper_extraction",8],
                                        ["weapon_cache",10]
                                    ];
        
        // Vehicle arrays
        armed_vehicle                 = ["ArmoredSUV_PMC_DZE","GAZ_Vodnik_DZE","HMMWV_M1151_M2_CZ_DES_EP1_DZE","HMMWV_M998A2_SOV_DES_EP1_DZE","LandRover_MG_TK_EP1_DZE","LandRover_Special_CZ_EP1_DZE","Pickup_PK_GUE_DZE","Pickup_PK_INS_DZE","Pickup_PK_TK_GUE_EP1_DZE","UAZ_MG_TK_EP1_DZE"];
        armed_chopper                 = [];
        civil_chopper                 = ["AH6X_DZ","BAF_Merlin_DZE","MH6J_DZ","Mi17_Civilian_DZ"];
        military_unarmed             = ["GAZ_Vodnik_MedEvac","HMMWV_Ambulance","HMMWV_Ambulance_CZ_DES_EP1","HMMWV_DES_EP1","HMMWV_DZ","HMMWV_M1035_DES_EP1","LandRover_CZ_EP1","LandRover_TK_CIV_EP1","UAZ_CDF","UAZ_INS","UAZ_RU","UAZ_Unarmed_TK_CIV_EP1","UAZ_Unarmed_TK_EP1","UAZ_Unarmed_UN_EP1"];
        cargo_trucks                 = ["Kamaz","MTVR_DES_EP1","Ural_CDF","Ural_TK_CIV_EP1","Ural_UN_EP1","V3S_Open_TK_CIV_EP1","V3S_Open_TK_EP1"];
        refuel_trucks                = ["KamazRefuel_DZ","MtvrRefuel_DES_EP1_DZ","UralRefuel_TK_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZ"];
        civil_vehicles                 = ["hilux1_civil_1_open","hilux1_civil_2_covered","hilux1_civil_3_open_EP1","SUV_Blue","SUV_Camo","SUV_Charcoal","SUV_Green","SUV_Orange","SUV_Pink","SUV_Red","SUV_Silver","SUV_TK_CIV_EP1","SUV_White","SUV_Yellow"];

        // Dynamic box array
        crates_large                = ["USVehicleBox","RUVehicleBox","TKVehicleBox_EP1"];
        crates_medium                = ["USBasicWeaponsBox","RUBasicWeaponsBox","USSpecialWeaponsBox","USSpecialWeapons_EP1","RUSpecialWeaponsBox","SpecialWeaponsBox","TKSpecialWeapons_EP1","CZBasicWeapons_EP1","UNBasicWeapons_EP1"];
        crates_small                = ["GuerillaCacheBox","RULaunchersBox","RUBasicAmmunitionBox","RUOrdnanceBox","USBasicAmmunitionBox","USLaunchersBox","USOrdnanceBox","USOrdnanceBox_EP1","USLaunchers_EP1","USBasicWeapons_EP1","USBasicAmmunitionBox_EP1","UNBasicAmmunitionBox_EP1","TKOrdnanceBox_EP1","TKLaunchers_EP1","TKBasicAmmunitionBox_EP1","GuerillaCacheBox_EP1","GERBasicWeapons_EP1"];

        crate_weapons_buildables    = ["ChainSaw","ChainSawB","ChainSawG","ChainSawP","ChainSawR"];
        
        crate_tools                    = ["ItemKeyKit","Binocular","Binocular_Vector","ItemCompass","ItemCrowbar","ItemEtool","ItemFishingPole","ItemFlashlightRed","ItemGPS","ItemHatchet_DZE","ItemKnife","ItemMachete","ItemMatchbox_DZE","ItemToolbox","NVGoggles"];
        crate_tools_buildable        = ["ItemToolbox","ItemEtool","ItemCrowbar","ItemKnife"];
        crate_tools_sniper            = ["ItemCompass","Binocular","Binocular_Vector","NVGoggles","ItemGPS"];

        crate_items                    = ["FoodNutmix","FoodPistachio","FoodMRE","ItemSodaOrangeSherbet","ItemSodaRbull","ItemSodaR4z0r","ItemSodaMdew","ItemSodaPepsi","ItemBandage","ItemSodaCoke","FoodbaconCooked","FoodCanBakedBeans","FoodCanFrankBeans","FoodCanPasta","FoodCanSardines","FoodchickenCooked","FoodmuttonCooked","FoodrabbitCooked","ItemTroutCooked","ItemTunaCooked","ItemSeaBassCooked","ItemAntibiotic","ItemBloodbag","ItemEpinephrine","ItemHeatPack","ItemMorphine","ItemGoldBar","ItemGoldBar10oz","CinderBlocks","ItemCanvas","ItemComboLock","ItemLightBulb","ItemLockbox","ItemSandbag","ItemTankTrap","ItemWire","MortarBucket","PartEngine","PartFueltank","PartGeneric","PartGlass","PartPlankPack","PartVRotor","PartWheel","PartWoodPile"];
        crate_items_high_value        = ["ItemBriefcase100oz","ItemVault","30m_plot_kit","ItemHotwireKit"];
        crate_items_food            = ["ItemWaterbottle","FoodNutmix","FoodPistachio","FoodMRE","ItemSodaOrangeSherbet","ItemSodaRbull","ItemSodaR4z0r","ItemSodaMdew","ItemSodaPepsi","ItemSodaCoke","FoodbaconCooked","FoodCanBakedBeans","FoodCanFrankBeans","FoodCanPasta","FoodCanSardines","FoodchickenCooked","FoodmuttonCooked","FoodrabbitCooked","ItemTroutCooked","ItemTunaCooked","ItemSeaBassCooked"];
        crate_items_buildables        = ["forest_large_net_kit","cinder_garage_kit",["PartPlywoodPack",5],"ItemSandbagExLarge5X","park_bench_kit","ItemComboLock",["CinderBlocks",10],"ItemCanvas","ItemComboLock",["ItemLightBulb",5],"ItemLockbox",["ItemSandbag",10],["ItemTankTrap",10],["ItemWire",10],["MortarBucket",10],["PartPlankPack",5],"PartWoodPile"];
        crate_items_vehicle_repair    = ["PartEngine","PartFueltank","PartGeneric","PartGlass","PartVRotor","PartWheel"];
        crate_items_medical            = ["ItemWaterbottle","ItemAntibiotic","ItemBloodbag","ItemEpinephrine","ItemHeatPack","ItemMorphine","ItemBandage","FoodCanFrankBeans","FoodCanPasta"];
        crate_items_chainbullets    = ["2000Rnd_762x51_M134","200Rnd_762x51_M240","100Rnd_127x99_M2","150Rnd_127x107_DSHKM"];
        crate_items_sniper            = [["ItemPainkiller",5],"Skin_Sniper1_DZ","Skin_CZ_Soldier_Sniper_EP1_DZ","Skin_GUE_Soldier_Sniper_DZ"];
        crate_items_president        = ["ItemDocument","ItemGoldBar10oz"];

        crate_backpacks_all            = ["DZ_Patrol_Pack_EP1","DZ_Assault_Pack_EP1","DZ_Czech_Vest_Puch","DZ_TerminalPack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1","DZ_CompactPack_EP1","DZ_British_ACU","DZ_GunBag_EP1","DZ_CivilBackpack_EP1","DZ_Backpack_EP1","DZ_LargeGunBag_EP1"];
        crate_backpacks_large        = ["DZ_GunBag_EP1","DZ_Backpack_EP1","DZ_LargeGunBag_EP1","DZ_CivilBackpack_EP1"];

        crate_random                = [crate_items,crate_items_food,crate_items_buildables,crate_items_vehicle_repair,crate_items_medical,crate_items_chainbullets];

    /* END WAI MISSIONS CONFIG */

    /* STATIC MISSIONS CONFIG */

        static_missions                = false;        // use static mission file
        custom_per_world            = false;        // use a custom mission file per world

    /* END STATIC MISSIONS CONFIG */

    WAIconfigloaded = true;

};

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Okay i cleaned up the code a bit

Spoiler

if(isServer) then {
    
    // I think all variables 
    private ["_mission","_position","_crate1","_crate2","_crate3","_crate4","_fiberplants"];
    
    // position
    _position        = [9015.7412, 12935.761];
    
    // mission_init call with variables
    [_mission,_position,"hard","Weed Delivery","mainbandit",false] call mission_init;
    
    // console
    diag_log         format["WAI: Mission Weed Delivery started at %1",_position];
    
    // loot crates
    _crate1 = createVehicle ["SpecialWeaponsBox",[9016.3799, 12927.087, 3.5677726],[],0,"CAN_COLLIDE"]; //weapons
    _crate1 = setPos [9016.3799, 12927.087, 3.5677726];                                                    //only AK's
    _crate1 addweaponCargoGlobal [["AK_74",5],["AK_74_Kobra",3],["AK_47_M",1],["AK_47_S",1]];            //and magazines
    _crate1 addmagazineCargoGlobal [["30Rnd_762x39_AK47",10],["30Rnd_545x39_AK",40]];                    //end crate 1
    _crate2 = createVehicle ["GuerillaCacheBox",[9009.8037, 12930.672, 3.6088436],[],0,"CAN_COLLIDE"];  //hemp
    _crate2 = setPos [9009.8037, 12930.672, 3.6088436];                                                    //50 kilo
    _crate2 addmagazineCargoGlobal [["ItemKiloHemp",50]];                                                //end crate 2
    _crate3 = createVehicle ["USOrdnanceBox",[9013.2539, 12930.277, 0.34331667],[],0,"CAN_COLLIDE"];     //zombieparts
    _crate3 = setPos [9013.2539, 12930.277, 0.34331667];                                                //because of bodies in the basement
    _crate3 addmagazineCargoGlobal [["ItemZombieParts",12]];                                            //end crate 3
    _crate4 = createVehicle ["USOrdnanceBox",[9027.3027, 12928.585, 0.02336337],[],0,"CAN_COLLIDE"];     //hemp
    _crate4 = setPos [9027.3027, 12928.585, 0.02336337];                                                //only 7 kilo in the garden house
    _crate4 addmagazineCargoGlobal [["ItemKiloHemp",7]];                                                 //end crate 4
    
    // Buildings(weed ["fiberplant"])
    _fiberplant_1 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9023.6328, 12938.506, -3.8146973e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_1 = _this;
            _this setPos [9023.6328, 12938.506, -3.8146973e-005];
        };                
    _fiberplant_2 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9021.6475, 12941.2, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
            _fiberplant_2 = _this;
            _this setPos [9021.6475, 12941.2, 7.6293945e-006];
        };        
    _fiberplant_3 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9023.8242, 12943.091, -4.5776367e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_3 = _this;
            _this setPos [9023.8242, 12943.091, -4.5776367e-005];
        };        
    _fiberplant_4 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9024.2988, 12945.313], [], 0, "CAN_COLLIDE"];
            _fiberplant_4 = _this;
            _this setPos [9024.2988, 12945.313];
        };
    _fiberplant_5 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9021.1719, 12944.113, 8.392334e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_5 = _this;
            _this setPos [9021.1719, 12944.113, 8.392334e-005];
        };
    _fiberplant_6 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9018.8135, 12941.938, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_6 = _this;
            _this setPos [9018.8135, 12941.938, 3.0517578e-005];
        };
    _fiberplant_7 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9020.6094, 12938.231, -6.1035156e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_7 = _this;
            _this setPos [9020.6094, 12938.231, -6.1035156e-005];
        };
    _fiberplant_8 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9020.3262, 12946.362, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
            _fiberplant_8 = _this;
            _this setPos [9020.3262, 12946.362, 7.6293945e-006];
        };
    _fiberplant_9 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9018.3203, 12944.568, 3.0517578e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_9 = _this;
            _this setPos [9018.3203, 12944.568, 3.0517578e-005];
        };
    _fiberplant_10 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9026.6826, 12946.492, 6.1035156e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_10 = _this;
            _this setPos [9026.6826, 12946.492, 6.1035156e-005];
        };
    _fiberplant_11 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9029.8789, 12941.016, 2.2888184e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_11 = _this;
            _this setPos [9029.8789, 12941.016, 2.2888184e-005];
        };
    _fiberplant_12 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9024.502, 12947.974, 0.00015258789], [], 0, "CAN_COLLIDE"];
            _fiberplant_12 = _this;
            _this setPos [9024.502, 12947.974, 0.00015258789];
        };
    _fiberplant_13 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9022.1025, 12947.898, 6.8664551e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_13 = _this;
            _this setPos [9022.1025, 12947.898, 6.8664551e-005];
        };
    _fiberplant_14 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9016.8174, 12947.158, -5.3405762e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_14 = _this;
            _this setPos [9016.8174, 12947.158, -5.3405762e-005];
        };
    _fiberplant_15 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9019.251, 12948.965, -2.2888184e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_15 = _this;
            _this setPos [9019.251, 12948.965, -2.2888184e-005];
        };
    _fiberplant_16 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9015.417, 12944.541, -2.2888184e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_16 = _this;
            _this setPos [9015.417, 12944.541, -2.2888184e-005];
        };
    _fiberplant_17 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9017.5029, 12939.988, 5.3405762e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_17 = _this;
            _this setPos [9017.5029, 12939.988, 5.3405762e-005];
        };
    _fiberplant_18 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9016.2764, 12942.37, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
            _fiberplant_18 = _this;
            _this setPos [9016.2764, 12942.37, 7.6293945e-006];
        };
    _fiberplant_19 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9026.7568, 12941.954, 3.8146973e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_19 = _this;
            _this setPos [9026.7568, 12941.954, 3.8146973e-005];
        };
    _fiberplant_20 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9027.7598, 12939.567, 6.8664551e-005], [], 0, "CAN_COLLIDE"];
            _fiberplant_20 = _this;
            _this setPos [9027.7598, 12939.567, 6.8664551e-005];
        };
    _fiberplant_21 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9029.4951, 12943.715, -7.6293945e-006], [], 0, "CAN_COLLIDE"];
            _fiberplant_21 = _this;
            _this setPos [9029.4951, 12943.715, -7.6293945e-006];
        };
    _fiberplant_22 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9026.4277, 12937.903, 7.6293945e-006], [], 0, "CAN_COLLIDE"];
            _fiberplant_22 = _this;
            _this setPos [9026.4277, 12937.903, 7.6293945e-006];
        };
    _fiberplant_23 = objNull;
        if (true) then
        {
            _this = createVehicle ["fiberplant", [9027.1074, 12944.475, 0.00015258789], [], 0, "CAN_COLLIDE"];
            _fiberplant_23 = _this;
            _this setPos [9027.1074, 12944.475, 0.00015258789];
        };    
    
    // put all fiberplants to one variable
    _fiberplants = [_fiberplant_1,_fiberplant_2,_fiberplant_3,_fiberplant_4,_fiberplant_5,_fiberplant_6,_fiberplant_7,_fiberplant_8,_fiberplant_9,_fiberplant_10,_fiberplant_11,_fiberplant_12,_fiberplant_13,_fiberplant_14,_fiberplant_15,_fiberplant_16,_fiberplant_17,_fiberplant_18,_fiberplant_19,_fiberplant_20,_fiberplant_21,_fiberplant_22,_fiberplant_23];    
    
    // units (1 master, 3 sniper, 8 soldiers)
    [[9015.7412, 12935.761],1,"extreme","ai_wep_machine",6,"Random","ai_hempchef","ai_gear_hempfarm","Bandit"] call spawn_group;
    [[9015.7412, 12935.761],3,"hard","ai_wep_sniper",3,"Random","ai_hempfarm","ai_gear_hempfarm","Bandit"] call spawn_group;
    [[9015.7412, 12935.761],8,"hard","ai_wep_hempfarm",6,"Random","ai_hempfarm","ai_gear_hempfarm","Bandit"] call spawn_group;    
    
    // Mission objective options and messages
    [
        [_mission,_crate1,_crate2,_crate3,_crate4],    // mission variable (from line 9) and crate
        ["crate"],
        [],     // buildings to cleanup after mission is complete, does not include the crate
        "A drug delivery is up to go out, hurry up to claim the weed!",    // announcement
        "The weed was taken by survivors!",            // success
        "The delivery is gone!!"    // fail
    ] call mission_winorfail;
    
    // End of mission
    diag_log format["WAI: Mission Weed Delivery ended at %1 ended",_position];
    h_missionsrunning = h_missionsrunning - 1;
};

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Similar Content

    • By Ghostrider-GRG
      Originally concieved by Blckeagls and supported here with permission
      Completely rewritten  to remove bugs and add functionallity.
       
       
      Current Version: Version 6.92
      Current Build: 180
      Description.
      Built-in support for Epoch or Exile.
      Updated: Built in Headless client support.
      New: includes tools to export missions from A3EDEN Editor - minimal editing/scripting required to generate new missions once the design is completed in the editr.
      A complete static and dynamic mission system rolled into one.
       
      AI infantry will aggressively pursue attackers, flank, use cover, and communicate with aircraft and ground vehicles.
      Supports missions on land and underwater.
      Includes hostage and arrest enemy leader style missions as well as conventional capture the crate missions.
      Missions can have infantry, static weapons, armed vehicle patrols and aircraft defending the area.
      Built in support for militarized missions with tanks and attack helis or jets if you wish.
      AI loadouts can be defined by arrays or based on items in CfgPricing (Epoch) or the Arsenal (Exile)
      Supports spawning of static AI infantry, vehicles, aircraft, surface vessels, static emplaced weapons and subs with scuba divers.
      Includes tools forspawning map addons exported using M3EDEN editor plugin.
      Includes tools for spawning static loot crates which can be randomized at each area, be spawned with a smoking wreck nearby to create that post-appocolyptic feels, and have randomized .oot.
      To download go to: https://github.com/Ghostrider-DbD-/blckeagles-revisited-RC
      For installation see: https://github.com/Ghostrider-DbD-/blckeagles-revisited-RC/blob/master/INSTALLATION.txt
      For a complete changelog see: https://github.com/Ghostrider-DbD-/blckeagles-revisited-RC/blob/master/changeLog.sqf
      V 6.90  Build 175
      Changes Include:
      1. Added new settings to specify the number of crew per vehhicle to blck_config.sqf and blck_config_mil.sqf
       
          // global settings for this parameters
          // Determine the number of crew plus driver per vehicle; excess crew are ignored.
          // This can be a value or array of [_min, _max];
          blck_vehCrew_blue = 3;
          blck_vehCrew_red = 3;
          blck_vehCrew_green = 3;
          blck_vehCrew_orange = 3;
          You can also define this value in missions by adding the following variable definition to the mission template:
          _vehicleCrewCount = [3,6]; // min/max number of AI to load including driver. see the missions\blue\template.sqf and blck_configs.sqf for more info.
      2.  Lists of items to be excluded from dynamically generated loadouts has been moved to:
          blck_config.sqf
          blck_config_mil.sqf
      3. Added a new setting that specifies whether logging of blacklisted items is done (handy for debugging)
          blck_logBlacklistedItems = true;  // set to false to disable logging
      4. Hit and Killed event handlers extensively reworked. Methods for notification of nearby AI and Vehicles of the killers whereabouts were revised to be more inclusive of neighboring AI.
      5. Issues with AIHit events fixed; AI now deploy smoke and heal.
      6. Removed some unnecessary logging.
      7. Other minor coding fixes and optimizations.
      Credits:
          Epoch Mod developer team, and in particular AWOL whose code has provided many lessons in scripting.
        blckeagls - Original developer of mission system 2.0.2   Narines - bug fixes and improvements.   Bill (DBD Clan) example compositions.   cyncrwler for help with troubleshooting and testing   Brian Soanes for helpful changes and performance tweaks.   Grahame for many rounds of testing, feedback and suggestions regarding features.   zxbutchxz for extensive testing of AI behavior. MGTDB for the fix for an issue with interacting with captives/targets on Exile servers. * Additional Credits include authors of other missions systems and scripts who's work influenced this release:
         Halve and He-Man.     Face (A3EAI)     KiloSwiss (SEM)     Hogscrapper (HC missions for A3)     the Vampire (DZMS and VEMF)     The FUCHS (EMS)     lazylink (early A2 Epoch mission system)     Matt11 (Wicked AI) Updates: License
      This Mission System is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
      http://creativecommons.org/licenses/by-nc-sa/4.0/
       
       

       
    • By heiko33
      Downlod        
      https://ln.sync.com/dl/043e1b3c0/wkrywtzv-idjkp722-wzfqg9g6-53b7xfyj
       
       
       
    • By FG_Trap
      Made a quick static ai mission that spawns on restart. 
      12 ai patrol the compound 
      4 Static m2's
      1 Heli Patrolling the compound 
      Crate for who ever clears all the ai.
      Some screenshots of the compound 


       
      https://github.com/Trapxxgods/Wai-Static-Mission 
    • By C4-timah
      I sure this is possible, I've seen it on He-Man's server, but where are the options to enable these?
      1. How to you get missions to be announced over the epoch radio
      2. How to claim missions - currently no claiming required
      3. Extend safe zones around protected traders
      4. Add more missions beyond the default 12 bandit missions.
       
      I know this is a lot to ask. I'm new at this and the sea of forum posts are extremely elusive for the specific questions above. Links and comments would be greatly appreciated!
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...