Simple AI Tutorial (no rMod or DayZ_Factions)

I am so lost because I am new to this and really do not understand programming but I can't for the life of me get this to work. I am sure I am missing something simple but if I upload my server .PBO could some get this working for me? I will donate to whoever can help.
 
Report says there is an error here:

Code:
19:15:10 Error in expression < select 0;
_position = getPosATL _unit;
sleep .2;
_unit = [_position, 0.1, 1.5] >
19:15:10  Error position: <sleep .2;
_unit = [_position, 0.1, 1.5] >
19:15:10  Error Generic error in expression
19:15:10 File mpmissions\__cur_mp.chernarus\compile\fn_spawn_deathFlies.sqf, line 8

That's my report and this is where it is talkin about:

Code:
/*
    Usage: [_unit] call fnc_spawn_deathFlies;
*/
 
    // private[""];
    _unit = _this select 0;
    _position = getPosATL _unit;
      sleep .2;
    _unit = [_position, 0.1, 1.5] call bis_fnc_flies;

The last bit is in the fn_spawn_deathFlies.sqf
 
Hello, I have the new PBO file ready and followed every step you said on the post and my DayZ.ST server runs perfectly fine, but I don't see anything happening at the coordinates I want them to spawn at. Can I have some help? Here is my init.sqf.... can someone tell me if it is correct?

Code:
/* 
    INITILIZATION
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance = 1870;                    //The instance
dayzHiveRequest = [];
initialized = false;
dayz_previousID = 0;
 
//disable greeting menu
player setVariable ["BIS_noCoreConversations", true];
//disable radio messages to be heard and shown in the left lower corner of the screen
//enableRadio false;
 
//Load in compiled functions
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\variables.sqf";                //Initilize the Variables (IMPORTANT: Must happen very early)
progressLoadingScreen 0.1;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\publicEH.sqf";                //Initilize the publicVariable event handlers
progressLoadingScreen 0.2;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\medical\setup_functions_med.sqf";    //Functions used by CLIENT for medical
progressLoadingScreen 0.4;
call compile preprocessFileLineNumbers "\z\addons\dayz_code\init\compiles.sqf";                //Compile regular functions
progressLoadingScreen 1.0;
 
"filmic" setToneMappingParams [0.153, 0.357, 0.231, 0.1573, 0.011, 3.750, 6, 4]; setToneMapping "Filmic";
 
if ((!isServer) && (isNull player) ) then
{
waitUntil {!isNull player};
waitUntil {time > 3};
};
 
if ((!isServer) && (player != player)) then
{
  waitUntil {player == player};
  waitUntil {time > 3};
};
 
zombie_generate = compile preprocessFileLineNumbers "scripts\zombie_generate.sqf";
 
if (isServer) then {
    _factions = [] execVM "scripts\set_unit_faction.sqf";
    //diag_log format["Factions executed: %1",_factions];
    //Array to pass to .sqf: [[<worldspace>],radius of waypoints (in metres),number of waypoints,number of ai units, group type [0:random unit, 1:sniper, 2:gunner, 3:militiaman, 4:squad], faction [0:hates everyone except survivors, 1:hates everyone]]
    _aispawn = [[731.64447, 9446.168],100,5,2,4,0] execVM "scripts\add_unit_server.sqf";//Airport Vatra
};
 
if (isServer) then {
    _serverMonitor =    [] execVM "\z\addons\dayz_code\system\server_monitor.sqf";
};
 
if (!isDedicated) then {
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
 
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =    [] execVM "\z\addons\dayz_code\system\player_monitor.sqf"; 
};

Note, I run on Panthera.
 
Your worldspace has no height in it, that's about all i can see that might stop it
Try using this
Code:
_aispawn = [[731.64447, 9446.168,0],100,5,2,4,0] execVM "scripts\add_unit_server.sqf";//Airport Vatra
 
Report says there is an error here:

yeah I guess if you use sleep it has to be in a an sqf called by execVM whereas that script is not being called that way, you could just comment the sleep out and get rid of that error since it isn't sleeping anyway, or try to change the way it's called, don't be afraid to google an error and try to fix it by trial and error, I found that answer by searching 'arma 2 sqf sleep generic error in expression'
 
Yeah, Cancerous for the moment i commented it out until i can get the rest to work. AI are still not getting attacked by Zeds, tried changing a couple things cause i'm not really sure where/what to change to make them louder/more detectable.
 
I got this working but is there anyway to take the radios off of the AI? I run TSW and a few people got kicked at first yesterday for picking them up. I adjusted it but would like to remove them if at all possible.

Also, some places I should have like 2 soldiers there were 4 or 5 then after killing them they seemed to have never spawned back. My server restarts every 12 hours. Do I need to shorten it to 6 to get AI back in the game or what?
 
Hey guys, sorry I've been gone a while. Decided to get another server for the time being, and i'm working on the respawn code as we speak. I've gone the way of getting rid of zombies entirely, and just using npc's (i'm on a deathmatch server now), so I haven't made any progress with making zombies attack npc's, but I have done massive upgrades to the script, and I will publish the files when I finish this.
 
Updated the original post to include the code required for respawning your units. What do you want next? I'm only going to be working on this during the week, because my server is pretty full on weekends, but let me know what you guys want next and I will start working on it. I'm going to incorporate AI vehicles last, because that's basically an entirely different addon from what i'm doing here, and i'd rather perfect this one first.
 
What do we want next? you are the fucking man dude! I've noticed that when I put some skins on (Ins_Bardak is one) The "friendly ai"/ Resistance attack me. Could it be as simple as the skin changing my side?
I got this working but is there anyway to take the radios off of the AI? I run TSW and a few people got kicked at first yesterday for picking them up. I adjusted it but would like to remove them if at all possible.

Also, some places I should have like 2 soldiers there were 4 or 5 then after killing them they seemed to have never spawned back. My server restarts every 12 hours. Do I need to shorten it to 6 to get AI back in the game or what?

I had a problem with too many spawning. I will show you my mistake.

_aispawn = [[6689.49,2623.590,0],160,8,5,4,0] execVM "scripts\add_unit_server.sqf";//Chernogorsk East

This is what I had. The group type I had is 4(squad). I thought this meant that instead of random this would make one of each unit type(0:random unit, 1:sniper, 2:gunner, 3:militiaman) until it reached the 5 units I had it set to. Instead what I got was 5 full squads. Each has 3 dudes, so it spawned 15 NPCs. Ok, so I changed my group type to 0 and now I get 5 units each a random type (1:sniper, 2:gunner, 3:militiaman). Hope this helps, and isn't too confusing.
 
I hate too sound noobesque, but that is whats happening. on dayz.st, after i packaged everything and uploaded. I get a black screen in game. Is it possible if anyone that has a dayz.st server to upload the dayz_mission.pbo file here with just the ai modification? That would be awesome, or if there is a video or somethin!
 
bravo my friend. you saved me some valuable time from making my video tutorial.
A video tutorial would still be nice I have a Day.ST server and would love to add patrolling AI''s to my server and a step by step video tutoril would be nicer than jumping between a bunch of different threads and pages. I'm sorry for being so dumb but I can't follow this at all...
 
Other than the respawning i would like to see the Zeds attack the AI, i tried several things with what the other guy had mentioned and was unable to get it to work. May just be a case of having his info in wrong spot but i followed it word for word and still a no go. So if you could get this working i would be grateful.
 
Hi have a dayz.st server at the min and it works fine, i messed around to try and duplicate your problem with the black screen and managed it by inputting the wrong world space so I'd start looking there.
Thebes
 
Hi, and great work! This is an awesome thread and I mean it.

I would like to add AI kills to my debug monitor, but I don't know how.
Can anyone explain what to do/add.
I have a debug monitor that works
 
I'm currently at work, and am unable to get my @dayz files from my at home pc. Would someone be kind enough to load the files that I can't access? I can access the mission.pbo from dayz.st.
Thank you thebes, I will try that. If I understand! But it should pop out if im reading the code right.
 
Back
Top