Jump to content

Wicked AI/Mission system


Markk311

Recommended Posts

if you put this in custom spawns, and it is not commented out, then it should of worked right away, as the AI will spawn at server start.  your best bet is to post (in a spoiler) your .sqf so people can see exactly what your trying to do

Link to comment
Share on other sites

if you put this in custom spawns, and it is not commented out, then it should of worked right away, as the AI will spawn at server start.  your best bet is to post (in a spoiler) your .sqf so people can see exactly what your trying to do

Ok this is my sqf:

 

 

//Custom Spawns file//

Custom group spawns Eg.

[[3098.71,2476.33,0.001], //position

4,                          //Number Of units

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.

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

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

] call spawn_group;

Place your custom group spawns below

/*

Custom static weapon spawns Eg. (with one position)

[[[911.21545,4532.7612,2.6292224]], //position(s) (can be multiple).

"M2StaticMG",             //Classname of turret

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

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

1,                          //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)

] call spawn_static;

Custom static weapon spawns Eg. (with mutiple positions)

[[[911.21545,4532.7612,2.6292224],[921.21545,4532.7612,2.6292224]], //position(s) (can be multiple).

"M2StaticMG",             //Classname of turret

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

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

1,                          //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)

] call spawn_static;

Place your custom static weapon spawns below

*/

/*

Custom Chopper Patrol spawn Eg.

[[725.391,4526.06,0],    //Position to patrol

[0,0,0],                 // Position to spawn chopper at

2000,                    //Radius of patrol

10,                     //Number of waypoints to give

"UH1H_DZ",                //Classname of vehicle (make sure it has driver and two gunners)

1                        //Skill level of units

] spawn heli_patrol;

Place your heli patrols below

*/

/*

Custom Vehicle patrol spawns Eg. (Watch out they are stupid)

[[725.391,4526.06,0],   //Position to patrol

[725.391,4526.06,0],    // Position to spawn at

200,                    //Radius of patrol

10,                     //Number of waypoints to give

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

1                        //Skill level of units

] spawn vehicle_patrol;

Place your vehicle patrols below this line

*/

/*

Paradropped unit custom spawn Eg.

[[911.21545,4532.7612,2.6292224],  //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!)

5,                                 //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.

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

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

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

] spawn heli_para;

Place your paradrop spawns under this line

*/

 

I just uncommented the Custom group spawns at the top of the sqf & changed the coords to the ones I got for Knin island Taviana.

 

Haven't gotten a mission there so far.

 

Are you saying that should have been the first mission?

 

Mission timer is at default: 1800

 

 

Edit: I found this post:

 

"I also use Taviana and changed the spawn points, feel free to use mine :)

 

You will need to edit all 7 mission files :

_positionarray = [[17380.426,5279.2412,0],[8467.2363,7764.6978,0],[15444.671,8667.6758,0],[8463.8125,5510.5239,0],[16104.994,15535.804,0],[7729.2627,7001.7979,0],[15078.381,15698.128,0],[5759.5493,9423.253,0],[13809.14,19294.951,0],[6098.1333,8610.5947,0],[10285.479,19396.813,0],[4265.5854,7978.0996,0],[8594.7168,19659.965,0],[2260.0608,6925.2681,0],[12143.011,14925.385,0],[4775.9395,6315.7642,0],[12676.353,12593.693,0],[14468.995,10629.646,0],[8412.1973,3045.4038,0],[10173.31,5819.1787,0],[9473.5557,2013.2627,0],[9421.4414,5169.317,0],[9845.7949,3310.0532,0],[10864.61,620.55743,0]];

_position = _positionarray call BIS_fnc_selectRandom;"

 

This was in another part of this thread by a guy named Richie.

 

Where is this _positionarray?

 

I looked through all the files including the mission files but didn't see where this would go.

 

This guy seems to have changed where the missions spawn on Taviana & has posted his coords but I have no idea where it's supposed to go.

 

Link to comment
Share on other sites

First, your custom spawns needs to look like this :


 

//Custom Spawns file//

//Custom group spawns Eg.

[[3098.71,2476.33,0.001], //position
4,                          //Number Of units
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.
"Bandit2_DZ",              //Skin "" for random or classname here.
"Random"                  //Gearset number. "Random" for random gear set.
] call spawn_group;

//Place your custom group spawns below

Notice that I commented out two lines that were basically instructions.  It should work with those changes.  Anything spawned in that SQF spawns as soon as the server starts, it has nothing to do with missions, or the timer. As soon as you start the server and log in you should see them there.

 

The second half changes each mission file like so: Take a Weapons Crate mission for example:

 

 

//Weapon Cache

private ["_positionarray","_position","_box","_missiontimeout","_cleanmission","_playerPresent","_starttime","_currenttime","_cleanunits","_rndnum"]; // Add "_positionarray",


//_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;  //Then this gets changed to the text he said I will just comment it out and add the change under it//

_positionarray = [[17380.426,5279.2412,0],[8467.2363,7764.6978,0],[15444.671,8667.6758,0],[8463.8125,5510.5239,0],[16104.994,15535.804,0],[7729.2627,7001.7979,0],[15078.381,15698.128,0],[5759.5493,9423.253,0],[13809.14,19294.951,0],[6098.1333,8610.5947,0],[10285.479,19396.813,0],[4265.5854,7978.0996,0],[8594.7168,19659.965,0],[2260.0608,6925.2681,0],[12143.011,14925.385,0],[4775.9395,6315.7642,0],[12676.353,12593.693,0],[14468.995,10629.646,0],[8412.1973,3045.4038,0],[10173.31,5819.1787,0],[9473.5557,2013.2627,0],[9421.4414,5169.317,0],[9845.7949,3310.0532,0],[10864.61,620.55743,0]];
_position = _positionarray call BIS_fnc_selectRandom;"

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


_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
[_box] call Medium_Gun_Box;


_rndnum = round (random 3) + 4;
[[_position select 0, _position select 1, 0],                  //position
_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.
"Bandit2_DZ",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true
] call spawn_group;

[[_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.
"Bandit2_DZ",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true
] call spawn_group;

[[[(_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.8,                      //Skill level 0-1. Has no effect if using custom skills
"Bandit2_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;

[_position,"Weapon cache"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Bandits have obtained a weapon crate! Check your map for the location!", "PLAIN",10] call RE;

_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 {
    waitUntil
    {
        sleep 5;
        _playerPresent = false;
        {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
        (_playerPresent)
    };
    diag_log format["WAI: Mission Weapon cache Ended At %1",_position];
    [nil,nil,rTitleText,"Survivors have secured the Weapon Cache!", "PLAIN",10] call RE;
} else {
    clean_running_mission = True;
    deleteVehicle _box;
    {_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;
    
    diag_log format["WAI: Mission Weapon cache timed out At %1",_position];
    [nil,nil,rTitleText,"Survivors did not secure the Weapon Cache in time!", "PLAIN",10] call RE;
};

missionrunning = false;

 

And you would make that change to all the missions.  You can also go in and find new poisitons in the world and add them to the array later.  Just remember [X,Y,Z] and Z is always 0 (level with ground)

Link to comment
Share on other sites

Ok, instead of activating Or Uncommenting the heli patrol spawn I decided to uncomment the Custom group spawns.

This is how it looks:

Custom group spawns Eg.

[[3098.71,2476.33,0.001], //position

4, //Number Of units

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.

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

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

] call spawn_group;

Place your custom group spawns below

The [[3098.71,2476.33,0.001] are the coords I got from database for the middle of Knin island Taviana.

I've been running my server for quiet a while and gone through 4 or 5 missions so far but none have appeared on Knin island. Could it take a while before it appears or does it look like I did it wrong?

Hi.

 

Yes, you need only this block of code:

[[3098.71,2476.33,0.001], //position
4, //Number Of units
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.
"Bandit2_DZ", //Skin "" for random or classname here.
"Random" //Gearset number. "Random" for random gear set.
] call spawn_group;

The /* and the */ only define that everything between are comments, or examples....

 

The two lines:

Custom group spawns Eg. and Place your custom group spawns below

you have to comment out or delete.

 

Other description:

The original state of this file shows up some examples, which you can use by commenting out (delete the /* and */ from the specific block)

 

For better understanding, the entire line "would" be like:

[[3098.71,2476.33,0.001], 4, 1, "Random", 4, "", "Bandit2_DZ", "Random"] call spawn_group;
Link to comment
Share on other sites

First, your custom spawns needs to look like this :

 

//Custom Spawns file//

//Custom group spawns Eg.

[[3098.71,2476.33,0.001], //position
4,                          //Number Of units
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.
"Bandit2_DZ",              //Skin "" for random or classname here.
"Random"                  //Gearset number. "Random" for random gear set.
] call spawn_group;

//Place your custom group spawns below

Notice that I commented out two lines that were basically instructions.  It should work with those changes.  Anything spawned in that SQF spawns as soon as the server starts, it has nothing to do with missions, or the timer. As soon as you start the server and log in you should see them there.

 

The second half changes each mission file like so: Take a Weapons Crate mission for example:

 

 

//Weapon Cache

private ["_positionarray","_position","_box","_missiontimeout","_cleanmission","_playerPresent","_starttime","_currenttime","_cleanunits","_rndnum"]; // Add "_positionarray",


//_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;  //Then this gets changed to the text he said I will just comment it out and add the change under it//

_positionarray = [[17380.426,5279.2412,0],[8467.2363,7764.6978,0],[15444.671,8667.6758,0],[8463.8125,5510.5239,0],[16104.994,15535.804,0],[7729.2627,7001.7979,0],[15078.381,15698.128,0],[5759.5493,9423.253,0],[13809.14,19294.951,0],[6098.1333,8610.5947,0],[10285.479,19396.813,0],[4265.5854,7978.0996,0],[8594.7168,19659.965,0],[2260.0608,6925.2681,0],[12143.011,14925.385,0],[4775.9395,6315.7642,0],[12676.353,12593.693,0],[14468.995,10629.646,0],[8412.1973,3045.4038,0],[10173.31,5819.1787,0],[9473.5557,2013.2627,0],[9421.4414,5169.317,0],[9845.7949,3310.0532,0],[10864.61,620.55743,0]];
_position = _positionarray call BIS_fnc_selectRandom;"

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


_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
[_box] call Medium_Gun_Box;


_rndnum = round (random 3) + 4;
[[_position select 0, _position select 1, 0],                  //position
_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.
"Bandit2_DZ",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true
] call spawn_group;

[[_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.
"Bandit2_DZ",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true
] call spawn_group;

[[[(_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.8,                      //Skill level 0-1. Has no effect if using custom skills
"Bandit2_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;

[_position,"Weapon cache"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Bandits have obtained a weapon crate! Check your map for the location!", "PLAIN",10] call RE;

_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 {
    waitUntil
    {
        sleep 5;
        _playerPresent = false;
        {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
        (_playerPresent)
    };
    diag_log format["WAI: Mission Weapon cache Ended At %1",_position];
    [nil,nil,rTitleText,"Survivors have secured the Weapon Cache!", "PLAIN",10] call RE;
} else {
    clean_running_mission = True;
    deleteVehicle _box;
    {_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;
    
    diag_log format["WAI: Mission Weapon cache timed out At %1",_position];
    [nil,nil,rTitleText,"Survivors did not secure the Weapon Cache in time!", "PLAIN",10] call RE;
};

missionrunning = false;

 

And you would make that change to all the missions.  You can also go in and find new poisitons in the world and add them to the array later.  Just remember [X,Y,Z] and Z is always 0 (level with ground)

 

 

 

 

Ok the "Custom group spawns" works now but with no message on screen & no marker. Is this normal?

 

How long do the AI stay there if no player goes there & kills them?

 

Can I copy & paste that mission so Ai spawn on Knin & also on Shibenik (Prison island on Taviana)? Basically have 2 missions at startup?

 

 

So I copied & pasted what you put for Weapon Cache mission & replaced the default mission file code.

 

Now I'm not getting any regular missions spawning. I can always put the default one back.

 

"//_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos; //Then this gets changed to the text he said I will just comment it out and add the change under it//"

 

Was I supposed to uncomment the above line?

Link to comment
Share on other sites

Your having a case of modifying to many things at once and not being able to troubleshoot one issue at a time.

 

Customspawns.sqf is just that, custom spawns used for AI areas and stuff. Not missions, so there will be no marker unless you add one. Adding Markers is pretty easy but worry about those after your missions are fixed.

 

As far as not getting any missions that could be a issue elsewhere becuase unless you did other editing, to other files, missions should spawn.  Even if the one mission is busted eventually a different mission will spawn. The rest of the missions are in rotation so there would still be a chance of getting one of those over the weapons cache. So if no missions are spawning WAI is broken before it even gets to the missions.  To investigate this I would strongly suggest learning the power of the RPT log.  If read well it will tell you of any code errors, and when WAI spawns stuff from the customspawns.sqf, staticammoboxes.sqf, when missions start and end, and what is spawned for those missions. It goes a long way in tracking down all kinds of errors.

 

 

Once thats sorted it would be good to focus on the one missions. To do this you have to edit your missioncfg.sqf  and change this section:

 

// missions used when selecting the next random mission
wai_missions = [
"bandit_base",
"armed_vehicle",
"disabled_civchopper",
"crash_spawner",
"disabled_milchopper",
"MV22",
"weapon_cache",
"mayors_mansion",
"convoy",
"C130_crash",
"ems_cache",
"medi_camp",
"Ural"
];
 

to this:
wai_missions = ["weapon_cache"];

 

either by deleting stuff or commenting it out.  That way the only mission that spawns will be the one your testing.

 

You were not supposed to comment the line above there, I commented it out so you could compare that file to your weapons cache mission and see the differences.

Link to comment
Share on other sites

Your having a case of modifying to many things at once and not being able to troubleshoot one issue at a time.

You're right, I need to go though it one step at a time.

 

Once thats sorted it would be good to focus on the one missions. To do this you have to edit your missioncfg.sqf and change this section:

// missions used when selecting the next random mission

wai_missions = [

"bandit_base",

"armed_vehicle",

"disabled_civchopper",

"crash_spawner",

"disabled_milchopper",

"MV22",

"weapon_cache",

"mayors_mansion",

"convoy",

"C130_crash",

"ems_cache",

"medi_camp",

"Ural"

];

to this:

wai_missions = ["weapon_cache"];

either by deleting stuff or commenting it out. That way the only mission that spawns will be the one your testing.

Ok, thats what I'm doing now.

 

You were not supposed to comment the line above there, I commented it out so you could compare that file to your weapons cache mission and see the differences.

Ok, I uncommented it & now I'm getting missions.

My next step is to see if I can reproduce what you did with the weapons cache mission. I'll let you know how it goes.

Thank you.

Link to comment
Share on other sites

Now I'm not getting regular missions.

 

I checked my RPT log & found this:

 

diag_log format["WAI: Mission Weapon Cache Started At %1">
17:38:54   Error position: <WAI: Mission Weapon Cache Started At %1">
17:38:54   Error Missing ;
17:38:54 File z\addons\dayz_server\WAI\missions\missions\weapon_cache.sqf, line 11
17:38:54 Error in expression <IS_fnc_selectRandom;"

diag_log format["WAI: Mission Weapon Cache Started At %1">
17:38:54   Error position: <WAI: Mission Weapon Cache Started At %1">
17:38:54   Error Missing ;
17:38:54 File z\addons\dayz_server\WAI\missions\missions\weapon_cache.sqf, line 11
17:38:54 Error in expression <IS_fnc_selectRandom;"

diag_log format["WAI: Mission Weapon Cache Started At %1">
17:38:54   Error position: <WAI: Mission Weapon Cache Started At %1">
17:38:54   Error Missing ;
17:38:54 File z\addons\dayz_server\WAI\missions\missions\weapon_cache.sqf, line 11
17:38:54 Error in expression <IS_fnc_selectRandom;"

 

Is there something wrong with line 11?

 

What is this "Error in expression <IS_fnc_selectRandom"?

 

Weapons cache sqf:

//Weapon Cache



private ["_positionarray","_position","_box","_missiontimeout","_cleanmission","_playerPresent","_starttime","_currenttime","_cleanunits","_rndnum"]; // Add "_positionarray",


_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;  //Then this gets changed to the text he said I will just comment it out and add the change under it//

_positionarray = [[17380.426,5279.2412,0],[8467.2363,7764.6978,0],[15444.671,8667.6758,0],[8463.8125,5510.5239,0],[16104.994,15535.804,0],[7729.2627,7001.7979,0],[15078.381,15698.128,0],[5759.5493,9423.253,0],[13809.14,19294.951,0],[6098.1333,8610.5947,0],[10285.479,19396.813,0],[4265.5854,7978.0996,0],[8594.7168,19659.965,0],[2260.0608,6925.2681,0],[12143.011,14925.385,0],[4775.9395,6315.7642,0],[12676.353,12593.693,0],[14468.995,10629.646,0],[8412.1973,3045.4038,0],[10173.31,5819.1787,0],[9473.5557,2013.2627,0],[9421.4414,5169.317,0],[9845.7949,3310.0532,0],[10864.61,620.55743,0]];
_position = _positionarray call BIS_fnc_selectRandom;"

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


_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
[_box] call Medium_Gun_Box;


_rndnum = round (random 3) + 4;
[[_position select 0, _position select 1, 0],                  //position
_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.
"Bandit2_DZ",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true
] call spawn_group;

[[_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.
"Bandit2_DZ",                          //Skin "" for random or classname here.
"Random",                  //Gearset number. "Random" for random gear set.
true
] call spawn_group;

[[[(_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.8,                      //Skill level 0-1. Has no effect if using custom skills
"Bandit2_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;

[_position,"Weapon cache"] execVM "\z\addons\dayz_server\WAI\missions\compile\markers.sqf";
[nil,nil,rTitleText,"Bandits have obtained a weapon crate! Check your map for the location!", "PLAIN",10] call RE;

_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 {
    waitUntil
    {
        sleep 5;
        _playerPresent = false;
        {if((isPlayer _x) AND (_x distance _position <= 30)) then {_playerPresent = true};}forEach playableUnits;
        (_playerPresent)
    };
    diag_log format["WAI: Mission Weapon cache Ended At %1",_position];
    [nil,nil,rTitleText,"Survivors have secured the Weapon Cache!", "PLAIN",10] call RE;
} else {
    clean_running_mission = True;
    deleteVehicle _box;
    {_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;
    
    diag_log format["WAI: Mission Weapon cache timed out At %1",_position];
    [nil,nil,rTitleText,"Survivors did not secure the Weapon Cache in time!", "PLAIN",10] call RE;
};

missionrunning = false;

 

Edit:

 

BTW, last night I was getting regular missions but none were the weapons cache.

 

It looks like the weapons cache mission was selected first when I tested this morning, just looking a the RPT.

 

Could it be that because of the error in the weapons cach mission, no other mission would run then?

Link to comment
Share on other sites

Hi guys, 
i added some custom spawns and totally cannot detect anything i have done wrong. I added these groups, yet only 1 group of them spawns. Whats wrong?

Place your custom group spawns below
*/

//NAPF EVENT AREA

[[1551.85, 8931.83, 0.0016613],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1665.54, 8824.98, 0.00142288],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1703.68, 8850.66, 0.00188971],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1623.69, 8791.84, 0.00158381],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1538.74, 8786.47, 0.00115156],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1514.84, 8846.51, 0.00146961],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1471.85, 8882.26, 0.00172138],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1408.07, 8906.07, 0.0017004],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1448.11, 8957.02, 0.00119686],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
[[1489.98, 8999.9, 0.00133801],6,1,"Random",4,"","Bandit2_DZ","Random"] call spawn_group;
Link to comment
Share on other sites

Yep that was it that one " messing it up

 

Now recomment :    _position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;  //Then this gets changed to the text he said I will just comment it out and add the change under it//

 

Becuase the mission is finding two locations for the same entry and it should work 

 

Basically BIS_fnc_findSafePos is telling the system to find a safe position within the perameters of it's function [getMarkerPos "center",0,5500,10,0,2000,0]

 

BIS_fnc_selectRandom is going to randomly select one of the static points from the array.

Link to comment
Share on other sites

nice script keep up the good work..

 

please can someone explain how to activate more then one mission at the same time?

 

regards

I came here today looking for the same thing, I love WAI, and have created some custom missions for it

But I am wanting something similar to the DZMS with it's small and major missions array,

DZMSMajorArray = ["SM1","SM3","SM4","EM1"];
DZMSMinorArray = ["SM1","SM2","SM3","SM4","SM5","SM6"]; 

so that way I could have 2 missions running at the same time. I can of course achieve this by using both WAI and DZMS. but sometimes this spawns two missions on top of each other 

 

edit: so i had a brainwave after posting this. 

so what i did is created a second missions folder, and moved some of what i would consider to be the 'smaller' missions across into the second folder

renamed some of the functions to include an s to denote small, for example 

 

[] ExecVM "\z\addons\dayz_server\WAI\Smissions\missionCfg.sqf";
waitUntil {WAISmissionconfig};
diag_log "WAI: Small Mission Config File Loaded";
[] ExecVM "\z\addons\dayz_server\WAI\missions\missionCfg.sqf";
waitUntil {WAImissionconfig};
diag_log "WAI: Mission Config File Loaded";
 
i left the compiles where they were for the time being, except for the marker, i created a second file for small mission markers, different colour and smaller radius. 
now i can have 2 x WAI missions spawning together. 
ported a few of the DZMS small missions across and so far it seems to be working well enough. 
 
when i have some time over the weekend i might tidy this up a bit and see if i can improve on it further. 
Link to comment
Share on other sites

Spawning in units in custom spawns or from another script. Use the format in customSpawns.sqf

[[0,0,0],                 //position
4,                        //Number Of units
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.
"Bandit2_DZ",             //Skin "" for random or classname here.
"Random"                  //Gearset number. "Random" for random gear set.
] call spawn_group;

This will spawn a group of 4 AI at position [0,0,0] with a skill level of 1 (If custom skills if turned on in the config then it would use custom skill array 1). If you need help with setting skills to your liking then look here. "Random" chooses a random weapon array then chooses a gun out of that. If this was set to 1 then it would pick a gun out of weapon set 1. Number of magazines is self-explanatory. Backpack and skin can be the name of the backpack or skin in "quotes" or just "" for a random skin definable in the config. Gear set is customizable in the config and can be 0-4 or "Random" for a random gear set. All of this can be found in customSpawns.sqf.

[[911.21545,4532.7612,2.6292224],  //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!)
5,                                 //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.
"Bandit2_DZ",                      //Skin "" for random or classname here.
"Random",                          //Gearset number. "Random" for random gear set.
True                               //True: Heli will stay at position and fight. False: Heli will leave if not under fire.
] spawn heli_para;

Spawning a paradrop goes along the same lines as spawning a group execpt they will paradrop in when a player gets within the specified distance. Here the position the units will be paradropped at is [911.21545,4532.7612,2.6292224]. The starting position is the position that the heli will spawn at when a player enters the area and then fly to the drop. The radius from drop is the distance a player has to be in from the position for the heli to spawn in. The rest is the same as spawning in a group.

 

 

If ai_mission_system is set to true in the aiconfig then it will load mission system. The config for missions is located at "WAI \ missions \ missionCfg.sqf".

In there you can set what vehicles you want to spawn in the mission system. There is also a customizable ammo box that spawns on some missions that you can set near the bottom. The ammo box will spawn with random weapons from ammo_box_guns and random tools from ammo_box_tools.

Missions are located in the missions folder in missions. If you want to change what missions can spawn in look inside missionscfg.sqf.

 

Im trying to make the the static ai at a position spawn with certain items, is this possible?

 

I made a hemp fields mission, and i would like the ai at it to spawn with "ItemKiloHemp"

i tried making a new gearset and adding the item, not sure why but they dont spawn with the hemp

Link to comment
Share on other sites

Once thats sorted it would be good to focus on the one missions. To do this you have to edit your missioncfg.sqf  and change this section:

 

// missions used when selecting the next random mission
wai_missions = [
"bandit_base",
"armed_vehicle",
"disabled_civchopper",
"crash_spawner",
"disabled_milchopper",
"MV22",
"weapon_cache",
"mayors_mansion",
"convoy",
"C130_crash",
"ems_cache",
"medi_camp",
"Ural"
];
 

to this:

wai_missions = ["weapon_cache"];

 

either by deleting stuff or commenting it out.  That way the only mission that spawns will be the one your testing.

 

 

I did as you advised and only ran the weapons cache mission.

 

Now I have a new problem. Every weapons cache mission has a crate with 50 mags of M240 ammo & 50 mags of M249 ammo & nothing else.

 

This does not match what I see in the missioncfg.sqf file.

 

Why is the regular loadout for ammo crates not appearing?

 

The only thing I've altered is the weapons cache mission file.

 

//Weapon Cache

private ["_positionarray","_position","_box","_missiontimeout","_cleanmission","_playerPresent","_starttime","_currenttime","_cleanunits","_rndnum"]; // Add "_positionarray",

//_position = [getMarkerPos "center",0,5500,10,0,2000,0] call BIS_fnc_findSafePos;  //Then this gets changed to the text he said I will just comment it out and add the change under it//

_positionarray = [[17380.426,5279.2412,0],[8467.2363,7764.6978,0],[15444.671,8667.6758,0],[8463.8125,5510.5239,0],[16104.994,15535.804,0],[7729.2627,7001.7979,0],[15078.381,15698.128,0],[5759.5493,9423.253,0],[13809.14,19294.951,0],[6098.1333,8610.5947,0],[10285.479,19396.813,0],[4265.5854,7978.0996,0],[8594.7168,19659.965,0],[2260.0608,6925.2681,0],[12143.011,14925.385,0],[4775.9395,6315.7642,0],[12676.353,12593.693,0],[14468.995,10629.646,0],[8412.1973,3045.4038,0],[10173.31,5819.1787,0],[9473.5557,2013.2627,0],[9421.4414,5169.317,0],[9845.7949,3310.0532,0],[10864.61,620.55743,0]];

_position = _positionarray call BIS_fnc_selectRandom;

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

_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];

[_box] call Medium_Gun_Box;

_rndnum = round (random 3) + 4;

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

_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.

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

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

true

] call spawn_group;

[[_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.

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

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

true

] call spawn_group;

[[[(_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.8,                      //Skill level 0-1. Has no effect if using custom skills

"Bandit2_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;

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

[nil,nil,rTitleText,"Bandits have obtained a weapon crate! Check your map for the location!", "PLAIN",10] call RE;

_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 {

    waitUntil

    {

        sleep 5;

        _playerPresent = false;

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

        (_playerPresent)

    };

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

    [nil,nil,rTitleText,"Survivors have secured the Weapon Cache!", "PLAIN",10] call RE;

} else {

    clean_running_mission = True;

    deleteVehicle _box;

    {_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;

    

    diag_log format["WAI: Mission Weapon cache timed out At %1",_position];

    [nil,nil,rTitleText,"Survivors did not secure the Weapon Cache in time!", "PLAIN",10] call RE;

};

missionrunning = false;

 

BTW, other than the crate contents the mission runs perfectly & the locations are great.

 

Edit: Ok, I just went into regular arma to look at the BAF vehicle crate & it's stock contents are what I'm finding in weapons cache mission. I just don't know why it's not filled with the weapons & items as seen in the missioncfg.sqf file?...

 

 

Edit: LOL, another edit...

 

I just found a difference...not sure if it's the one...I'll have to test, but here it is...

 

default WAI file:

 

_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];

[_box] call spawn_ammo_box;

 

Edited file:

 

_box = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];

[_box] call Medium_Gun_Box;

 

Should be: call spawn_ammo_box;?

 

Instead of: call Medium_Gun_Box;?

 

Oh well I'll test...

 

Edit: Tested and working perfectly. Now to get the other missions set up.

 

 

I appreciate the help guys.

Link to comment
Share on other sites

Hi everyone, I have an issue, I'm trying to run this mission system on Napf and it seems not to be liking it too much, I get this in the .rpt file


22:34:37 Warning Message: Script z\addons\dayz_server\init\server_functions.sqf not found
22:34:37 Warning Message: Script z\addons\dayz_server\missions\DayZ_Epoch_24.Napf\dynamic_vehicle.sqf not found
22:34:37 Warning Message: Script z\addons\dayz_server\missions\DayZ_Epoch_24.Napf\mission.sqf not found
22:34:38 "\z\addons\dayz_code\system\REsec.sqf:Monitoring Remote Exe..."
22:34:38 "Res3tting B!S effects..."
22:34:38 Warning Message: Script z\addons\dayz_server\system\server_monitor.sqf not found


Could someone help me out to why this is happening?

PS. This only happens when I add this mission system

Link to comment
Share on other sites

Hux, glad you got it sorted.

 

HollowAddiction, did you set the gearset you added the hemp to in the spawn setup?

 

xXNoRegsXx  it sounds like somethings installed incorectly.  Those files will be called from the default epoch PBOS if there is not one present in your custom files, so if it can't find them something larger is afoot.

Link to comment
Share on other sites

Hi everyone, I have an issue, I'm trying to run this mission system on Napf and it seems not to be liking it too much, I get this in the .rpt file

22:34:37 Warning Message: Script z\addons\dayz_server\init\server_functions.sqf not found

22:34:37 Warning Message: Script z\addons\dayz_server\missions\DayZ_Epoch_24.Napf\dynamic_vehicle.sqf not found

22:34:37 Warning Message: Script z\addons\dayz_server\missions\DayZ_Epoch_24.Napf\mission.sqf not found

22:34:38 "\z\addons\dayz_code\system\REsec.sqf:Monitoring Remote Exe..."

22:34:38 "Res3tting B!S effects..."

22:34:38 Warning Message: Script z\addons\dayz_server\system\server_monitor.sqf not found

Could someone help me out to why this is happening?

PS. This only happens when I add this mission system

 

Whatever you used to package your pbo probably corrupted the files. The PBOPREFIX is likely missing.

Link to comment
Share on other sites

I use the PBO manager to package them but im guessing I shouldn't :/

 

Edit: I have the $PREFIX$ and the authentication wont start and still getting the same error messages

Edit 2: I have also now included the PBOPREFIX and still not working :/

Edit 3: Got it working now... apparently it hates the binPBO more than PBO manager... sorry for any inconvenience I caused

Link to comment
Share on other sites

Does anyone have desync because of wai missions?.. I have from time to time some kind of desync on 10-20 seconds. Not all the players but half. of them. When i look at rpt. look at specific time i see that previous mission is deleted from database( dead soldiers) Is this problem or something else? 

Link to comment
Share on other sites

I have 2 WAI's 99% working.

I created a new folder, but found I had to change a lot of the variables (I just added a 2 at the end).

One thing I am struggling to fix is the markers.

For some reason I am only getting one marker showing at a time, even though both missions are in the game world.

When one clears, the other one shows up.

 

Do your markers show at the same time?

 

 

I came here today looking for the same thing, I love WAI, and have created some custom missions for it

But I am wanting something similar to the DZMS with it's small and major missions array,

DZMSMajorArray = ["SM1","SM3","SM4","EM1"];
DZMSMinorArray = ["SM1","SM2","SM3","SM4","SM5","SM6"]; 

so that way I could have 2 missions running at the same time. I can of course achieve this by using both WAI and DZMS. but sometimes this spawns two missions on top of each other 

 

edit: so i had a brainwave after posting this. 

so what i did is created a second missions folder, and moved some of what i would consider to be the 'smaller' missions across into the second folder

renamed some of the functions to include an s to denote small, for example 

 

[] ExecVM "\z\addons\dayz_server\WAI\Smissions\missionCfg.sqf";
waitUntil {WAISmissionconfig};
diag_log "WAI: Small Mission Config File Loaded";
[] ExecVM "\z\addons\dayz_server\WAI\missions\missionCfg.sqf";
waitUntil {WAImissionconfig};
diag_log "WAI: Mission Config File Loaded";
 
i left the compiles where they were for the time being, except for the marker, i created a second file for small mission markers, different colour and smaller radius. 
now i can have 2 x WAI missions spawning together. 
ported a few of the DZMS small missions across and so far it seems to be working well enough. 
 
when i have some time over the weekend i might tidy this up a bit and see if i can improve on it further. 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×
×
  • Create New...