Simple AI Tutorial (no rMod or DayZ_Factions)

Bolbies,

That init.sqf looks fine, can you post your mission pbo or other scripts files so I can check them.

Also here is a tidier version of your init.sqf

Which mission pbo is it? I suck at this stuff
 

Attachments

  • add_unit_server.sqf
    13 KB · Views: 4
  • set_unit_faction.sqf
    296 bytes · Views: 3
  • unit_killed.sqf
    1.4 KB · Views: 2
  • zombie_generate.sqf
    2.9 KB · Views: 2
Really confused! Here are my files... I keep getting stuck on the loading screen at the end and if i do make it through, i get sorry disconnect and try again. Can anyone help? I don't think theirs error in my files... But something must be wrong
 

Attachments

  • zombie_generate.sqf
    2.6 KB · Views: 2
  • unit_killed.sqf
    1.4 KB · Views: 3
  • set_unit_faction.sqf
    298 bytes · Views: 3
  • add_unit_server.sqf
    13 KB · Views: 6
  • init.sqf
    5.6 KB · Views: 4
Sasha,

Looks like you had a } out of place in your init.sqf try this and let me know.
 

Attachments

  • init.sqf
    5.6 KB · Views: 5
Bolbies,

That's what I needed, try using these two files and let me know, also let me know what the RPT file shows, after you try this.
 

Attachments

  • init.sqf
    3.3 KB · Views: 3
  • add_unit_server.sqf
    13.2 KB · Views: 4
Yes it does, It started to cause problems when i found i had my add_unit_server.sqf with the same code as the unit_killed.sqf, So when i changed it to the correct one it made this error D:

This is my entire pbo
 

Attachments

  • dayz_mission.pbo
    98.2 KB · Views: 2
Bolbies,

That's what I needed, try using these two files and let me know, also let me know what the RPT file shows, after you try this.

Code:
_aispawn = [[6229.81,7894.1, 0],75,5,12] execVM "scripts\add_unit_server.sqf";//Stary Sabor
_aispawn = [[6329.81,7794.1, 0],250,14,12] execVM "scripts\add_unit_server.sqf";//Stary Sabor

Love ya man! Thank you so much! I have two questions though...

1. Is there any way to speed up their movement? They walk 3 feet and go prone for a few seconds, then repeat.

2. I've seen some people on this thread with init.sqf's that have 2 separate settings like in the example above. Does this change anything?
 
Bolbies,

That's what I needed, try using these two files and let me know, also let me know what the RPT file shows, after you try this.

3. (sorry) Does what you sent me allow the zeds to attack the AI or will I have to do what it says on pg 3?
 
Bolbies,

Each line spawns a new set of AI, to have them move differently you can do one of two things, you can change the number of waypoints per distance, the 2nd and 3rd number's so 100,5 will say stop at 5 points in 100 radius, where as 100,2 will shave them stop at 2 places in 100 radius, 1 will cause them to stand still. Also you could change the

Code:
_aiunit setCombatMode "RED";
_aiunit setBehaviour "COMBAT";

Choice's are


"BLUE" (Never fire)
"GREEN" (Hold fire - defend only)
"WHITE" (Hold fire, engage at will)
"YELLOW" (Fire at will)
"RED" (Fire at will, engage at will)


and


"CARELESS"
"SAFE"
"AWARE"
"COMBAT"
"STEALTH"


Pathfinding

SAFE, CARELESS - Units will try to stay on roads, not caring about finding any cover
AWARE - Units try to stay mostly on roads, occasionally using cover
COMBAT, STEALTH - Units will try to utilize cover whenever possible

Stance

SAFE, CARELESS - Units will stay upright
AWARE, COMBAT - Units will stay upright most of the time, kneeling down occasionally
STEALTH - Units will be prone most of the time

Note: that they will stay in the type you spawn them as unless you add code to change it on an event.
 
I believe I added that already - zeds attacking AI.


Thank you! And do you know if there's a way to save their progress too? I can only play on my laptop when I have time and if it takes them (let's say an hour) just to get from Cherno to Elektro it would be kind of pointless to make them restart every time.
 
They are not currently Database driven, it is a concept we have played with but have not had success implementing - however you could spawn multiple groups in multiple areas, you could also take a look at Sarge's AI addon, it is much more comprehensive then this one, but focuses on a different type of AI experiences than what I am attempting so I have decided to continue my own dev using this as the base.
 
For example on the multiple spawn thing - another user I helped used this

Code:
_aispawn = [[3589.66,2206.73,0],100,15,1,4,0,5,5,7,13600] execVM "scripts\add_unit_server.sqf"; // Kamarovo (Survivors) Squad 
_aispawn = [[1920.62,2316.83,0],300,5,1,4,0,4,7,1,13600] execVM "scripts\add_unit_server.sqf"; // Kamenka  (Survivors) Squad  
_aispawn = [[1920.62,2316.83,0],100,5,1,4,0,4,7,7,13600] execVM "scripts\add_unit_server.sqf"; // Kamenka  (Survivors) Squad
_aispawn = [[1719.74,2912.33,0],150,5,3,1,1,7,7,3,13600] execVM "scripts\add_unit_server.sqf"; // Kamenka  (Bandits) Snipers
_aispawn = [[1376.09,3721.31,0],350,9,3,2,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo (Bandits) Gunners
_aispawn = [[1376.09,3721.31,0],350,9,1,4,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  (Bandits) Squad
_aispawn = [[1656.24,3884.28,0],350,9,1,2,0,7,9,0,33600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  (AFS) M.Gunner
_aispawn = [[1735.37,3847.14,0],100,9,1,3,0,7,8,2,13600] execVM "scripts\add_unit_server.sqf"; //Pavlavo  (AFS) Marksman
_aispawn = [[1735.37,3847.14,0],100,1,1,1,0,7,8,2,13600] execVM "scripts\add_unit_server.sqf"; //Pavlavo  (AFS) Sniper
_aispawn = [[2463.81,3398.34,0.01],50,1,1,1,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East (Bandits) Sniper  
_aispawn = [[2463.81,3398.34,0.01],50,1,1,2,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East (Bandits) Gunner
_aispawn = [[2463.81,3398.34,0.01],300,5,1,4,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East (Bandits) Gunner
_aispawn = [[2705.13,3257.33,0],500,9,2,4,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East (Bandits) Squad X2
_aispawn = [[2705.13,3257.33,0],50,1,1,4,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East (Bandits) Squad
_aispawn = [[2806.93,3075.51,0],350,9,2,1,0,7,9,2,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East(AFS) Snipers
_aispawn = [[2806.93,3075.51,0],500,9,2,1,0,7,9,0,13600] execVM "scripts\add_unit_server.sqf"; // Pavlavo  East (AFS) Snipers
_aispawn = [[11105.2,3060.25,0],300,5,2,4,0,7,9,7,13600] execVM "scripts\add_unit_server.sqf"; // Carpool  (Survivors) Squad X2
_aispawn = [[11105.2,3060.25,0],100,5,1,4,0,7,7,7,13600] execVM "scripts\add_unit_server.sqf"; // Carpool  (Survivors) Squad
_aispawn = [[11105.2,3060.25,0],50,1,1,4,0,7,9,7,13600] execVM "scripts\add_unit_server.sqf"; // Carpool  (Survivors) Squad
_aispawn = [[10556.3,2230.44,0],50,1,2,2,0,5,7,1,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  (Survivors) 
_aispawn = [[10433.2,2328.03,0],100,5,1,1,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East (Bandits) 
_aispawn = [[10018.2,1907.32,0],100,5,1,2,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East (Bandits)
_aispawn = [[10018.2,1907.32,0],100,5,1,2,1,5,6,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East (Bandits)
_aispawn = [[10073.3,1933.17,0],150,5,1,3,1,5,5,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East(Bandits)
_aispawn = [[10219.8,2044.67,0],150,5,2,4,1,5,5,1,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East(Bandits) Squad X2
_aispawn = [[10219.9,2114.87,0],250,5,2,4,1,5,5,1,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East(Bandits) Squad X2
_aispawn = [[10182.5,2142.59,0],250,5,2,4,1,5,5,8,13600] execVM "scripts\add_unit_server.sqf"; // Elektro  East(Bandits) Squad X2
_aispawn = [[10481.7,2179.1,0],500,5,2,4,1,5,7,1,13600] execVM "scripts\add_unit_server.sqf"; //Elektro  (Bandits) Squad X2
_aispawn = [[10161.5,1914.27,0],350,5,2,4,1,5,8,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro (Bandits) Squad X2
_aispawn = [[10233.7,1617.2,0],500,10,3,1,0,10,10,2,13600] execVM "scripts\add_unit_server.sqf"; // Elektro Harbor(AFS) Sniper 
_aispawn = [[10341.4,1752.21,0],100,1,1,4,2,7,10,5,13600] execVM "scripts\add_unit_server.sqf"; // Elektro Harbor  Resistance(Survivors) FRND
_aispawn = [[10315.6,1864.23,0],550,15,1,4,2,7,9,4,13600] execVM "scripts\add_unit_server.sqf"; // Elektro Harbor (ASF) Specops1
_aispawn = [[10603.6,2331.36,0],500,25,4,2,1,4,7,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro (Bandits)
_aispawn = [[10441.2,2629.82,0],500,35,4,4,1,5,7,8,13600] execVM "scripts\add_unit_server.sqf"; // Elektro powerplant(Bandits)
_aispawn = [[10441.2,2629.82,0],500,45,2,4,1,5,7,3,13600] execVM "scripts\add_unit_server.sqf"; // Elektro powerplant(Bandits)
_aispawn = [[10441.2,2629.82,0],500,1,2,4,1,5,7,8,13600] execVM "scripts\add_unit_server.sqf"; // Elektro powerplant (Bandits)
_aispawn = [[10441.2,2629.82,0],500,45,2,4,1,5,7,7,13600] execVM "scripts\add_unit_server.sqf"; // Elektro powerplant (Bandits)  
_aispawn = [[10222,3799.9,0],500,100,1,4,0,10,10,0,13600] execVM "scripts\add_unit_server.sqf"; // Dam Elektro (ASF) Squad
_aispawn = [[10222,3799.9,0],10,1,1,4,0,10,10,2,3600] execVM "scripts\add_unit_server.sqf"; // Dam Elektro (ASF) Squad Elektro Dam
    _aispawn = [[10170.3,3630.48,0],30,2,1,4,0,10,10,4,13600] execVM "scripts\add_unit_server.sqf"; // Dam Elektro (ASF)  Squad Dam Elektro
_aispawn = [[10197.6,3602.54,0],300,50,1,4,0,10,10,6,13600] execVM "scripts\add_unit_server.sqf"; // Dam Elektro (ASF)  GhillieSquad Dam Elektro
_aispawn = [[10066.4,1814.82,0],100,5,3,4,2,4,6,1,3600] execVM "scripts\add_unit_server.sqf"; //  Elektro (Survivors) FRND
_aispawn = [[10066.4,1814.82,0],100,1,3,4,2,6,6,5,13600] execVM "scripts\add_unit_server.sqf"; //  Elektro (Survivors) FRND
_aispawn = [[10066.4,1814.82,0],100,5,3,4,2,4,6,7,13600] execVM "scripts\add_unit_server.sqf"; //  Elektro (Survivors) FRND
_aispawm = [[7247.18,3025.94,0],100,5,1,4,1,3,6,1,13600] execVM "scripts\add_unit_server.sqf"; // Ambush Exterior1 East(Bandits)
_aispawn = [[6736.49,3373.55,0],100,5,2,4,1,5,6,1,13600] execVM "scripts\add_unit_server.sqf"; // Ambush Camp East(Bandits)
_aispawn = [[6736.49,3373.55,0],350,5,2,4,1,5,6,5,13600] execVM "scripts\add_unit_server.sqf"; // Ambush Camp2 East(Bandits)
_aiapawn = [[7087.54,7872.37,0],200,8,4,4,1,3,5,1,13600] execVM "scripts\add_unit_server.sqf"; // Novy Sobar  East(Bandits)
_aispawn = [[6588.98,2290.34,0],550,9,1,1,0,10,10,2,13690] execVM "scripts\add_unit_server.sqf"; // Chernogorsk (ASF) Sniper 
_aispawn = [[7049.03,2673.58,0],550,35,5,2,2,5,5,5,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk (Survivors) FRND
_aispawn = [[7049.03,2673.58,0],550,25,5,2,1,5,5,3,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[6572.72,2624.78,0],550,29,3,2,1,5,5,1,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[6572.72,2624.78,0],550,19,3,2,1,5,5,8,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[7049.03,2673.58,0],550,50,5,2,1,5,5,7,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[7049.03,2673.58,0],550,75,5,2,1,5,5,8,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[6572.72,2624.78,0],550,69,3,2,1,5,5,1,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[6572.72,2624.78,0],550,49,3,2,1,5,5,3,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  East(Bandit) 
_aispawn = [[6745.76,2622.33,0],550,10,1,1,2,10,10,4,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  West(ASF) Sniper FRND
_aispawn = [[7006.65,3082.35,0],300,5,1,1,2,10,10,6,13600] execVM "scripts\add_unit_server.sqf"; // Chernogorsk  West(ASF) Sniper Outer FRND
_aispawn = [[13332.4,4980.83,0],50,3,1,2,1,6,9,5,13600] execVM "scripts\add_unit_server.sqf"; // Highwayman1 East(Bandit)
_aispawn = [[13283.7,6105.28,0],100,5,1,4,2,8,10,6,13600] execVM "scripts\add_unit_server.sqf"; // Solnichniy West(ASF) 
_aispawn = [[13371,6163.98,0],250,5,2,4,9,4,6,1,13600] execVM "scripts\add_unit_server.sqf"; //  Solchiniy Resistance(Survivors)
_aispawn = [[13432.3,6220.15,0],100,5,2,4,1,5,6,5,13600] execVM "scripts\add_unit_server.sqf"; //Solchiniy Resistance(Survivors)
_aispawn = [[12963.9,8091.03,0],550,10,3,1,0,5,9,1,13600] execVM "scripts\add_unit_server.sqf"; // Nizhnoye  Resistance(Survivors)
_aispawn = [[12889,8220.39,0],550,5,2,4,1,4,7,9,3,13600] execVM "scripts\add_unit_server.sqf"; //  Nizhnoye  East(Bandits)
_aispawn = [[13394.8,4151.27,0],200,5,1,4,0,7,10,1,13600] execVM "scripts\add_unit_server.sqf"; // Abandoned General Store  Resistance(Survivors)
_aispawn = [[13394.8,4151.27,0],200,1,1,4,0,7,10,5,13600] execVM "scripts\add_unit_server.sqf"; // Abandoned General Store  Resistance(Survivors)
_aispawn = [[11793.5,4005.62,0],550,5,3,4,1,4,6,8,13600] execVM "scripts\add_unit_server.sqf"; // Woods North of Kamyshovo  East(Bandit) Patrol
_aispawn = [[11793.5,4005.62,0],550,5,3,4,1,6,9,5,13600] execVM "scripts\add_unit_server.sqf"; // Woods North of Kamyshovo  East(Bandit) Patrol
_aispawn = [[10399.7,3646.51,0],300,5,9,4,1,4,7,8,3600] execVM "scripts\add_unit_server.sqf"; //  Elektro Dam  East(Bandits)
_aispawn = [[10399.7,3646.51,0],350,25,3,4,1,3,7,3,3600] execVM "scripts\add_unit_server.sqf"; //Elektro Dam  East(Bandits)
_aispawn = [[9867.36,3496.74,8.392e-04],100,5,4,1,1,3,5,5,11800] execVM "scripts\add_unit_server.sqf"; // Enemy Survivors Woods West of Dam
_aispawn = [[9973.11,4046.11,0],500,100,2,4,2,10,10,4,11800] execVM "scripts\add_unit_server.sqf"; //ASF Squad Woods North of DamElektro FRND
_aispawn = [[10082.8,5434.62,0],100,25,2,4,0,5,7,1,11800] execVM "scripts\add_unit_server.sqf"; // Hostile Survivors Staroye
_aispawn = [[10246.1,9118.25,0],350,25,2,4,0,5,7,7,11900] execVM "scripts\add_unit_server.sqf"; // Hostile Survivors Staroye

Note he has many gearset loadouts so this will not work pasted as it is - you would need to adjust all the gearset #'s .
 
I am experiencing another problem. Apparently the zeds are glued to the ground. They spawn, but don't go move and explore. Has anyone else gone through this?
 
So I added another group of AI by my admins base today. I changed them to opposition and made them .6 but they still attack me. I am not a bandit and neither is one of the other admins they shot. Why would this be?
 
Back
Top