Simple AI Tutorial (no rMod or DayZ_Factions)

I'll be home in about3hours and will answer your questions. reading from my phone at work currently. I already know how to add them to the debug monitor and I will download fraps or something and do a simple video tutorial soon. I will upload a fully modified pbo too .
 
thanks a lot for the update, my locals on the sever had a big shock when they had AI shooting at them :) keeps them on there toes...
 
I was also wondering if it would be possible to spawn in zombie hordes to follow way-points, any ideas to point me in the right direction cheers thebes
 
thebes: I'm not sure about summoning a zombie horde. Their waypoints are determined using server code, so you would have to write a bunch of stuff, and I'm not sure you can use zombie skins in dayz. It could definitely be done, but i'm just not sure how.

If anyone wants me to make them a standard PBO, just tell me which map you're using, and provide me a default mission pbo, and I will fix them up to use this code.

I think i'm going to work on making zombies attack npc's next, but I won't be working on it during the weekends, because like I said earlier, I don't want the people on my server to be inconvenienced during this high traffic time.

As for the tracking of NPC kills in your debug monitor. Would you want them to be added to the zombie kill count? or would you want it on its own counter? It's easy to add them to the zombie counter, but I don't currently know how to add a variable to the player array and force the debug monitor to use it. This would also involve the use of a custom debug monitor, which I know how to do, but it would be adding more customization to your PBO. If it's a matter of just adding the kills to your zombie counter, I can give you some code to do that very quickly.
 
In regards to AI kills on my monitor I'd perfer their own counter but Id take what I can get for now,

also in add_unit_server.sqf (the new downloadable)
i see=== respawnTime = _this select 9;
is it suppose to be _respawnTime = _this select 9;

cuz i broke sumfin. I had everything working without respawns but cannot make this work with respawns and I'd like to get em in, I'll try to change it and see if that helps
 
OH YEAH!!!
put a "_" onto respawnTime = _this select 9; in add_unit_server.sqf
worked for me , all's Good :)

EDIT: I take that back... now when I kill an AI , I get BE #53 and kicked.
EDIT: TY Sycosis ,fixed my issue in his next post:D
 
Thank you sycosis! That would be amazing! I will then look over the differences to see where i went wrong. Hopefully learn a thing or two!
 
OH YEAH!!!
put a "_" onto respawnTime = _this select 9; in add_unit_server.sqf
worked for me , all's Good :)

EDIT: I take that back... now when I kill an AI , I get BE #53 and kicked.

maybe cuz I killed an AI or... kill messages? I'll post if I find a fix.
To fix BE #53, open your scripts.txt and find addMPEventHandler and change the leading 5 to a 1.

I have to leave mine without the _ to get it to work, but for whatever reason you may need yours to have the _
 
In regards to AI kills on my monitor I'd perfer their own counter but Id take what I can get for now,

also in add_unit_server.sqf (the new downloadable)
i see=== respawnTime = _this select 9;
is it suppose to be _respawnTime = _this select 9;

cuz i broke sumfin. I had everything working without respawns but cannot make this work with respawns and I'd like to get em in, I'll try to change it and see if that helps
For now, add this to the unit_killed.sqf above the sleep timer. This will increase your zombie counter by 1, and increase your humanity by 100 for each NPC killed. I remember getting a wierd glitch where I would get 2 kills for each npc I killed, but I can't remember why it was in the end. This should work though.

Code:
_zombieKills = _killer getVariable["zombieKills",0];
_killer setVariable["zombieKills",_zombieKills+1,true];
_humanity = _killer getVariable["humanity",0];
_killer setVariable["humanity",_humanity+100,true];
 
Is there something I'm missing? in my untouched dayz_mission.pbo file there is a mission.sqm, should I add that also to the group? Doing this still gives me my blank screen.
-Afterthought; Is it called out for each ai spawn in the init or other file? I removed the ones that can roam all over chernaraus, and instead decided to make an army to hold down the airfield.
 
I originally had this working. I was having problems getting the worldspace to work correctly, however I figured it out. Once I tried to use the updated files it no long works. I reverted to my previous pbo and followed the guide and it still does not work. Would someone mind taking peek at my pbo to show me where I am going wrong. I am trying to spawn the ai by the firestation/factory in electro.
 

Attachments

  • dayz_mission.pbo
    110.4 KB · Views: 6
Is there something I'm missing? in my untouched dayz_mission.pbo file there is a mission.sqm, should I add that also to the group? Doing this still gives me my blank screen.
-Afterthought; Is it called out for each ai spawn in the init or other file? I removed the ones that can roam all over chernaraus, and instead decided to make an army to hold down the airfield.
All the files that are part of your original mission pbo should remain untouched except init.sqf
 
Back
Top