Jump to content

Snakeyes

Member
  • Posts

    292
  • Joined

  • Last visited

Posts posted by Snakeyes

  1. I would like to run a query to periodically remove unused vehicles from the map. It doesn't matter if they are locked or not, but I don't want to delete vehicles that belong to active players. So for example, if a vehicle has not been used for more than 14 days it would be deleted. Mostly, I'm looking for a quick solution to clear all of the older map spawned vehicles.

  2. Hi chisel,

     

    Here are two missions that I have made for FMission. You are welcome to them.

     

    Death Wish

    /*


    File Name: FMission_M3_DeathWish.sqf
    File Created: 3/29/2014
    File Version: 1.0
    File Author: Snakeyes
    File Last Edit Date: 3/29/2014
    File Description: DeathWish (M3)
    Template by: Foamy
    */

    // CHECK FOR ANOTHER MISSION 3 RUNNING START ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    if (isNil "EPOCH_MISSION3_RUNNING") then
    {
    EPOCH_MISSION3_RUNNING = false;
    };

    if (EPOCH_MISSION3_RUNNING) exitWith
    {
    diag_log("MISSION 3 already running");
    };

    // CHECK FOR ANOTHER MISSION 3 RUNNING END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    // Don't forget to add all your "_names" to the private section
    private ["_missionSpawnChance","_spawnMarker","_spawnRadius","_markerRadius","_markerColor","_item","_loot","_loot_lists","_loot_box","_wait_time","_spawnRoll","_position","_loot_pos","_loot_box","_textMarker_IconType","_markerText","_markerBrush","_base","_aiunit_spawn_pos","_aivehicle_spawn_pos","_aiheli_spawn_pos","_aiunit1","_aiunit2","_aiunit3","_aiunit4","_aiunit5","_aiunit6","_aiunit7","_aiunit8","_aiunit9","_aiunit10","_aiunit11","_attackgroup","_attacker1","_attacker2","_targetunitsAlive","_timeout"];

    diag_log("MISSION 3: DeathWish - Script Started");

    _missionSpawnChance = 1; //Set Spawn Chance Here 1 = always
    _spawnRoll = random 1;

    diag_log("MISSION 3: DeathWish - Checking MissionSpawnChance");
    if (_spawnRoll > _missionSpawnChance) exitWith
    {
    diag_log format ["MISSION 3: DeathWish - Failed with %1 it needed to be lower than %2",_spawnRoll,_missionSpawnChance];
    };

    sleep .5;
    diag_log("MISSION 3: DeathWish - Mission SpawnChance Success");

    sleep .5;
    diag_log("MISSION 3: DeathWish - Mission Script Started");

    EPOCH_MISSION3_RUNNING = true;

    /*
    // Edit Loot Box Contents Below
    // Format is:
    // 1st row = Weapons, Tools ( Compass, etc)
    // 2nd row = Ammo, Food items etc
    // 3rd row = Backpacks

    The loot example in this template has 2 loadouts to choose from, you can add as many as you want. The more you add the more
    variety you will have.
    Each addition will use a block like this:
    [
    ["DMR","NVGoggles","Binocular_Vector"],
    ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemSodaMdew","ItemSodaR4z0r","ItemAntibiotic"],
    ["DZ_Backpack_EP1"]
    ], <---- The , is NOT needed on last loot block, see example below where the , is only used to separate the
    first block from the second block. There is no , at the end of the second block as it is the last block in
    the list.
    */

    //---------------------------------------------------------------------------------

    // Loot Box Setup
    _loot_box = "GuerillaCacheBox";
    _loot_lists = [
    [
    ["DMR","DMR","DMR","NVGoggles","NVGoggles","Binocular_Vector","Binocular_Vector"],
    ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemSodaMdew","ItemSodaR4z0r","ItemAntibiotic"],
    ["DZ_Backpack_EP1"]
    ],
    [
    ["M4A1_AIM_SD_CAMO","ItemGPS","Binocular"],
    ["30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemSodaRbull"],
    ["DZ_ALICE_Pack_EP1"]
    ]
    ];

    //---------------------------------------------------------------------------------

    _loot = _loot_lists call BIS_fnc_selectRandom;

    // Mission Variables
    mission_despawn_timer = 1200; // This sets the Timeout if a timer is used.
    _wait_time = 900; // This is how long the loot box will stay once it spawns.
    _spawnRadius = 5000; // This is the distance from Center - Used to determine the radius in which missions will spawn
    _spawnMarker = 'center'; // DO NOT Change this, UNLESS you need a hard coded center loc for custom purposes
    _markerRadius = 350; // This sets marker radius and the area the loot can spawn in
    _markerColor = "ColorBlue"; // This sets the Marker Color
    _textMarker_IconType = "mil_objective"; // This sets the "Icon Type" (https://community.bi...wiki/cfgMarkers)
    _markerText = "Mission: Sniper Alley"; // Text to display at Marker (Leave "" blank if you dont want a message)
    _markerBrush = "SOLID"; // Marker Brush - How the marker is filled in


    // This sets the global position coords the mission needs to run, do not change.
    _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,20,0] call BIS_fnc_findSafePos;
    _loot_pos = [_position,0,(_markerRadius - 100),10,0,20,0] call BIS_fnc_findSafePos;

    // Use these if using AI, Vehicles or Helis
    _aiunit_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    _aivehicle_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    _aiheli_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;

    //---------------------------------------------------------------------------------
    // Mission Body STARTS Here
    // Read General Script Instructions for Variable Usage per script.

    // Add a Marker? Make sure to use FMarker3.sqf for M3 Missions
    [_position,_loot_pos,_markerRadius,_markerColor,false,_textMarker_IconType,_markerText,_markerBrush] execVM "\z\addons\dayz_server\addons\FMission\FMarker\FMarker3.sqf";

    // Add a base
    _base = createVehicle ["Land_fortified_nest_big",_loot_pos,[], 0, "CAN_COLLIDE"];
    _base setPos _loot_pos;

    // Add some AI to patrol
    sleep 1;

    diag_log("MISSION 3: DeathWish - Loading -=FAI Units=- Started");

    _aiunit1 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit2 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit3 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit4 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit5 = [_aiunit_spawn_pos,50,4,"Medic",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit6 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit7 = [_aiunit_spawn_pos,50,4,"Medic",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit8 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit9 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit10 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit11 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    sleep 10;
    diag_log("MISSION 3: DeathWish - Loading -=FAI=- Completed");

    sleep .5;

    // Add a one off custom AI
    _attackgroup = createGroup east;

    _attacker1 = _attackgroup createUnit ["TK_INS_Soldier_3_EP1", _base, [], 0, "Form"];
    [_attacker1] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Bandit.sqf";
    _attacker1 setUnitPos "Middle";

    _attacker2 = _attackgroup createUnit ["TK_Soldier_Medic_EP1", _base, [], 0, "Form"];
    [_attacker2] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Medic.sqf";
    _attacker2 setUnitPos "Middle";

    _attackgroup setCombatMode "RED";
    _attackgroup setBehaviour "STEALTH";


    // Add a Heli Patrol
    _aiHeli = [_aiheli_spawn_pos,_loot_pos,250,"M1"] execVM "\z\addons\dayz_server\addons\FAI\FMission\FAI_Create_Heli.sqf";


    // Add a Vehicle patrols?
    _aiVehicle = [_aivehicle_spawn_pos,_loot_pos,100,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Vehicle.sqf";


    [nil,nil,rTitleText,"MISSION: DeathWish - A group of Bandit Snipers are wreaking havoc in the area. Go check it out!", "PLAIN",10] call RE;

    diag_log("MISSION 3: DeathWish - Waiting...");
    _timeout = time + mission_despawn_timer;

    waitUntil
    {
    _targetunitsAlive = {alive _x} count (units _attackgroup);
    ((time > _timeout) || (_targetunitsAlive < 1))
    };

    _targetunitsAlive = {alive _x} count (units _attackgroup);
    if (_targetunitsAlive < 1) then
    {
    [nil,nil,rTitleText,"MISSION: Survivors have eliminated the Bandit Snipers and their comrades, Good Job.", "PLAIN",10] call RE;

    // Create loot box
    diag_log("MISSION 3: DeathWish - Creating loot box");
    _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
    _loot_box setPos _loot_pos;
    clearMagazineCargoGlobal _loot_box;
    clearWeaponCargoGlobal _loot_box;
    clearBackpackCargoGlobal _loot_box;

    // Add loot
    diag_log("MISSION 3: DeathWish - Loot box created, adding loot to loot box");
    {
    _loot_box addWeaponCargoGlobal [_x,1];
    } forEach (_loot select 0);
    {
    _loot_box addMagazineCargoGlobal [_x,1];
    } forEach (_loot select 1);
    {
    _loot_box addBackpackCargoGlobal [_x,1];
    } forEach (_loot select 2);

    // Wait for awhile so loot can be collected?
    sleep _wait_time;

    // Clean up
    EPOCH_MISSION3_RUNNING = false;

    deleteVehicle _base;
    deleteVehicle _loot_box;
    { deleteVehicle _x } forEach units _attackgroup;
    deleteGroup _attackgroup;

    diag_log("MISSION 3: DeathWish - Script Finished");
    }
    else
    {
    [nil,nil,rTitleText,"MISSION: Mission Failed", "PLAIN",10] call RE;

    // Clean up
    EPOCH_MISSION3_RUNNING = false;

    deleteVehicle _base;
    { deleteVehicle _x } forEach units _attackgroup;
    deleteGroup _attackgroup;

    diag_log("MISSION 3: DeathWish - Script Finished");
    };

     

    Wells Fargo

    /*


    File Name: FMission_M3_WellsFargo.sqf
    File Created: 3/28/2014
    File Version: 1.0
    File Author: Snakeyes
    File Last Edit Date: 3/28/2014
    File Description: WellsFargo (M3)
    Template by: Foamy
    */

    // CHECK FOR ANOTHER MISSION 3 RUNNING START ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    if (isNil "EPOCH_MISSION3_RUNNING") then
    {
    EPOCH_MISSION3_RUNNING = false;
    };

    if (EPOCH_MISSION3_RUNNING) exitWith
    {
    diag_log("MISSION 3 already running");
    };

    // CHECK FOR ANOTHER MISSION 3 RUNNING END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    // Don't forget to add all your "_names" to the private section
    private ["_missionSpawnChance","_spawnMarker","_spawnRadius","_markerRadius","_markerColor","_item","_loot","_loot_lists","_loot_box","_wait_time","_spawnRoll","_position","_loot_pos","_loot_box","_textMarker_IconType","_markerText","_markerBrush","_base","_aiunit_spawn_pos","_aivehicle_spawn_pos","_aiheli_spawn_pos","_aiunit1","_aiunit2","_aiunit3","_aiunit4","_aiunit5","_aiunit6","_aiunit7","_attackgroup","_attacker1","_attacker2","_targetunitsAlive","_timeout"];

    diag_log("MISSION 3: WellsFargo - Script Started");

    _missionSpawnChance = 1; //Set Spawn Chance Here 1 = always
    _spawnRoll = random 1;

    diag_log("MISSION 3: WellsFargo - Checking MissionSpawnChance");
    if (_spawnRoll > _missionSpawnChance) exitWith
    {
    diag_log format ["MISSION 3: WellsFargo - Failed with %1 it needed to be lower than %2",_spawnRoll,_missionSpawnChance];
    };

    sleep .5;
    diag_log("MISSION 3: WellsFargo - Mission SpawnChance Success");

    sleep .5;
    diag_log("MISSION 3: WellsFargo - Mission Script Started");

    EPOCH_MISSION3_RUNNING = true;

    /*
    // Edit Loot Box Contents Below
    // Format is:
    // 1st row = Weapons, Tools ( Compass, etc)
    // 2nd row = Ammo, Food items etc
    // 3rd row = Backpacks

    The loot example in this template has 2 loadouts to choose from, you can add as many as you want. The more you add the more
    variety you will have.
    Each addition will use a block like this:
    [
    ["DMR","NVGoggles","Binocular_Vector"],
    ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemSodaMdew","ItemSodaR4z0r","ItemAntibiotic"],
    ["DZ_Backpack_EP1"]
    ], <---- The , is NOT needed on last loot block, see example below where the , is only used to separate the
    first block from the second block. There is no , at the end of the second block as it is the last block in
    the list.
    */

    //---------------------------------------------------------------------------------

    // Loot Box Setup
    _loot_box = "GuerillaCacheBox";
    _loot_lists = [
    [
    ["DMR","NVGoggles","Binocular_Vector"],
    ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemSodaMdew","ItemSodaR4z0r","ItemAntibiotic"],
    ["DZ_Backpack_EP1"]
    ],
    [
    ["M4A1_AIM_SD_CAMO","ItemGPS","Binocular"],
    ["30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","ItemSodaRbull"],
    ["DZ_ALICE_Pack_EP1"]
    ],
    [
    ["glock17_EP1"]
    ["17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemBriefcase100oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemMorphine"]
    [DZ_CivilBackpack_EP1]
    ];

    //---------------------------------------------------------------------------------

    _loot = _loot_lists call BIS_fnc_selectRandom;

    // Mission Variables
    mission_despawn_timer = 1200; // This sets the Timeout if a timer is used.
    _wait_time = 900; // This is how long the loot box will stay once it spawns.
    _spawnRadius = 5000; // This is the distance from Center - Used to determine the radius in which missions will spawn
    _spawnMarker = 'center'; // DO NOT Change this, UNLESS you need a hard coded center loc for custom purposes
    _markerRadius = 350; // This sets marker radius and the area the loot can spawn in
    _markerColor = "ColorBlue"; // This sets the Marker Color
    _textMarker_IconType = "mil_objective"; // This sets the "Icon Type" (https://community.bistudio.com/wiki/cfgMarkers)
    _markerText = "Mission: Wells Fargo Transport"; // Text to display at Marker (Leave "" blank if you dont want a message)
    _markerBrush = "SOLID"; // Marker Brush - How the marker is filled in


    // This sets the global position coords the mission needs to run, do not change.
    _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,20,0] call BIS_fnc_findSafePos;
    _loot_pos = [_position,0,(_markerRadius - 100),10,0,20,0] call BIS_fnc_findSafePos;

    // Use these if using AI, Vehicles or Helis
    _aiunit_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    _aivehicle_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
    _aiheli_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;

    //---------------------------------------------------------------------------------
    // Mission Body STARTS Here
    // Read General Script Instructions for Variable Usage per script.

    // Add a Marker? Make sure to use FMarker3.sqf for M3 Missions
    [_position,_loot_pos,_markerRadius,_markerColor,false,_textMarker_IconType,_markerText,_markerBrush] execVM "\z\addons\dayz_server\addons\FMission\FMarker\FMarker3.sqf";

    // Add a base?
    _base = createVehicle ["Land_fortified_nest_big",_loot_pos,[], 0, "CAN_COLLIDE"];
    _base setPos _loot_pos;

    // Add some AI to patrol?
    sleep 1;

    diag_log("MISSION 3: WellsFargo - Loading -=FAI Units=- Started");

    _aiunit1 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit2 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit3 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit4 = [_aiunit_spawn_pos,50,4,"Medic",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit5 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit6 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    _aiunit7 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";

    sleep 10;
    diag_log("MISSION 3: WellsFargo - Loading -=FAI=- Completed");

    sleep .5;

    // Add a one off custom AI?
    _attackgroup = createGroup east;

    _attacker1 = _attackgroup createUnit ["TK_INS_Soldier_3_EP1", _base, [], 0, "Form"];
    _attacker1 setUnitPos "AUTO";
    [_attacker1] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Bandit.sqf";
    _attacker1 setUnitPos "Middle";

    _attacker2 = _attackgroup createUnit ["TK_Soldier_Medic_EP1", _base, [], 0, "Form"];
    _attacker2 setUnitPos "AUTO";
    _null = [_attacker2] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Medic.sqf";
    _attacker2 setUnitPos "Middle";

    _attackgroup setCombatMode "RED";
    _attackgroup setBehaviour "STEALTH";


    // Add a Heli Patrol?
    _aiHeli = [_aiheli_spawn_pos,_loot_pos,250,"M1"] execVM "\z\addons\dayz_server\addons\FAI\FMission\FAI_Create_Heli.sqf";

    // Add a Vehicle patrols?
    _aiVehicle = [_aivehicle_spawn_pos,_loot_pos,100,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Vehicle.sqf";


    [nil,nil,rTitleText,"MISSION: WellsFargo - A Wells Fargo Transport has crashed. Hurry there now to secure the location!", "PLAIN",10] call RE;

    diag_log("MISSION 3: WellsFargo - Waiting...");
    _timeout = time + mission_despawn_timer;
    waitUntil
    {
    _targetunitsAlive = {alive _x} count (units _targetgroup);
    ((time > _timeout) || (_targetunitsAlive < 1))
    };

    _targetunitsAlive = {alive _x} count (units _targetgroup);
    if (_targetunitsAlive < 1) then
    {
    [nil,nil,rTitleText,"MISSION: Survivors have captured the Wells Fargo Transport cargo and eliminated the Bandits, Good Job.", "PLAIN",10] call RE;


    // Create a loot box?
    // Create loot box
    diag_log("MISSION 3: WellsFargo - Creating loot box");
    _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
    _loot_box setPos _loot_pos;
    clearMagazineCargoGlobal _loot_box;
    clearWeaponCargoGlobal _loot_box;
    clearBackpackCargoGlobal _loot_box;

    // Add loot
    diag_log("MISSION 3: WellsFargo - Loot box created, adding loot to loot box");
    {
    _loot_box addWeaponCargoGlobal [_x,1];
    } forEach (_loot select 0);
    {
    _loot_box addMagazineCargoGlobal [_x,1];
    } forEach (_loot select 1);
    {
    _loot_box addBackpackCargoGlobal [_x,1];
    } forEach (_loot select 2);

    // Wait for awhile so loot can be collected?
    sleep _wait_time;


    // Mission Body ENDS here
    // ---------------------------------------------------------------------------------


    // Add additional deleteVehicle _xxx; for each item that needs to be deleted.
    // Add additional deleteVehicle _xxgroup; to delete the AI units
    // Clean up
    EPOCH_MISSION3_RUNNING = false;

    deleteVehicle _base;
    deleteVehicle _loot_box;
    { deleteVehicle _x } forEach units _targetgroup;
    deleteGroup _targetgroup;
    { deleteVehicle _x } forEach units _attackgroup;
    deleteGroup _attackgroup;

    diag_log("MISSION 3: WellsFargo - Script Finished");
    }
    else
    {
    [nil,nil,rTitleText,"MISSION: Mission Failed", "PLAIN",10] call RE;

    // Clean up
    EPOCH_MISSION3_RUNNING = false;

    deleteVehicle _base;
    { deleteVehicle _x } forEach units _attackgroup;
    deleteGroup _attackgroup;

    diag_log("MISSION 3: WellsFargo - Script Finished");
    };

  3. Didn't know you could direct them to drive/fly...cool stuff :)

    Yep, I use the tilde key "~" to bring up the commands. Then order them to get in the vehicle by pointing at it with the cursor (gun) and selecting "Get In [vehicle]". I get in last and let the AI take the driver/pilot/gunner seats. Bring up the map to the general area for your destination location and move the map cursor to your destination point. Next, highlight the "Move There" option with the scroll wheel and hit enter. You should be on your way. If you are in a helicopter the pilot doesn't land it when you arrive. It hovers over that destination point. If you want to land there, select the "Disembark" option from the command menu. The pilot will land there and get out after landing.

  4. I did some testing with the Survivor AI. They can drive (somewhat reckless) and they can fly. I recruited one AI to fly, then we flew up to the NEAF and picked up two more AI. I rode in the back of the Blackhawk to observe on the way back to my base. The door gunners were active firing off a burst here and there and the pilot keeps it low and fast. This reminds me of Daizy (single player mod) in a MP environment. I'm going to try an AI mission with them later today. This mod is really cool. It will be interesting to see where it goes from here. Persistent AI? Buy units at a trader? Custom units, etc.

  5. I'm going to try to clean up the loose ends this morning. I ran out of time to get it finished when I had to leave for work yesterday. Will do gopostal. I've been meaning to stop by your TS and say hi anyways. Did you resolve the BE kick when you dismiss an AI survivor? I think it was waypoint restriction #0 or something like that.

     

    From playing some ArmA2 and ArmA3, the AI seem a little difficult to manage at first, but it got easier. I like some of the possibilities with this mod. Even if I can use them as pack mules to help clean up the loot at mission sites it will be helpful. It can't hurt to have them lay down some cover fire.

  6. I want the survivors to kill zeds. This part of the OP is a little confusing:

     

    Now if you want the zeds to be killed by the survivors you will need to create a custom zombie_generate.sqf file and
    add a single line to it near the very end of the script, there are plenty of examples of how to edit your compiles script to point to a new file
    This is the compiles.sqf line you need to make point to your new file
    zombie_generate
    = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";

     

    Do I need to create an additional zombie_generate.sqf file? My compiles.sqf file already has this line of code:

    zombie_generate = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_generate.sqf";

     

    I edited the original zombie_generate.sqf file. The only thing that I have changed is this:

     

    At the bottom of zombie_generate.sqf right above
    //Start behavior
    _id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
     
    add
    this
    _agent addRating -1000000;

  7. Installed, works on 1042 Epoch. Getting BE kicks on "Dismiss", need to finish working through fixing those tonight but on a quick test this seems to run as intended. Nice work OP.

     

    I got the BE kick when I used "Dismiss" unit. Other than that it looks good. I want the Zeds to be killed by the survivors, so I'll add that last bit of code tomorrow.

  8. Following is a heavily commented mission I pulled from my custom stuff. It should go a long way to help server admins create their own missions. It's really not that hard if you can follow some basic ideas of map location and logic flow.

     

    // This is meant as an example script and should not be used in your mission folder.

    //It's main use it to explain all the different sections and what to change depending on

    //what you want to do. If you have further questions please don't hesitate to drop me a

    //line. My email is [email protected]

    //This mission is meant to be used on the Napf map and so will not work right on any other.

    //Let's begin, shall we?

    // This is the variable declaration section. These are the vars used in the following code. You MUST

    //declare your variables here for them to replicate properly from server to client. Mostly you won't

    //need to edit anything in this.

    private ["_playerPresent","_cleanmission","_currenttime","_starttime","_missiontimeout","_vehname","_veh","_position","_vehclass","_vehdir","_objPosition"];

    // This sets the class name used for the _vehclass variable.

    _vehclass = "UH1H_DZE";

    // Here the vehname is declared depending on what you set the vehclass above as

    // This will be used later on in the code to set the proper name of the vehicle to

    //the map flag everyone sees

    _vehname    = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");

    // This declares the center point for the mission. Very important as most missions end when

    //a player gets within X meters of the objective (which is THIS position, not the crate or vehicle).

    _position = [3765.69, 14348.5, 0];

    // Adds a log line to the server rpt letting you know what's currently running

    diag_log format["WAI: Mission Beachhead Started At %1",_position];

    // The vehicle declared above is being created and placed in this section

    _veh = createVehicle [_vehclass,_position, [], 0, "CAN_COLLIDE"];

    // Which way to point the vehicle? In this case it will be random

    _vehdir = round(random 360);

    //Set the vehicle pointing the generated way

    _veh setDir _vehdir;

    //These two lines are housekeeping for proper vehicle creation

    clearWeaponCargoGlobal _veh;

    clearMagazineCargoGlobal _veh;

    _veh setVariable ["ObjectID","1",true];

    PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_veh];

    // Log line letting the rpt know the server spawned a 'vehname' declared above

    diag_log format["WAI: Mission Beachhead spawned a %1",_vehname];

    // Declaration of the created vehicles position

    _objPosition = getPosATL _veh;

    // Here we get into the actor generation. I'll explain each line

    // Creates a random number from 0 to 3, then adds 3 to that number. You end up with a number

    //from 3 to 6.

    _rndnum = round (random 3) + 3;

    // Remember when we declared the _position above? Well here it's used to set the actors down.

    // Really this is easiest to think of as simple X,Y,Z coordinates. "Select 0" means the X,

    //"Select 1" is the Y, and 0 is the Z or height. Above we said "_position = [3765.69, 14348.5, 0]"

    //so you can plug those values in here mentally and see that it reads "3765.69" as the first value, etc.

    [[_position select 0, _position select 1, 0],                  //position

    // Remember the random number generated above? Here it's plugged in to create the number of actors

    _rndnum,                  //Number Of units

    1,                          //Skill level 0-1. Has no effect if using custom skills

    "Random",                  //Primary gun set number. "Random" for random weapon set.

    4,                          //Number of magazines

    "",                          //Backpack "" for random or classname here.

    "CZ_Special_Forces_GL_DES_EP1_DZ",                          //Skin "" for random or classname here.

    "Random",                  //Gearset number. "Random" for random gear set.

    true

    ] call spawn_group;

    //This group is handled just like above.

    [[_position select 0, _position select 1, 0],                  //position

    4,                          //Number Of units

    1,                          //Skill level 0-1. Has no effect if using custom skills

    "Random",                  //Primary gun set number. "Random" for random weapon set.

    4,                          //Number of magazines

    "",                          //Backpack "" for random or classname here.

    "CZ_Special_Forces_GL_DES_EP1_DZ",                          //Skin "" for random or classname here.

    "Random",                  //Gearset number. "Random" for random gear set.

    true

    ] call spawn_group;

    // OK, now we have a wrinkle in the position statement but actually it's easy to understand. It adds a small offset to the

    //position so you can spawn something close by without crushing or colliding with your previous spawned actors.

    //There are two spawns in this line so don't get confused. The first one is "[_position select 0, (_position select 1) + 10, 0]"

    //See the "(_position select 1) + 10" part? What that does is add a 10 unit offset to the Y variable meaning the M2 gun will render

    //10 map units more to the Y direction than the _position declaration above. Ingame this means that the static gunners will appear now

    //close to but not right on the clan of soldiers created above. That way everyone comes in safe and sound, grouped nicely and ready for combat.

    [[[_position select 0, (_position select 1) + 10, 0],[(_position select 0) + 10, _position select 1, 0]], //position(s) (can be multiple).

    "M2StaticMG",             //Classname of turret

    0.5,                      //Skill level 0-1. Has no effect if using custom skills

    "CZ_Special_Forces_GL_DES_EP1_DZ",              //Skin "" for random or classname here.

    0,                          //Primary gun set number. "Random" for random weapon set. (not needed if ai_static_useweapon = False)

    2,                          //Number of magazines. (not needed if ai_static_useweapon = False)

    "",                          //Backpack "" for random or classname here. (not needed if ai_static_useweapon = False)

    "Random",                  //Gearset number. "Random" for random gear set. (not needed if ai_static_useweapon = False)

    true

    ] call spawn_static;

    //This is a spawned patrol boat for this mission. It's armed and deadly. Since I need it to come in on the water

    //I found a spot out in the water close to the beach and I used that position here instead of the way above. Either

    //way is acceptable, it's just that the way above offers more flexibility in most cases.

    //This is the center point of the patrol area

    [[3689.31, 14345.4, 0],   //Position to patrol

    //This is where the boat is created. This doesn't have to be the same spot, you can have the boat render into

    //the game at another location and it will proceed immediately to the patrol area just above. Remember though, the

    //AI are pretty dumb, don't expect them to navigate around an island or through a bridge support. Best to keep them

    //close.

    [3689.31, 14345.4, 0],    // Position to spawn at

    //I kept this small so they could guard the beach completely

    30,                    //Radius of patrol

    3,                     //Number of waypoints to give

    "RHIB",        //Classname of vehicle (make sure it has driver and gunner)

    1                        //Skill level of units

    ] spawn vehicle_patrol;

    //Second boat unit, just like above

    [[3696.84, 14379.3, 0],   //Position to patrol

    [3696.84, 14379.3, 0],    // Position to spawn at

    200,                    //Radius of patrol

    10,                     //Number of waypoints to give

    "RHIB",        //Classname of vehicle (make sure it has driver and gunner)

    1                        //Skill level of units

    ] spawn vehicle_patrol;

    //Here I added paratroopers to cut off the retreat of players. By declaring a small trigger area I ensured

    //the players would be committed to the mission before the troopers dropped in. The players come well into the

    //mission before realizing there are paratroopers coming down on their rear :)  Don't overdo this though, it can

    //get quite hard quite fast on players. To be honest this mission is pretty overdone but my guys wanted a squad

    //level challenge

    [[3765.69, 14348.5, 0],  //Position that units will be dropped by

    [0,0,0],                           //Starting position of the heli

    400,                               //Radius from drop position a player has to be to spawn chopper

    "UH1H_DZ",                         //Classname of chopper (Make sure it has 2 gunner seats!)

    7,                                 //Number of units to be para dropped

    1,                                 //Skill level 0-1 or skill array number if using custom skills "Random" for random Skill array.

    "Random",                          //Primary gun set number. "Random" for random weapon set.

    4,                                 //Number of magazines

    "",                                //Backpack "" for random or classname here.

    "CZ_Special_Forces_GL_DES_EP1_DZ",                      //Skin "" for random or classname here.

    "Random",                          //Gearset number. "Random" for random gear set.

    False                               //True: Heli will stay at position and fight. False: Heli will leave if not under fire.

    ] spawn heli_para;

    // This creates the map marker. It's telling the player to make a marker at "_position" (declared above) and

    //call it "Beach Head".

    [_position,"Beach Head"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";

    //This is a nice improvement over the normal messages you get when the mission starts. It makes a nice

    //pop-up box on the right and you can control the colors, size, and text by adjusting the settings in it.

    // Feel free to experiment with changes until it suits what you want it to look like.

    _hint = parseText format["<t align=center' color='#ff0000' shadow='2' size='1.75'>BEACH HEAD!</t><br/><t  align='center' color='#ffffff'>Legion SEAL teams have landed, watch for water/air support! Use teamwork!</t&gt];

    customRemoteMessage = ['hint', _hint];

    publicVariable "customRemoteMessage";

    //Now the nuts and bolts of running the mission. Mostly you won't need to do anything in here aside

    //from what I'll mark.

    _missiontimeout = true;

    _cleanmission = false;

    _playerPresent = false;

    _starttime = floor(time);

    while {_missiontimeout} do {

        sleep 5;

        _currenttime = floor(time);

        {if((isPlayer _x) AND (_x distance _position <= 150)) then {_playerPresent = true};}forEach playableUnits;

        if (_currenttime - _starttime >= wai_mission_timeout) then {_cleanmission = true;};

        if ((_playerPresent) OR (_cleanmission)) then {_missiontimeout = false;};

    };

    if (_playerPresent) then {

        [_veh,[_vehdir,_objPosition],_vehclass,true,"0"] call custom_publish;

        waitUntil

        {

            sleep 5;

            _playerPresent = false;

            //The next line is the only thing in this part you might need to edit. Do you see "(_x distance _position <= 30)"?

            //That's the distance to your position declaration above that the player has to be in order to trigger the mission

            //as being completed. If you are using a vehicle as the goal you might make this a bit smaller, but if you use a very

            //large vehicle like a C130 you might test it to ensure you can get close enough to the _position to trigger it. In this

            //case the distance is set to 30 units. I've used as low as 8 and as large as 40 depending on the situation.

            {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;

            (_playerPresent)

        };

        

        //Logging that the mission was ended

        diag_log format["WAI: Mission Beachhead Ended At %1",_position];

        

        //This is a pop up box telling the players that the mission ended successfully. It's changed to the color green

        //to reinforce that.

        _hint = parseText format["<t align=center' color='#00FF11' shadow='2' size='1.75'>SUCCESS!</t><br/><t  align='center' color='#ffffff'>Survivors have secured the beach!</t&gt];

        customRemoteMessage = ['hint', _hint];

        publicVariable "customRemoteMessage";

    } else {

        // This section is the mission clean up. It's where the various spawned actors are removed after they

        //are no longer needed.

        clean_running_mission = True;

        deleteVehicle _veh;

        {_cleanunits = _x getVariable "missionclean";

        if (!isNil "_cleanunits") then {

            switch (_cleanunits) do {

                case "ground" : {ai_ground_units = (ai_ground_units -1);};

                case "air" : {ai_air_units = (ai_air_units -1);};

                case "vehicle" : {ai_vehicle_units = (ai_vehicle_units -1);};

                case "static" : {ai_emplacement_units = (ai_emplacement_units -1);};

            };

            deleteVehicle _x;

            sleep 0.05;

        };    

        } forEach allUnits;

        

        //Log line that mission ended without being completed.

        diag_log format["WAI: Mission beachhead Timed Out At %1",_position];

        

        //The other pop up you get if the mission was a failure (uncompleted). It renders in red to reinforce this.

        _hint = parseText format["<t align=center' color='#ff1133' shadow='2' size='1.75'>FAILED</t><br/><t  align='center' color='#ffffff'>Survivors did not secure the beach in time!</t&gt];

        customRemoteMessage = ['hint', _hint];

        publicVariable "customRemoteMessage";

    };

    //This line lets the server know it's ok to spawn the next mission when its time.

    missionrunning = false;

    //Thanks for reading this far. I hope it helps you design your own custom stuff :)

     

    I'll follow up with a zip file of my missions folder as soon as I write a short explanation Readme for what each one is and does.

    Good stuff! Thank you. :)

  9. Running an Epoch server you see players come and go. When they leave the server for good, their base remains on the map. I was an admin for an Epoch server prior to getting my own. One of our tasks was to do a base clean up every 2 weeks or so. We would spawn in Vodniks, Attack Helis and use satchel charges to bring down bases.

     

    Today I used the Base Destruction option in the Admin Tools for the first time. Set the Center, Set the Radius, Show the Dome and finally Destroy everything inside the Dome. The vacant base was cleared in less than 5 minutes. Freaking great! I love these tools!

     

    :)

  10. Would it be possible to use customSpawns.sqf to spawn in both friendly and enemy AI? One thing I like about SARGE AI is when you spawn in on your server there is already a battle going on between the opposing factions of AI. It just oozes ambience when spawning into a war zone and it gives you the feeling that you are just a small part of the bigger picture. If it can be done, I'll spawn in some opposing factions nearby my base.  

  11. Sad that its not compatible with DZAI, I really wish to use it with it.

    I'm currently running DZAI air patrols/vehicle patrols along with the WAI missions on my Napf server. It seems to work fine as far as I can tell. The missions spawn in and the air and land patrols go about their business.

  12. I nearly had a similar accident using delete. I put up light poles on the 4 corners of my barn that I use for a base. With the lights inside and the lights outside, it was way too bright. So I decided to delete the light poles outside. The first pole was no problem. The second pole, the cursor saw my barn rather than the light pole. It was working on deleting my base and I quickly moved to save it. I pay really close attention to the delete message for this function. You have 5 seconds or so to react if you change your mind.

×
×
  • Create New...