Simple AI Tutorial (no rMod or DayZ_Factions)

I have gotten this to work on Chernarus and Tavi, I have not tried for other maps but it should work.
 
Reiben,

Here it is, I have only spawned one group of survivors here, but it should be enough for you to test if it works, they are at [3589.66,2206.73,0] Kamarovo.
 

Attachments

  • dayz_1.chernarus.pbo
    61.1 KB · Views: 3
Tiger,

If you post your mission pbo, I could add these, or I can walk you through it - this same set of files should work, though their placement and integration may need some tweaking.
 
Tiger,

If you post your mission pbo, I could add these, or I can walk you through it - this same set of files should work, though their placement and integration may need some tweaking.

There is my mission :)
 

Attachments

  • dayz_mission (5).pbo
    182.4 KB · Views: 4
Hey, thanks for the guide, I have the AI working fine, however since I added them, every time somebody tries to drink something they get kicked (BattlEye Restriction 18) I updated the scripts.txt file as instructed, is there any way I can fix this? My scripts.txt is attached in case that will help.
 

Attachments

  • scripts.txt
    44.3 KB · Views: 4
Tom Would you mind looking at my mission.pbo to see what is different, because my ais won't spawn. The file is above your first post
 
Tiger,

I don't see anything glaringly wrong in your files. I made some organizational changes to your init.sqf if you want try this, also are you seeing an errors in your RPT?
 

Attachments

  • init.sqf
    3.3 KB · Views: 3
Tom,
This should not be related to the AI pack in any way, this happened to a lot of folks in moving to 1.7.6.1.

There are quite a few posts for fixes, I think the issue is this line - if you can find the one that is most similar to it and change it to this you can test.

Code:
5 createVehicle !"\"createVehicle\"," !"createVehicleLocal" !"createVehicle [\"WeaponHolder\", _iPos, [], _radius, \"CAN_COLLIDE\"" !"_fire = createVehicle [_classname, _location, [], 0, \"CAN_COLLIDE\"" !"_object = createVehicle [_classname, _location, [], 0, \"CAN_COLLIDE\"" !"if (_height < 100) then {\n_bolt = createVehicle [\"BoltSteelF\", _endPos, [], 0, \"CAN_COLLIDE\"];\n_bolt setPosATL _endPos;" !"_tent = createVehicle [\"TentStorage\", _location, [], 0, \"CAN_COLLIDE\"];\n_tent setdir _dir;" !"if ((random _int)>2.2) then\n{\n_b=\"SmallSecondary\" createvehicle (getpos _v);\n};" !"exitwith {};\n_b=\"SmallSecondary\" createvehicle (_v modelToWorld _effect2pos);\n} foreach (_list);" !"_bag = createVehicle [format[\"WeaponHolder_%1\",_item],getPosATL player,[], 0, \"CAN_COLLIDE\"];\n_bag setdir (getDir player);" !"_bag = createVehicle [\"WeaponHolder_ItemTent\",_pos,[], 0, \"CAN_COLLIDE\"];\n_bag setdir _dir;\nplayer reveal _bag;" !"_object =  _type createVehicleLocal _position;\n_object setPos _position;\n_object setDir _dir;\n_object allowDamage false;" !"createVehicle [\"WeaponHolder\", position player, [], 0.0, \"CAN_COLLIDE\""
 
Tiger,

I don't see anything glaringly wrong in your files. I made some organizational changes to your init.sqf if you want try this, also are you seeing an errors in your RPT?

Cheers for that, How do I know there are any errors in the RPT, there is just a lot of text :O Would it help to post a text document with the RPT in it?
 
Yeah, what you are looking for in it is "Global Faction is #" if it contains that line then it is running the script and something else is wrong.
 
Code:
/*   
    INITILIZATION
*/
startLoadingScreen ["","RscDisplayLoadCustom"];
cutText ["","BLACK OUT"];
enableSaving [false, false];
 
//REALLY IMPORTANT VALUES
dayZ_instance =    1;                    //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;
 
zombie_generate = compile preprocessFileLineNumbers "scripts\zombie_generate.sqf";
 
if (isServer) then {
// For settings involving the factions, go to scripts\add_unit_server.sqf and adjust the settings at the top of the file
    _factions = [] execVM "scripts\set_unit_faction.sqf";
//_aispawnpos - Worldspace location
//_wpradius - Distance you want units to be able to travel
//_wpnum - Number of waypoints to place withing that distance. The higher the number, the more extensively the units will travel
//_numunits - Number of units to place. Keep in mind that squads will be placed in multiples of this number
//_unitType - Type of unit to place. 0: Random, 1: Sniper, 2: Gunner, 3: Militia, 4: Squad of the previous 3 types
//_faction - The type of faction you want this unit to adhere to. 0: RESISTANCE, 1: EAST, 2: WEST. Factions loyalties are set in scripts\set_unit_faction.sqf
//_baseSkill - Lowest possible skill that the units can posess from 1 to 10
//_potentialSkill - Highes possible skill that the units can posess from 1 to 10
//_gearSet - Which set of gear your units will use. To set the types of gear, edit the variables at the top of scripts\add_units_server.sqf
//_respawnTime - How long to wait until NPCs respawn (in seconds)
    _aispawn = [[3993.98,4193.84,0],250,5,2,4,1,7,10,0,1800] execVM "scripts\add_unit_server.sqf";
};
 
"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};
};
 
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";   
};
I can't seem to get the AI's to work! Can anyone help me?
 
I see you do not have the scripts folder in there with the needed scripts, I tried packing one for you, though you may need to extract it and manually add scripts and repack yourself before it runs on your server.
Thank you a lot! Now I understand it I think. Thank you so much for your help :)
 
Tiger,

Try this, I have added a log message saying "Ran Faction" and "Ran AISPAWN" - check and see if those show up in the RPT log to see where the scripts are breaking,
 

Attachments

  • init.sqf
    3.3 KB · Views: 4
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
 
Tiger,

Try this, I have added a log message saying "Ran Faction" and "Ran AISPAWN" - check and see if those show up in the RPT log to see where the scripts are breaking,

Both these messages have showed up in the RPT log, nothing else is on the same lines as them
 
Ok Tiger, let's try this then,

Then take a look at RPT log - should see msg "In add_unit_server" and we are still looking for the "Global Faction #" line
 

Attachments

  • init.sqf
    3.4 KB · Views: 7
  • add_unit_server.sqf
    13.2 KB · Views: 10
Back
Top