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

Do the NPCs respawn? or is it a one time spawn until restart?
Not yet, Sycosis is working on it and last i read he has it mastered :)
His server is due to expire though so fingers crossed he has enough time to perfect this amazing addon.

Until then only a server restart brings the little guys back.
 
This worked perfect on my dayz.st server. Definitely went with them being unfriendly and shooting on sight at anyone they see. I made 3 different patrols in cherno each consisting of 15 units, just for fun, and I didn't survive for very long... Do the NPCs respawn? or is it a one time spawn until restart?

They respawn at system restart. I have Friendly AI guarding my base against bad AI's that happen to wonder in. I have Bandit AIs that wonder the towns and cities along with Sniper AI's that wonder the entire map, both Bandits and Snipers will engage each other as well which makes for an awesome ambient effect.. Also, my Bandit AI's randomly spawn with flashlights and flying over Chernarus at night can be a cool sight :)
 
Been working on my AI troop coastal bus service and finally getting somewhere. The best way to respawn your ai group, I think, would be to add an eventhandler to, ideally only one troop member set with a stealth behaviour so he is last to die. In the attached .sqf run a do while alive to count the groups members. If members fall below a level add another into the group. Also add a killed eventhandler to replace the stealth guy (group controller), if needed..

Just trying to organise a bus driver and passenger, with support hummv, using eventhandlers has been a nightmare. Objects that pass and only work for some things for one, the nuances of the Arma engine are many..

Have got my driver and passenger working ok and a support hummv full of troops that finish off anybody killing the bus troops. If someone gets in and takes the driving seat the driver waits till they get out then dives back in and carries on his route. Drivers mate will take over the drivers role if the driver dies. Final step is to get one of the supporting troops to get in as a new bus passenger then the rest of the support to disperse or follow the bus..

A lot of the work here will apply very well to keeping troops stocked up, rather than redeploying them. Could even spawn the new troop in nearest building to make it look natural. Will have a look once I get my server updated with the new bus service..
 
Axeman would you be willing to share the AI vehicle script ? I'd love to have something similer but i have been following your progress and know just how much effort you've put into this, I'd understand if you didn't want to share it :)
Sycosis said in the other AI thread that he has a solution to the AI respawning :) But it took him way into the early hours and i think he's currently sleeping (No idea what timezone he's in)
 
Have messaged him. Am guessing he was up all night (gmt) and am sure I saw him on my server this morning :) probably sleeping.

Always up for sharing, am trying to get the time to package all my addons into one server side mod, more to make it easier to install.. this week has been all about the bus, and the apache / hummv support.
 
I look forward to your Vehicle AI scripts :) The bus script sounds like a great idea but i was wanting to have them in a heli if possible, we have a clan who fly round in a huey shooting survivors so i'd like to have an AI squad fly around and have some dogfights, for the way points i was hoping to have the AI fly around and then land for a few minutes before repeating, that way nobody will know when the AI will fly by or predict them :)
 
The hard bit is getting the ai to stop at waypoints, there is a trigger of sorts but not yet tried it. Yet to try adding an eventhandler to a waypoint..
 
Been working on my AI troop coastal bus service and finally getting somewhere. The best way to respawn your ai group, I think, would be to add an eventhandler to, ideally only one troop member set with a stealth behaviour so he is last to die. In the attached .sqf run a do while alive to count the groups members. If members fall below a level add another into the group. Also add a killed eventhandler to replace the stealth guy (group controller), if needed..

Just trying to organise a bus driver and passenger, with support hummv, using eventhandlers has been a nightmare. Objects that pass and only work for some things for one, the nuances of the Arma engine are many..

Have got my driver and passenger working ok and a support hummv full of troops that finish off anybody killing the bus troops. If someone gets in and takes the driving seat the driver waits till they get out then dives back in and carries on his route. Drivers mate will take over the drivers role if the driver dies. Final step is to get one of the supporting troops to get in as a new bus passenger then the rest of the support to disperse or follow the bus..

A lot of the work here will apply very well to keeping troops stocked up, rather than redeploying them. Could even spawn the new troop in nearest building to make it look natural. Will have a look once I get my server updated with the new bus service..

Man, I'd love to turn my greasy eyes to that script.

I'm also still wrestling with

Code:
"DEBUG: Deleting object UH1H_DZ with invalid ID at [33.5224,1590.66,0.000714302]"\

killing my scripted vehicles. I found the location in my fsm file and did this:

Code:
name = "check_for_hacker";
      init = /*%FSM<STATEINIT""">*/"//Check for hackers" \n
      " {" \n
      "//if(vehicle _x != _x) then {" \n
      "//if  (!(vehicle _x in _safety) && ((typeOf vehicle _x) != ""ParachuteWest"")) then {" \n
      "//diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
      "//(vehicle _x) setDamage 1;" \n
      "//_x setDamage 1;" \n
      "//};" \n
      "//};" \n
      " } forEach allUnits;" \n
      ""/*%FSM</STATEINIT""">*/;

I THINK that fixes the hacker vehicle xplosion (though maybe I'll put it back in! Only NPCs should be driving it).

I also found this in my server_objectupdate.sqf

Code:
if (!_parachuteWest) then {
if (_objectID == "0" && _uid == "0") then {
_object_position = getPosATL _object;
//    diag_log format ["DEBUG: Deleting object %1 with invalid ID at [%2,%3,%4]", typeOf _object, _object_position select 0, _object_position select 1, _object_position select 2]; 
//_isNotOk = true;
_isNotOk = false;
};
};
 
if (_isNotOk) exitWith { deleteVehicle _object; };

Which is the only sqf file that I can find that contains "DEBUG: Deleting Object", but it still does it :(
 
Hey guys, sorry if this has been asked, but the thread is 18 pages and I don't see a way to search the thread, so...

Do the AI's that are spawned ever run out of ammo?

Also, is there a reply to this thread somewhere in the 18 pages that explains how to get the AI to use vehicles? I am adding AI to my Lingor server.
 
Still can't get my units to load into the chopper :(

They spawn, the chopper spawns, and they just stand there.

Anyone see a problem with my code snippet?

Code:
//Spawn chopper
_veh = createVehicle ["UH1H_DZ",_unitpos,[], 0, "NONE"]; // 
 
//Spawn a crew
_s1 = "CZ_Soldier_DES_EP1" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"Private"];
_s2 = "CZ_Soldier_DES_EP1" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"Private"];
_s3 = "CZ_Soldier_DES_EP1" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"Private"];
_s4 = "CZ_Soldier_DES_EP1" createUnit [_unitpos, _aiGroup, "_aiunit=this;",1,"Private"];
 
// move them into the chopper
_s1 assignAsDriver _veh;
_s1 MoveInDriver _veh;
 
_s2 assignAsCommander _veh;
_s2 moveInCommander _veh;
 
_s3 assignAsGunner _veh;
_s3 moveInGunner _veh;
 
_s4 assignAsCargo _veh;
_s4 moveInCargo _veh;
 
//Try everything possible to let them get in the chopper
[_s1,_s2,_s3,_s4] allowGetin True;
[_s1,_s2,_s3,_s4] OrderGetIn True;
 
//_wppos = [_aispawnpos, 0]; // Cherno SE
_wp = _aigroup Addwaypoint [_aispawnpos, 50];
_wp setWaypointType "GETIN NEAREST";

I've tried wayponts LOAD and GETIN, no dice.
 
Hey guys, sorry if this has been asked, but the thread is 18 pages and I don't see a way to search the thread, so...

Do the AI's that are spawned ever run out of ammo?

Also, is there a reply to this thread somewhere in the 18 pages that explains how to get the AI to use vehicles? I am adding AI to my Lingor server.
Yeah they can, somebody somewhere had a script to check for magazines and add one :p. Like you said, it's hard to sort through 18 pages.
 
@ orcthrasher - I read somewhere in the BI wiki that AI will only enter a vehicle that is on their side, west can't use east vehicles.
I could be way off the mark here though ....
 
Just trying to organise a bus driver and passenger, with support hummv, using eventhandlers has been a nightmare. Objects that pass and only work for some things for one, the nuances of the Arma engine are many..

Have I introduced you to my annoying friend, Battleye? lol.. I manage to get pretty much everything working with my projects, but with BE its one restriction after the next. Whatever you do, don't download their setpos.txt and attachto.txt files aaaaargh! I had a dozen players BANNED by BE in less than hour after adding a heli lift script.. for Setpos first, then attachto later for the tow script! That's even after adding the filters...
 
Have I introduced you to my annoying friend, Battleye? lol.. I manage to get pretty much everything working with my projects, but with BE its one restriction after the next. Whatever you do, don't download their setpos.txt and attachto.txt files aaaaargh! I had a dozen players BANNED by BE in less than hour after adding a heli lift script.. for Setpos first, then attachto later for the tow script! That's even after adding the filters...

Yikes! How do you get somebody unbanned from BE for something like that?
 
It works!

Now my only problem is that the chopper will occasionally just land randomly and dudes will jump out ^_^ All of the waypoints are set to move (except for the cycle waypoint at the end).
 
Friend or Foe: As kain6699 has found you can get the units to shoot at survivors by changing the setFriend values in the Dayz_Factions\init.sqf. Any value below 0.6 will be an enemy so you could probably make it that and they won't pursue your survivors as much as the zeds, again worth experimenting with: setFriend

I set this to 0.6 and was very close to them but they never fired on me. Is this value correct? Has anyone else experimented with other values?

I won't answer for axeman, but I added this to Oring yesterday, and had AI take control of the middle island, and added a few small perks to controlling that area (primarily because the AI used elite weapons which you could loot from them), and the people on my server absolutely loved it. There were groups of survivors working together to kill the AI, which is rare from my perspective to see survivors openly working together. My note would be that you need to change their attributes based on the area, because initially I had some sniper AI that were lighting people up from 500 yards in 1 shot.

Code:
    //set skills
    _aiunit setSkill ["aimingAccuracy",.7];
    _aiunit setSkill ["aimingShake",0.9];
    _aiunit setSkill ["aimingSpeed",.6];
    _aiunit setSkill ["endurance",1];
    _aiunit setSkill ["spotDistance",0.6];
    _aiunit setSkill ["spotTime",0.6];
    _aiunit setSkill ["courage",1];
    _aiunit setSkill ["reloadSpeed",1];
    _aiunit setSkill ["commanding",1];
    _aiunit setSkill ["general",1];

We finished with this, which ended up being just right for a group of 4 to take them out. I spawn 35 troops over 7 locations inside of an semi-small area (roughly the size of a small town) and it took 4 of us with snipers from a vantage point about 15 minutes to kill them all, and they still killed 2 of us.

Just a couple questions - still reading through 18 pages of this thread... what file does the above code go in and how did you get the AI to engage you? Were you bandits when you engaged them or suvivors?

Then, you can either modify your add_unit_server to accept a bandit/hero parameter to change the center, or just (like I did for testing) duplicate it.

Do you add the code to the add_unit_server.sqf or do you overwrite what is in there with the code you provided?

*EDIT* Just went through all 18 pages and I have some questions:

1. How do you spawn a vehicle, have the AI get into it, and patrol?
2. I set RESISTANCE setFriend [WEST,.6]; so from what I understand, this will cause the AI to attack all players? What setting should I use so they only attack the players if they are shot my the players?
3. Is there a way to make it so the AI will shoot anyone within X meters?

Thanks in advance for any replies.
 
Back
Top