Jump to content
  • 0
Sign in to follow this  
Cyrus

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

Question

Does anyone have info or tutorials on how to add static AI to a custom base? Something like patrolling AI and respawn on server restart?

Im currently on Arma 2 Dayz Epoch 1.0.6.2 Chernarus map.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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?

Share this post


Link to post
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. 

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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;

 

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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]];

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

Loading...
Sign in to follow this  

  • Similar Content

    • By Harkness
      Please consider joining our customised Epoch | DayZ | Expansion | Namalsk servers, we have 2 long term Admins on both UK/US continents and run our servers completely for charity and from 100% clean and renewable energy too!
      https://discord.gg/eyMymYv
      DayZSA Expansion Namalsk     |     DayZSA Expansion Takistan     |     A2 DayZ Epoch Namalsk (Stalker)
      86.10.6.13:2402                      |     86.10.6.13:2602                         |     86.10.6.13:2302
      CPU: Xeon-X5690 @ 3.46GHz
      RAM: 16GB
      Storage: SSD
      Stalker Exclusion Zone Time2Kill Epoch Namalsk (1.0.7/144629)
      Contents: 
      Epoch Content:
      - Single Currency Traders & Global Banking tied to your Player ID and NOT your character. (keeps rubles after death)
      - 200 new zombie models, over 100 new weapons and magazines with attachment support
      - New Vehicles and trucks, skins, backpacks, items, planes, helis even a submarine
      - New weapon sounds, Backpack Upgrades, Vehicle Upgrades, Tons of new clothing
      - Over 30 new base building items like a drawbridge, metal and wood gates, glass floors and many more
      - Epoch AntiHack, Trader SafeZones, Refundable Base Deconstruction!
      - Two Primaries, No Stamina Limit, One Step Building, No Plot, Self Bloodbag, Kill Feed, Group System(press F5)
      Namalsk Content:
      - Customized Harsh Weather System - Dynamic Snow/Blizzards and Storms! Warm Clothing at hero/bandit zones
      - Namalsk EVR Blowouts Events
      - Blood Sucker Monsters! (Note: Killing Strelok will destroy his "PSY" abilities and no more Bloodsuckers will spawn until mission restart)
      - APSI Masks and Mutant Heart Crystal Artefacts!
      Stalker Content:
      - STALKER Factions: Monolith = Bandit Duty = Hero
      - Stalker Faction Skins at Traders Hero/Bandit
      - Strelok - Bloodsucker PSY Leader | Search the exclusion zone for tips
      - Mutant Heart Artefact Crystal
      - Radioactive Exclusion Zone! (Must have Stalker Hazmat suit to survive here) AI faction Monolith patrols this island heavily
      Custom Content:
      - Navy Zone
      - Military Airfield Zone
      - LandBridge Zone
      - Intro Radio Broadcast Story and secret radio broadcasts in the exclusion zone
      - Roaming AI groups. 1 AI Helicopter Patrol and several Land/Sea Patrols, AI bandits, AI Heros
      - AI Mission system, AI Cash Wallets, AI Humanity/Cash Rewards System
      - Custom Player Skins
      - Vorkuta Hospital
      - ADDED: over 150 Base Building Kits to traders
      - Money on Zombies/AI  10-100 // Min/Max
      - Taking Clothes from the dead Added
      - Vehicle Towing added
      - Vehicle Service Stations Added. (Service for coins)
      - Spawn selection added - Choice Land/Air Spawn(c130 drop), Loadout Spawn Hero/Bandit lvl 1-3
      - Custom Server loadingScreen Added - Stalker of course
      - Craft Bicycle | Craft Mozzi (Press TAB)
      - Set Custom View Distances (TAB)
       
      Server is password protected and will remain so due to the low price of CD keys for this game.
      To access the server please join the discord "Server Announcements Channel" will have all the info you need to connect.
      Your admins for this server are "DarkIQ" and "Harkness"
    • By Harkness
      Please consider joining our custom Epoch | DayZ | Expansion | Namalsk or Takistan servers, we have 2 long term Admins on both UK/US continents and run our servers completely for charity and from 100% clean and renewable energy too!
      Click here to join our Discord for more information
      DayZSA Expansion Namalsk     |     DayZSA Expansion Takistan     |     A2 DayZ Epoch Namalsk
      86.10.6.13:2402            |     86.10.6.13:2602             |          86.10.6.13:2302
      Custom Content:

      - Armed Roaming / Dynamic AI Bandit Patrols
      - Custom Land and Air Trader Camps
      - Banking and Wallets
      - Customization Land Rovers
      - Advanced Weaponry
      - No Vehicle Crash Damage & Fix Vehicle Positions
      - More weapons packs, loot+, vehicles+, custom clothing & backpacks
      - Bounty Hunting
      - Unlimited Stamina
      - PvP & Raiding
      - Modular Vests
      - Igloo Crafting
      Thanks we hope to see you there!
      CPU: Xeon-X5690 @ 3.46GHz
      RAM: 16GB
      Storage: SSD
      Additional Features:
      ATM Banking | More Weapons | More Cars | More Loot | Namalsk Igloo | Light Saber Mod | No-Vehicle-Crash-Damage | Trader Wallet - Money/Item Storage | Custom Namalsk Spawn Selection | Custom Trader Cities | All items added to traders |Namalsk Airdrops | | Notification System | Territories System | Auto-run System | No Stamina System | Safezone System | Mission System | Skin System | Map UI and 2D/3D Markers System | KillFeed System | Towing System | Player Attachment | Custom lighting | Custom interiors | Custom ocean | Working Street lights | Builderitems | Gravecross | KillFeed | Notifications | Gravecross | Horn | Autorun | No stamina | MoreGuns | Street lights | Car Keys | CodeLock | Map UI and 2D/3D Markers | Global/Transport/Party Chat | Book (Server Info, Rules, player stats | party management | territory management) System
    • By FG_Trap
      Made a quick static ai mission that spawns on restart. 
      12 ai patrol the compound 
      4 Static m2's
      1 Heli Patrolling the compound 
      Crate for who ever clears all the ai.
      Some screenshots of the compound 


       
      https://github.com/Trapxxgods/Wai-Static-Mission 
    • By freakneek
      G'day, Guys and Girls,
      you might want grab another Rabbitman Beer or R4Z0R soda (if your not allowed beer). This is gonna be a long one!
      This tutorial goes into some length and is for the most part, copy/paste, from @Poncho's How to make Custom map content [ Tutorial & Ongoing Support ] tutorial. I had a major issue today trying to figure out why my map edit wasn't working. but after many thanks to the awesome @JasonTM, for identifying the issue, It has been found that you need to use a compiles line instead of a execVM line in the code.
      ***NOTE***
      This tutorial is not my work.... BUT, I felt that this could use an update.
      ***for those of you who already know how to do this scroll down to the server_functions.sqf part!***

      Most people create these map additions, simply by launching dayz through an epoch server via dayz commander will give you a working editor, but some buildings (such as Barracks, Hospitals, and Fire Stations) will not spawn any loot.
      This is because of their class names. The default ARMA editor makes most building classnames begin with "Map_" . All buildings of this type will not spawn loot in dayz, this is inherited from the EU_ update to the editor. You may simply read through your code and change all these manually to (for example) "Land_A_Hospital" instead of the original "Map_A_Hospital" to trigger loot spawns within those buildings.
      There is however an easier way for those of you unfamiliar with code, which also adds a few extra items in. This will however remove some options brought by the EU_ update such as being able to place rocks/cliffs e.t.c so it is important to pick when you want to use the editor I am about to show you.
      It is called the Jon-C5- Editor Update by (surprisingly enough) Jon-C5-. It is available  here http://www.armaholic.com/page.php?id=5932
       
      To turn your map edits into functioning dayz map additions simply follow the instructions below (If you do not wish to use the Jon-C5-Editor, skip to step 4):
      1) Download the zip file linked above.
       
      2) Drag/copy&paste it into your Arma2 Operation Arrowhead folder (where your @dayz and @dayzepoch folder are stored)
       
      3) Launch dayz with the following launch options (set via steam or dayz commander):
      -mo[email protected]_EditorUpdate  
      4) Once you are in the main menus press ALT+E
       
      5) This will open up the editor click the Chernarus map then click ok.
       
      6) A map view will then pop up, on the right hand side you will see a list of categories:
                  - First click 'Centre' then right click on the map, select 'new',  and press ok,
                  - Next click 'Group' then right click on the map, slect 'new'. and press ok,
                  - Now click 'Unit' then right click on the map, select the unit you want - default may be 'Alsatian' the change from 'non playable' to 'playable'.
       
      7) You are now ready to start editing. To begin, enter the '3D View' and click on 'Vehicle' (this is where all the buildings are listed). Right click on the map and select 'new', The list will then appear.
       
      8) Once you have selected an item, the ALT key will allow you to raise or lower items, with the SHIFT key allowing you to spin it around.
       
      9) Once you are happy with the edit, save it (Name it something relative to the edit). Then check your edits, sometimes large items may shift from where you placed them.
       
      10) Locate the mission.sqf file, usually in My Documents > Arma 2 > Missions > "Your mission name"
       
      11) Open up the mission.sqf file, you must now make some small edits to allow it to add these items to your server. Example Below:
      Default mission.sqf code example, areas to edit show indicated.
      ----------------------------------------------------------Remove start Here activateAddons [ ]; Replace with: if (isServer) then { activateAddons []; initAmbientLife; ----------------------------------------------------------Remove End Here _vehicle_4 = objNull; if (true) then { _this = createVehicle ["Land_ruin_corner_2", [14110.31, 2782.1448, 3.8146973e-006], [], 0, "CAN_COLLIDE"]; _vehicle_4 = _this; _this setPos [14110.31, 2782.1448, 3.8146973e-006]; }; ------------------------------------------------------------------------------------------ Remove Start Here _this = createCenter west; _center_0 = _this; _group_0 = createGroup _center_0; _unit_2 = objNull; if (true) then { _this = _group_0 createUnit ["GER_Soldier_EP1", [14116.508, 2764.6309, 4.0054321e-005], [], 0, "CAN_COLLIDE"]; _unit_2 = _this; _this setUnitAbility 0.60000002; if (true) then {_group_0 selectLeader _this;}; if (true) then {selectPlayer _this;}; if (true) then {setPlayable _this;}; }; ----------------------------------------------------------------------------------------- Remove End Here _vehicle_192 = objNull; if (true) then { _this = createVehicle ["Land_a_stationhouse", [5160.0171, 2183.0002, 0.14117265], [], 0, "CAN_COLLIDE"]; _vehicle_192 = _this; _this setDir 211.89264; _this setPos [5160.0171, 2183.0002, 0.14117265]; }; ----------------------------------------------------------------------------------------Remove Start Here processInitCommands; runInitScript; Replace with: }; By Mr. Smith e.t.c finishMissionInit; ----------------------------------------------------------------------------------------Remove End Here Edited mission.sqf code example:
      if (isServer) then { _vehicle_4 = objNull; if (true) then { _this = createVehicle ["Land_ruin_corner_2", [14110.31, 2782.1448, 3.8146973e-006], [], 0, "CAN_COLLIDE"]; _vehicle_4 = _this; _this setPos [14110.31, 2782.1448, 3.8146973e-006]; }; _vehicle_192 = objNull; if (true) then { _this = createVehicle ["Land_a_stationhouse", [5160.0171, 2183.0002, 0.14117265], [], 0, "CAN_COLLIDE"]; _vehicle_192 = _this; _this setDir 211.89264; _this setPos [5160.0171, 2183.0002, 0.14117265]; }; }; // By Mr. Smith e.t.c **If the code editing is not done as follows, it will crash your server on start up. Mainly because of the unit spawn (in this example "GER_Soldier_EP1"), follow the instructions for editing the code and it will work fine**
       
      The Custom Content is now ready for publishing! Here is a quick, safe and guaranteed way to get your [working] edits into your server:
       
      1. Unpack your server.pbo
       
      2. Create a folder in the root of the server.pbo called: Maps     3. Drag your mapedit.sqf into this folder.     ***UPDATED PART FOR 1.0.6.2*** 4. In the init folder you will find a file called server_functions.sqf . Find these lines: // Precise base building 1.0.5 call compile preprocessFileLineNumbers Just above it add this line:
      call compile preprocessFileLineNumbers "\z\addons\dayz_server\maps\mapedit.sqf"; so now it looks like this....
      call compile preprocessFileLineNumbers "\z\addons\dayz_server\maps\mapedit.sqf"; // Precise base building 1.0.5 call compile preprocessFileLineNumbers  NOTE**:  Be sure to change the mapedit.sqf to whatever it is you have named your file, and that it corresponds with the execVM in your server_functions.sqf
      ***END UPDATED PART FOR 1.0.6.2)***
       
      EXTRA HINTS AND TIPS:
      Having trouble moving roads and other similar items to where you want them?
       
      Want your buildings spawn straight and level like they do with the new epoch build system?
      _this setDir -415.88132; _this setVehicleInit "this setVectorUp [0,0,1];"; _this setPos [1939.5042, 14563.26, -0.068630017]; Beidi file should look as follows:
      Add the "INIT" line between the "AZIMUT" and "PARENT" lines.
      AZIMUT="-67.231117"; INIT="_this setVehicleInit "this setVectorUp [0,0,1];";"; PARENT=""; - Big thanks to @Wesley for that one!
       
      Want to edit the trader camps / locations (Chernarus Only)?
       
       
      Having trouble with buildings 'double-spawning'? (often creating duplicate doors in a building)
       
       
      Here is a little example of how to remove grass from in/around your buildings:
       
      OK i think that is pretty much it.....
      HAPPY MAP EDITING!!
      -Freak
    • By victorks
      my first work in editin :) https://uploaddeimagens.com.br/imagens/20180307202515_1-jpg https://uploaddeimagens.com.br/imagens/20180307202245_1-jpg DOWNLOAD: https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0 AI M2 NEED WAI: https://pastebin.com/GJMnPvZP ON THE MAP: https://pastebin.com/cyqH9rNV  
       
      https://www.dropbox.com/s/oq97j7x59362kqe/CASTLEai.sqf?dl=0
       
       
       
       
       
       
       
       
       
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...