Jump to content
  • 0

How to add static AI to a custom base using map editor


Cyrus

Question

13 answers to this question

Recommended Posts

  • 0

DZAI is the easiest way to set that up. 

Set the marker areas and then add the number of ai patrols. 

I had several ai bases in which a number or ai would spawn and patrol. The patrol areas are written as 

_this = createMarker ["Threevalley", [12885.6,5609.57,0.00143433]];

_this setMarkerShape "ELLIPSE";

_this setMarkerType "Empty";

_this setMarkerBrush "Solid";

_this setMarkerSize [20, 20];

_this setMarkerAlpha 0;

_Threevalley = _this;

 

Then the spawning of the actual ai is 

[

"Threevalley", //This is the marker name to be used as the patrol and spawning area.

4, //This trigger will spawn a group of 2 AI units.

2, //Weapon grade setting. 1 = weapon chosen from Military loot table (see below for explanation of Weapon Grade)

true //(OPTIONAL)* Respawn setting. True: AI spawned will respawn (Default). False: AI will not respawn. Spawn area will be deleted when all units have been killed.

] call DZAI_spawn_units;

 

you can set them to respawn after a certain time after being killed or not..

Link to comment
Share on other sites

  • 0

Thanks for the info. I will definately try this. 2 Questions. Where can i find DZAI for epoch 1.0.6.2 and marker settings are supplied during the base creation in Arma 2 OA Map editor?

 

EDIT: Scratch my last 2 questions. Based on the info you have given, i have managed to figure out where to put these code snippets. I will be testing in a couple of minutes and return with feedback.

 

EDIT 2: When i startup the server i get this from my RPT file:

if ("readoverr>
11:54:06   Error count: Type Object, expected Array,Config entry
11:54:06   File z\addons\dayz_server\DZAI\init\dzai_initserver.sqf, line 17

This is from the file :

_directoryAsArray = toArray __FILE__;
_directoryAsArray resize ((count _directoryAsArray) - 25);
DZAI_directory = toString _directoryAsArray;
if (isNil "_this") then {_this = []};
if ((count _this) > 0) then {
    //diag_log "DEBUG :: Startup parameters found!";
    if ("readoverridefile" in _this) then {DZAI_overrideEnabled = true} else {DZAI_overrideEnabled = nil};
    if ("enabledebugmarkers" in _this) then {DZAI_debugMarkersEnabled = true} else {DZAI_debugMarkersEnabled = nil};
} else {
    //diag_log "DEBUG :: Startup parameters not found!";
    DZAI_overrideEnabled = nil;
    DZAI_debugMarkersEnabled = nil;

Any reason why this would happen?

Link to comment
Share on other sites

  • 0

I doubt there is a 1062 version. It worked fine on 1061 though, so just try it and see. 

I have no experience of the editor at all, so can’t answer that really, all my custom bases were made by a friend. All I can say is you must add the markers to dzai, they are invisible to players but are what contain the ai in a certain zone. I simply just inputted the cords of the centre of the base after teleporting there in game and getting them. Then simply add a radius size to make sure it’s all covered. 

Link to comment
Share on other sites

  • 0

I think DZAI might not be ready for 1.0.6.2. I have changed 

if ((count _this) > 0) then {     to this       if ((count _this[]) >0) then {

which gets the server running but static ai dont spawn. Ill have a look at WAI for custom static spawns in the meantime

Link to comment
Share on other sites

  • 0

Just loaded it on my server and it all works fine. Server starts, ai load as they should. Not sure why you are having an issue. Maybe youve missed something when setting up the spawns and markers. Can you post your custom_markers and Custom_spawns files

Link to comment
Share on other sites

  • 0

here are my custom spawns:

[
"_dzaiNWAF_MC",	//This is the marker name to be used as the patrol and spawning area.
6, 						//This trigger will spawn a group of 2 AI units.
2,						//Weapon grade setting. 1 = weapon chosen from Military loot table)
true					//(OPTIONAL)* Respawn setting. True: AI spawned will respawn (Default). False: AI will not respawn. Spawn area will be deleted when all units have been killed.
] call DZAI_spawn_units;

and here is my custom marker:

_this = createMarker ["NWAF_MILLITARY_COMPLEX", [4438.0039, 10632.189, 0]];
_this setMarkerText "NWAF MILLITARY COMPLEX";
_this setMarkerShape "ELLIPSE";
_this setMarkerType "Empty";
_this setMarkerColor "ColorBlack";
_this setMarkerBrush "Solid";
_this setMarkerSize [80, 80];
_this setMarkerAlpha 0;
_dzaiNWAF_MC = _this;

 

Link to comment
Share on other sites

  • 0

The marker and spawns are wrong, should follow this format

 

Spawns

Spoiler

[
    "NWAFMC",    //This is the marker name to be used as the patrol and spawning area.
    7,             //This trigger will spawn a group of 2 AI units.
    1,            //Weapon grade setting. 1 = weapon chosen from Military loot table (see below for explanation of Weapon Grade)
    true        //(OPTIONAL)* Respawn setting. True: AI spawned will respawn (Default). False: AI will not respawn. Spawn area will be deleted when all units have been killed.
] call DZAI_spawn_units;

 

Spoiler

_this = createMarker ["NWAFMC", [4438.0039, 10632.189, 0]];
_this setMarkerShape "ELLIPSE";
_this setMarkerType "Empty";
_this setMarkerBrush "Solid";
_this setMarkerSize [200, 200];
_this setMarkerAlpha 0;
_NWAFMC = _this;

The marker name in the spawn much match the _this=createMarker and the bottom _NWAFMC

This isnt like markers for labelling stuff like youd have in the mission.sqm. Its simply an invisible area on the map for the ai to patrol.

Link to comment
Share on other sites

  • 0

Damn, now i feel really stupid...lol..

To recap, this is what i have it as now:

makers:

_this = createMarker ["NWAF_MILLITARY_COMPLEX", [4430.0229, 10610.783, 0]];
_this setMarkerText "NWAF MILLITARY COMPLEX";
_this setMarkerShape "ELLIPSE";
_this setMarkerType "Empty";
_this setMarkerColor "ColorBlack";
_this setMarkerBrush "Solid";
_this setMarkerSize [80, 80];
_this setMarkerAlpha 0;
_NWAFMC = _this;

and spawns

"_NWAFMC",	//This is the marker name to be used as the patrol and spawning area.
6, 						//This trigger will spawn a group of 2 AI units.
2,						//Weapon grade setting. 1 = weapon chosen from Military loot table)
true					//(OPTIONAL)* Respawn setting. True: AI spawned will respawn (Default). False: AI will not respawn. Spawn area will be deleted when all units have been killed.
] call DZAI_spawn_units;

is this correct?

Link to comment
Share on other sites

  • 0

No.

I posted the correct format

 

In spawns, remove the _ from _NWAFMC

in markers, remove the

_this setMarkerText "NWAF MILLITARY COMPLEX";

and change

_this = createMarker ["NWAF_MILLITARY_COMPLEX", [4430.0229, 10610.783, 0]];

 

to

_this = createMarker ["NWAFMC", [4430.0229, 10610.783, 0]];
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Discord

×
×
  • Create New...