dayZ NPC (AI) Units / Troops | Add to Server.

Anyone get this up and running on a dayz.st server? I would love to see a pbo from him/her for a comparison, if possible :)

Also, any luck with actually making them respawn in a given timeframe (like in every hour, every 2 hours, etc)?
Not on a schedule but have an eventhandler working that runs code from an ai unit getting killed, am trying to pass an object through to the code so I can order the group to attack whoever killed the unit. Also will spawn a new unit from a nearby building to replace the dearly departed..
 
Just tried to make a group of "insane" survivors by giving the AI: Soldier_Crew_PMC skin(normal survivors), and MeleeHatchet (hatchet that goes to primary weapon). It all spawned in correctly and they had the hatchets equipped but sadly they did not know what to do with them and were just standing around.
 
If anyone knows how to get the "setDamage false" working, or has another solution. I'd be very grateful! Would like to give my base patrol all AS50's and NVGs. But don't want my players killing them for the loot ;)
 
If anyone knows how to get the "setDamage false" working, or has another solution. I'd be very grateful! Would like to give my base patrol all AS50's and NVGs. But don't want my players killing them for the loot ;)
With the eventHandlers I am looking at making the troops near on invincible by sending in reinforcements, unless against a seriously organised assault, in which case some spoils would be deserved . Thinking of getting troops to hide bodies, not sure if this is an Arma thing or dayZ only. This would reduce the loot during a firefight. Am setting up random spawns of opposing sides fighting over some resource around the map.. once I get the eventHandlers working how I want.
 
With the eventHandlers I am looking at making the troops near on invincible by sending in reinforcements, unless against a seriously organised assault, in which case some spoils would be deserved . Thinking of getting troops to hide bodies, not sure if this is an Arma thing or dayZ only. This would reduce the loot during a firefight. Am setting up random spawns of opposing sides fighting over some resource around the map.. once I get the eventHandlers working how I want.

A lot of the Arma II Domination maps have eventHandlers setup to send in reinforcements.
 
Just a guess but I would think the hatchet is not classed as a weapon ? Possibly need to encourage them to 'chop wood' from the nearest player..
There are two different classnames for hatchet: ItemHatchet and MeleeHatchet. The hatchet is hacked in for dayz so im guessing that swinging a melee weapon just isnt in the AIs programming
 
Anyone get this up and running on a dayz.st server? I would love to see a pbo from him/her for a comparison, if possible :)

Also, any luck with actually making them respawn in a given timeframe (like in every hour, every 2 hours, etc)?
If you like at Simple AI Tutorial, that is based on DayZ.ST and is effectively the same exact code with minor tweaks. I made the tutorial based on requests to make Axemans system slightly easier. So it's basically this code made easier to set up.
 
Anyone has an idea how to make them reeeeealy hardcore? The default script lets me sneak on to them realy easily... anyone with a makarov could headshot them and then have the loot of his life ;)
createUnit [_unitpos, _aiGroup, "_aiunit=this;",0.6,"Private"];

I'm told if you change that .6 to 1, then it will almost double their "skill".

That is located in your add_unit_server.sqf or equivalent file
 
createUnit [_unitpos, _aiGroup, "_aiunit=this;",0.6,"Private"];

I'm told if you change that .6 to 1, then it will almost double their "skill".

That is located in your add_unit_server.sqf or equivalent file

So what is that 0.6 for, and what is the difference between changing that setting and the "set skill" options in the script ? Would setting that 0.6 to 0.1 instead of 1 for example make the AI units really dumb?
 
So what is that 0.6 for, and what is the difference between changing that setting and the "set skill" options in the script ? Would setting that 0.6 to 0.1 instead of 1 for example make the AI units really dumb?
I don't understand it completely. I think it's an overall skill level. So if you give perfect skills to someone assigned as a .1 they are still going to be terrible.
 
Hi all,

seems some people work on the same things at the moment. I am working on AI logic for the last 3 weeks now, although took a different approach (not using the setside versus Zeds), what i achieved on my version is:

a) no clientside changes needed
b) no rmod needed

1) Survivor AI (shooting bandits and zeds)
2) Bandit AI (shooting survivors, player bandits, zeds and military AI)
3) military AI (shooting player bandits and AI bandits, could shoot zeds but that leads to endless firefights, while i want them to patrol the areas)
4) zeds not aggroing any AI (it is possible to manually add AI units to the Zeds target array, but the damage model of zeds damage is afaik not applyable to AI ... still researching on that one).
5) having patrol helicopters that check e.g. the spawn coasts and hunt down bandits only (auto refuel, auto reammo)

6) any AI will need to have an auto reammo EH running, otherwise they sinply run out of ammo at some point
7) vehicles in AI groups need to have an EH to be refueld automatically
8) if you spawn in vehicles for AI groups, make sure AI does not leave them. If a player tries to get into an abandonned, spawned in vehicle, the server_cleanup.fsm will kill him on entering.
9) destroyed AI vehicles that were spawned in will be cleaned up by server_cleanup.fsm as well.
10) the workaround for the above 2 issues is either to adjust the server_cleanup.fsm (be CAREFUL, if you simply comment that logic out, anyone can spawn in vehicles without being punished), or to set the object variables in a way that is similar to the one in the DAyz logic - but that means these vehicles will be put into the objects array and will be maintained by that - e.g. saved to DB etc ...

11) i use another way to control who aggroes whom. My AI bandits are side east, everything else is handled via the addrating logic.
12) running addrating over all zeds on the map is bad and shouldnt be done
13) instead, use a function on every AI that checks in an intervall for entities close to that AI, and based on the class sets the rating.
14) by this you can check for players as well, and depending on their humanity value set the corresponding rating.

15) spawning in AIs should only happen when a player is closeby ... no use and heavy impact on the server if theres a map full of AI, and one player .... Rocket had the same problem with the Zeds, and decided to spawn em when players are close.
16) I recommend to run an AI monitor, by this you are able to control number of AI / groups and can handle respawns / deletions etc.

17) - AI driving through rubbish - the reason is simple. AI is being generated and controlled on the server. Rockets additional rubbish on the roads is only generated clientside. So AI dont see these.

18) I recommend the following to optimize AI and handling: UPSmon, SHK_pos and ASR_AI.

19) Teamkill - AI shooting the teamkiller - as long as there is no switch to the bandit side, i think there is no way to achieve this. players (regardless if bandit or survivor) are classed as west in Dayz - which is the case for friendly AI as well. You would need to modify the Killed EH of the player object, which is handled on the clientside afaik.

20) end of wall of text :)

Maybe i'll release my version someday, still optimizing and testing. Open for any discussions though.

cheers

Sarge
 
How did you get the AI to differentiate between player bandit and player survivor or hero? This has been killing me. I stayed up for 2 days trying to figure it out and in the end came up with nothing.

can you describe this to me:
13) instead, use a function on every AI that checks in an intervall for entities close to that AI, and based on the class sets the rating.
14) by this you can check for players as well, and depending on their humanity value set the corresponding rating.

how does addRating work in this sense? you can't set addRating on players (as I understand it anyway) so how would addRating effect the potential of AI to attack players based on humanity?
 
Hi all,

seems some people work on the same things at the moment. I am working on AI logic for the last 3 weeks now, although took a different approach (not using the setside versus Zeds), what i achieved on my version is:

a) no clientside changes needed
b) no rmod needed

1) Survivor AI (shooting bandits and zeds)
2) Bandit AI (shooting survivors, player bandits, zeds and military AI)
3) military AI (shooting player bandits and AI bandits, could shoot zeds but that leads to endless firefights, while i want them to patrol the areas)
4) zeds not aggroing any AI (it is possible to manually add AI units to the Zeds target array, but the damage model of zeds damage is afaik not applyable to AI ... still researching on that one).
5) having patrol helicopters that check e.g. the spawn coasts and hunt down bandits only (auto refuel, auto reammo)

6) any AI will need to have an auto reammo EH running, otherwise they sinply run out of ammo at some point
7) vehicles in AI groups need to have an EH to be refueld automatically
8) if you spawn in vehicles for AI groups, make sure AI does not leave them. If a player tries to get into an abandonned, spawned in vehicle, the server_cleanup.fsm will kill him on entering.
9) destroyed AI vehicles that were spawned in will be cleaned up by server_cleanup.fsm as well.
10) the workaround for the above 2 issues is either to adjust the server_cleanup.fsm (be CAREFUL, if you simply comment that logic out, anyone can spawn in vehicles without being punished), or to set the object variables in a way that is similar to the one in the DAyz logic - but that means these vehicles will be put into the objects array and will be maintained by that - e.g. saved to DB etc ...

11) i use another way to control who aggroes whom. My AI bandits are side east, everything else is handled via the addrating logic.
12) running addrating over all zeds on the map is bad and shouldnt be done
13) instead, use a function on every AI that checks in an intervall for entities close to that AI, and based on the class sets the rating.
14) by this you can check for players as well, and depending on their humanity value set the corresponding rating.

15) spawning in AIs should only happen when a player is closeby ... no use and heavy impact on the server if theres a map full of AI, and one player .... Rocket had the same problem with the Zeds, and decided to spawn em when players are close.
16) I recommend to run an AI monitor, by this you are able to control number of AI / groups and can handle respawns / deletions etc.

17) - AI driving through rubbish - the reason is simple. AI is being generated and controlled on the server. Rockets additional rubbish on the roads is only generated clientside. So AI dont see these.

18) I recommend the following to optimize AI and handling: UPSmon, SHK_pos and ASR_AI.

19) Teamkill - AI shooting the teamkiller - as long as there is no switch to the bandit side, i think there is no way to achieve this. players (regardless if bandit or survivor) are classed as west in Dayz - which is the case for friendly AI as well. You would need to modify the Killed EH of the player object, which is handled on the clientside afaik.

20) end of wall of text :)

Maybe i'll release my version someday, still optimizing and testing. Open for any discussions though.

cheers

Sarge

Nice, why not dump it here for all of us to help test and tweak?
 
quick answers: i set a function to be run in the init line of each AI i create. In this function, which loops until the AI is dead, i handle things like reammo, and check for nearby entities as well. If these are Zeds, i do an addrating -10000.

For players nearby, i can check the humanity variable, and based on that i reduce the rating for them.

IMPORTANT: i am trying to get hold of the admins of the forum, my IP is banned, so i need to get here via proxies. I have no clue why it is, i never spammed, never cheated and never done sth here that is wrong, but seem to not be able to contact anyone to solve this.

Thx guys,

cheers

Sarge
 
quick answers: i set a function to be run in the init line of each AI i create. In this function, which loops until the AI is dead, i handle things like reammo, and check for nearby entities as well. If these are Zeds, i do an addrating -10000.

For players nearby, i can check the humanity variable, and based on that i reduce the rating for them.

IMPORTANT: i am trying to get hold of the admins of the forum, my IP is banned, so i need to get here via proxies. I have no clue why it is, i never spammed, never cheated and never done sth here that is wrong, but seem to not be able to contact anyone to solve this.

Thx guys,

cheers

Sarge
How do you reduce their rating. I found that addRating wasn't applicable to players. No matter what I tried I couldn't get addRating or join or joinSilent to be applicable to players. Could you possibly share the code you used to set the rating of players? or possibly the check for their humanity, and reducing their rating?

I tried running this code:
Code:
if (_humanity < 2500) then {
player addRating -10000;
};
in about 20 different spots and never got it to work. _humanity was set up using
Code:
_humanity = player getVariable ["humanity",0];

i tried running that in the server pbo in just about every file (sometimes using different variables for the player object, and tried running it in the mission pbo, to no avail.
 
I can't seem to get this working i want to get some soldiers in devils castle to defend it from zombies but its just not working.
I added my mission file.
What ive got now is an US Soldier which i added via mission editor which is shooting at my helicopter when i login and the squad spawned right but its not shooting zombies.
(guard2.sqf was just for testing doesnt seem to work eigther)
Dayz_factions is loaded on the server i just added it in @dayzcc
 

Attachments

  • dayz_1.chernarus.pbo
    278.6 KB · Views: 25
Back
Top