Simple AI Tutorial (no rMod or DayZ_Factions)

Hello, I'm having issue's with BattlEye Restriction #8. I have been all over google and haven't found any useful information. I have Opened my Scripts with FileZilla and changed almost everything to 1 that was a 5 but every time I kill an AI, I get kicked. Thank you
It's addWaypoint, which is on line 10.

I have to restart my server after making changes to this file. You may have to as well.
 
ok i replaced my unit_killed.sqf with your text and killed a set and waited ..no respawn again...any ideas as to what next?
but i thank you greatly for the help.verry nice
 
Thanks Sycosis, I fixed it with a little trial and error. I really appreciate your help. I'm having a little problem with understanding how to add another Faction. In the Add_unitserver there is TWO gearsets(case 1 and 2), I want to add a third case but don't quiet understand. I know that you have explained it before but I would really appreciate another quick explanation or even a PM if you have time. Thank you
 
Sycosis can you help me please ? Your original script worked fine :)
Now i've tried to add the new script with AI respawning and i get no zeds spawning.

My RPT shows "globalFaction is 1" and no zeds spawn
If i remove the AI spawn lines in my init.sqf i get zeds spawning

What could be the problem ?
 
Sycosis can you help me please ? Your original script worked fine :)
Now i've tried to add the new script with AI respawning and i get no zeds spawning.

My RPT shows "globalFaction is 1" and no zeds spawn
If i remove the AI spawn lines in my init.sqf i get zeds spawning

What could be the problem ?
In the tutorial there are 2 separate lines in the zombie_generate file that you CAN add. The first is the line to make NPCs attack zombies with the use of addRating. The second is to remove zombies entirely, which is editing the initial if statement to be all inclusive by adding || isNoone or something similar to that. If you want to keep the zombies in the game, then you need to leave out the second edit.
 
I have
Code:
{ _x addRating -20000; } forEach allMissionObjects "zZombie_Base";
in my zombie_generate.sqf

but i never changed the 2nd edit so it's still at the default value of
Code:
if (!_isNoone) exitWith {};

Zeds should still be spawning but they don't :confused: My RPT shows "globalFaction is 1"
Should i try without adding the 1st edit and just see of zeds spawn ?
 
I have
Code:
{ _x addRating -20000; } forEach allMissionObjects "zZombie_Base";
in my zombie_generate.sqf

but i never changed the 2nd edit so it's still at the default value of
Code:
if (!_isNoone) exitWith {};

Zeds should still be spawning but they don't :confused: My RPT shows "globalFaction is 1"
Should i try without adding the 1st edit and just see of zeds spawn ?
The first one won't affect the spawning of zeds.. Just the first.. Hmm.. You put the addRating line as the very last line on the script right?
 
Thanks Sycosis, I fixed it with a little trial and error. I really appreciate your help. I'm having a little problem with understanding how to add another Faction. In the Add_unitserver there is TWO gearsets(case 1 and 2), I want to add a third case but don't quiet understand. I know that you have explained it before but I would really appreciate another quick explanation or even a PM if you have time. Thank you
the format is:
switch (_gearSet} do {
case 0: {variables};
case 1: {variables};
};

all you have to do is this:
switch (_gearSet} do {
case 0: {variables};
case 1: {variables};
case 2: {variables};
};

Variables refers to those 12 or so lines of _sniperRifle and other variables. They all have to be the same variables, but with different results obviously. So instead of _sniperRifle = "gun1" do _sniperRifle = "gun2". Then just go back into your init, and instead of using gearSet 1 you can now use gearSet 2
 
Thanks Sycosis, I fixed it with a little trial and error. I really appreciate your help. I'm having a little problem with understanding how to add another Faction. In the Add_unitserver there is TWO gearsets(case 1 and 2), I want to add a third case but don't quiet understand. I know that you have explained it before but I would really appreciate another quick explanation or even a PM if you have time. Thank you
Do you know how to do diag_log's?

Put some of them in your unit_killed script. Do 1 for each variable, and make sure that the variables are being passed correctly, and then put 1 before and after the sleep timer to make sure that they are being triggered properly and let me know what you get.

Format is :
diag_log format["Position is %1",_aispawnpos];
 
The first one won't affect the spawning of zeds.. Just the first.. Hmm.. You put the addRating line as the very last line on the script right?
I followed the settings to the letter :) Original script works fine, for the respawn i downloaded it all again and followed your guide.
The last lines of my zombie_generate.sqf are :
Code:
//Start behavior
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
 
{ _x addRating -20000; } forEach allMissionObjects "zZombie_Base";

I'm using Taviana 2.0 if it makes any difference and have all AI set to 1 (East)
All the AI spawn in and so does loot but not a single zed spawns
 
I followed the settings to the letter :) Original script works fine, for the respawn i downloaded it all again and followed your guide.
The last lines of my zombie_generate.sqf are :
Code:
//Start behavior
_id = [_position,_agent] execFSM "\z\AddOns\dayz_code\system\zombie_agent.fsm";
 
{ _x addRating -20000; } forEach allMissionObjects "zZombie_Base";

I'm using Taviana 2.0 if it makes any difference and have all AI set to 1 (East)
All the AI spawn in and so does loot but not a single zed spawns
Honestly there is no reason why your zombies shouldn't be spawning then. Have you checked your rpt for the word "error"? I've never tried it on Taviana so I don't know if that would affect it, but surely it wouldn't.
 
What's their spot distance? Could you set it up too 800 or 900 meters?
It's based on skill, and I honestly don't know the ratio. It's probably also based on fog and overcast of the server. I've been sniped by a 10,10 skill sniper using an as50 from about 1000m before, and even further while I was in a heli.
 
Searched my RPT and not a single mention of error, The only odd log is this is mentioned several times
Code:
13:11:39 "Spawned: "1" TentStorage"
13:11:39 "Spawned: "2" TentStorage"
13:11:39 "Spawned: "3" TentStorage"
13:11:39 "Spawned: "4" TentStorage"
13:11:39 "Spawned: "5" TentStorage"
13:11:39 "Spawned: "6" TentStorage"
13:11:39 "READ/WRITE: ["PASS",[2012,5,1,9,0]]"
13:11:39 "HIVE: Local Time set to [2012,5,1,9,0]"
13:11:39 "globalFaction is 1"
13:11:39 "globalFaction is 1"
13:11:40 "globalFaction is 1"
13:11:40 "globalFaction is 1"
13:11:40 "globalFaction is 1"
13:11:41 "globalFaction is 1"
13:11:41 "globalFaction is 1"
13:11:41 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:44 "globalFaction is 1"
13:11:44 "globalFaction is 1"
 
Searched my RPT and not a single mention of error, The only odd log is this is mentioned several times
Code:
13:11:39 "Spawned: "1" TentStorage"
13:11:39 "Spawned: "2" TentStorage"
13:11:39 "Spawned: "3" TentStorage"
13:11:39 "Spawned: "4" TentStorage"
13:11:39 "Spawned: "5" TentStorage"
13:11:39 "Spawned: "6" TentStorage"
13:11:39 "READ/WRITE: ["PASS",[2012,5,1,9,0]]"
13:11:39 "HIVE: Local Time set to [2012,5,1,9,0]"
13:11:39 "globalFaction is 1"
13:11:39 "globalFaction is 1"
13:11:40 "globalFaction is 1"
13:11:40 "globalFaction is 1"
13:11:40 "globalFaction is 1"
13:11:41 "globalFaction is 1"
13:11:41 "globalFaction is 1"
13:11:41 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:42 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:43 "globalFaction is 1"
13:11:44 "globalFaction is 1"
13:11:44 "globalFaction is 1"
The globalFaction report isn't an oddity, it's just a diag_log I forgot to remove. It's just telling you the faction of the npc's you're creating.

Try commenting out the zombie_generate file in your init and see if the zombies come back.
 
And can i add more weapons for example the sniper i could add severel snipers so its random?
Yeah, where it says _sniperRifle or whatever, do this:

_rndSniperRifle = floor(random 2);
switch (_rndSniper) do {
case 0: {_sniperRifle = "gun1");
case 1:{_sniperRifle = "gun2"};
case 2:{_sniperRifle = "gun3"};
};

I don't know off the top of my head if a random 3 will return 1 2 and 3 or of it will return 0 1 2 3 or 0 1 2, so you might test by doing a: diag_log format ["Sniper Rifle %1 selected",_rndSniper]; so that you can see what the results of the random are. If you can't get it figured out, I will jump to my code and figure it out, but you should be able to get there with this code.

I THINK if you do floor(random 3) it will return 0 1 2 3. So you would need 4 weapons in that case. For 3 weapons do a random 2.

If you want to do a weighted system, you can do random 100, and instead of a case do:
if (_rndSniperRifle <=50} then {
_sniperRifle = "gun1";
} else {
if (_rndSniperRifle <=75) then {
_sniperRifle = "gun 2";
} else {
if (_rndSniperRifle <=90) then {
_sniperRifle = "gun 3";
} else {
_sniperRifle = "gun 4";
};
};
};

If you follow that, gun 1 has 50% chance to spawn, gun 2 has 25% chance, gun 3 has 15% chance, and gun 4 has 10% chance. I don't know how realistic those chances are, but in a perfect world where random is truly random, then that would be the case.
 
In base skill if i put it to 10 are they really shit or good? Or base skill 0 if want them to be good
baseSkill 10 and potentialSkill 10 if you want them to be badasses, but be warned, they are indeed badasses. If you don't have a sniper and know that they are there, you are likely going to lose. lol
 
baseSkill 10 and potentialSkill 10 if you want them to be badasses, but be warned, they are indeed badasses. If you don't have a sniper and know that they are there, you are likely going to lose. lol
Nice because im tired of AI were so easy before if you had a sniper rifle as long as you were 400 meters away
 
Back
Top