AI goes through walls

Yuvalino

New Member
I've build an NPC base, added a few AIs from DZAI's custom markers and spawns and they seem to go through walls.

I used the mission.sqm method. Is there any way to make them see these walls?

I've seen something like that:
Code:
_this = createVehicle(blahblahblah)

-this = publicVariable("DZAI",1,true);

or something like that in mission systems where it creates objects.

If I use this method (for the 120 objects I have) on a different .SQF file and start it up through init.sqf will it work?
 
You need you custom buildings server side, putting them in the mission.pbo means the Ai can't see them, so they walk right through.
 
Walking through buildings is something that I can't fix using scripting. If you can't fix it by spawning the buildings by sqf instead then unfortunately there is nothing I can do. This also goes for Epoch player-built objects - I can't do anything about it.



Sent from my Nexus 5 using Tapatalk
 
You need you custom buildings server side, putting them in the mission.pbo means the Ai can't see them, so they walk right through.
So I have many custom buildings that live in my server pbo, but i call them in the mission init.sqf. AI still walk through those buildings. Does it matter where you call the server side buildings from? I call mine from mission init. If this is wrong where and how should I be calling the server side buildings?

btw, thanks Buttface for the ai bandits, been using them for some time on our servers!
 
As long as DZAI is called from the dayz_server.pbo or inside an if (isServer) conditional check in the init.sqf, it is running server-side. You will know you're accidentally running it clientside if you suddenly experience BattlEye kicks. This shouldn't happen either way since dzai_initserver.sqf checks if it's being run on the server before loading DZAI.

To clear up a common misconception, running scripts in the mission init.sqf does not necessarily mean you're running it clientside. If you have a script being called like this in your init.sqf then it's serverside:

Code:
if (isServer) then {
   [] execVM 'myscript.sqf';
};

"isServer" will return 'false' on clients so myscript.sqf will never be run, and will return 'true' on the server so it will be run once on the server during startup.

On the other hand, a script called in init.sqf is considered client side if you flip the isServer check around:

Code:
if (!isServer) then {
   [] execVM 'myscript.sqf';
};

If you don't put an isServer (or isDedicated...) check at all, it's both server and client-side, meaning it is run on both sides.

To be perfectly honest I don't fully understand what is causing AI to walk through buildings. I haven't experienced this myself and I use about 20 or so custom-spawned buildings on my test server. The DZAI server-side object patch works on a similar principle and I've found it working as intended.

A bit of trivia: the DayZ server startup scripts inside dayz_server.pbo are called from inside the mission init.sqf.
 
I guess I should clarify. The ai coming through buildings is not the norm and I actually have had ai, come in buildings through open doors and up stairs to find me, but on occasion I have also seen them walk through walls. To be fair, our server for some reason has had a bit of lag lately and I suspect that has something to do with the recent wall walking ai.
 
When the server is experiencing lag, it sometimes takes "shortcuts" with AI pathfinding and ignores walls/objects. That may explain why I've never experienced this on my test server as the only player while others and yourself have experienced this on servers with other players.
 
I know this is about 8 months late to the conversation but I've tested this issue a ton this year in an effort to make building in towns more viable for my own server. And as far as I can tell, the roads are the culprits, or rather the edge of the roads. I can build bases away from roads and never have an issue with them getting inside. However building near roads, or over them if the server has that setting enabled, will ALWAYS provide a path for the AI to get inside. I've also tried building right on the edge of the roads with that setting disabled. And because the front edge of the object still overlaps that invisible edge around the roads (if placed right up against the allowable placement next to roads), the AI will see right through it if its not placed further back where the object doesn't touch that edge. This leads me to believe there is a border around the roads that is used for helping mounted AI stay on the roads better, or something similar. Unfortunately it seems to make it impossible to seal off a base from AI if your base is on or near a road.

Test it yourself. Seal off any base you can LOS hide from the AI in and build one of the walls over a road. Restart the server. Shoot over the wall and agro some AI or throw smoke on the road just inside your wall, then hide inside somewhere you can keep LOS broken from the road but still see it. They will walk up along the edge of the road and through any object you've placed there each and every time.
 
I do it like this

i call
[] execVM "z\addons\dayz_server\custom\base.sqf";
placed at the bottom of the server.pbo\init\server_fucntions.sqf

and this as file 'base.sqf'

if (isServer) then
{

_vehicle_0 = objNull;
if (true) then
{
_this = createVehicle ["Base_CustomBunker", [11469.843, 11288.723, 0.40990946], [], 0, "CAN_COLLIDE"];
_vehicle_0 = _this;
_this setDir 38.246544;
_this setPos [11469.843, 11288.723, 0.40990946];
};
// more Fence_corrugated_plate

};

So a bunker fenchedof by Fence_corrugated_plate , never saw any AI or zombie get in (only if the door was open but ok )
 
Does this work over roads? Because I've tried building every way I can think of and if any part of the base extends to even the edge of a road, that point will be where the AI walks straight through wall, vehicle or anything that I can stack in front of it. If I build away from a road I can agro an army of AI and they will run all around the outside of the base but will never get inside.
 
That base spot is on the mountain klen (above khelm) , and sealed with a Concrete_Wall&panel from BB13
The Concrete_Walls are on the dirtroad
The AI & zombie just run around it , kill 1 they wont glitch thru
We only foundout that on restart u spawn there and go off todo something
Then on arrival back occasionally the AI (not all) spawned in the base
But its nice to have a welcome party
 
I've noticed that one as well, where they spawn inside the base as you're coming back. My favorite base location was the industrial buildings in the NE corner of Zelenogorsk, the area that also has a gas tank, a well and is almost completely surrounded by wall. It's pretty easy to keep them from spawning somewhere by moving the size and position of the spawn/patrol marker for that location. For the Zelenogorsk I moved the marker SW, away from the barn, and set its size to 100. With the default settings however, the AI are set to spawn around buildings within the marker. And if the marker edge comes anywhere near one of those barns with the gas tank on the side, an AI with grenades seems to spawn right in the middle of the building under the floor. It doesn't end well if you've stored vehicles full of stuff inside the barn. You can also turn off the option to have them spawn around buildings, but then you have to set all the spawn points manually.

I'm going to have to experiment with that location. If you have safe zones enabled then I suspect they may be avoiding that location because of the traders. And I'm assuming that if you're talking about AI in that location then its also dynamic spawn AI and that you don't have a custom static spawn marker set up there. I don't really deal with the dynamic spawn AI so haven't looked for behavior differences between the two. The static spawn AI has always walked through walls over roads.
 
All statics only spawn in cities/towns/airfields and rest is dynamic
But we only play now on regular dayz-182 , no choppers/planes some may find it dull
Yet most of us enjoy it , and zombies spawn range set to 800
So they wont realy give your position away , so most end up fighting eachother or the AI
 
Just checking. You can easily add static spawn markers to any location by adding it to \dayz_server\DZAI\init\world_spawn_configs\spawn_areas\areas_chernarus.sqf

To each their own. One of the things that makes DayZ/Epoch/etc awesome is that we have the freedom to play the way we want, or are at least as much as we are able to set up. For fun I even set up my own heavily modded private hive, private Overpoch server that takes place long after the zombies have all but been eradicated. It has a ton of new buildings, almost no zombies and the map is full of AI. I also removed the loot spawn restrictions so it will always spawn, even if you're right next to the building or in a vehicle. It's the best DayZ single player experience I could come up with and its incredible fun. No cheaters, either.

I don't use dynamic spawning most of the time, because I do use choppers and planes and its hard to keep those in the air when AI keep spawning around you before you take off. But if it keeps them out of bases built on roads then I might have to reconfigure. So far no luck.
 
Back
Top