Loot boxes using DZAI loot tables?

kaotix

Member
I have AI missions on my server and I've just moved over to using DZAI for it because quite frankly its the most simple to setup and performs outstandingly well.
Right now, I have static loot for ammo crates and such that spawn for my missions. Because of this, the only real fun is in killing the AI and looting their corpses and there's not much fun in going to an ammo crate to find the same loot every time.

Is there a way to use the loot tables that DZAI loads from Epoch to generate loot, much like it does for the AI units it creates, and populate the ammo crates with this data?

Thanks
 
DZAI only uses the loot tables to obtain classnames of lootable weapons. If weapons are what you're adding to your crates, then simply have a script that pulls random classnames from these arrays:

DZAI_Pistols0
DZAI_Pistols1
DZAI_Pistols2
DZAI_Pistols3

DZAI_Rifles0
DZAI_Rifles1
DZAI_Rifles2
DZAI_Rifles3

As you know, the tables ending in "0" are from the Residential/Farm loot tables, "1" from Military (ie: Firestations), "2" from MilitarySpecial (ie: Barracks), and "3" from HeliCrash (self-explanatory).
 
I might have a look at how those loot table arrays are populated and potentially get other types of loot as well, such as items/food etc.
Do you have any documentation on spawning in your AI manually (which I'm currently doing) my issues right now is with their behaviour.
 
To manually spawn AI:

Code:
[_totalAI, grpNull, _spawnPos, objNull, _weapongrade] call DZAI_setup_AI;

Where _totalAI is the number of AI to spawn, _spawnPos is the position to spawn, and _weapongrade is the weapon/skill level 0-3. If you want to use a specific group, replace grpNull with the reference to a group, otherwise a new East-side group will be created. DZAI_setup_AI will return a reference to the group, so you can use it to set up waypoints or anything else needed. Leave objNull alone since it's supposed to be a reference to the trigger that is spawning the group, but that's not the case here.

Keep in mind that the function isn't meant to be used independently so some expected behaviors may happen, however at this time I'm not aware of any problems.
 
Buttface,
when I spawn AI with like

Code:
_spawnPos = _position;
_spawnPos set [2,0];
guards = [1,grpNull,_spawnPos,objNull,0] call DZAI_setup_AI;

AI kills don't score as bandit kills and thus don't give humanity. Is this by intent? Is there a way to change this?
 
If the AI are killed by players on foot, as opposed to using vehicle weapons, bandit kills should register, along with humanity.
 
to have custom spawn areas .. ( Im trying to learn this, but Im so confused.. )

if I put this in to the cust_spawn_tavi.sqf would this work ? am i doing this correctly ??

spawnPos = ["16279.1,10048.8"];
totalAI = [3];
guards = [1,grpNull,_spawnPos,objNull,0] call DZAI_setup_AI;
 
is this a trigger block that I could edit to have that happen ?
although .. I dont fully understand how to edit this ...

_this = createTrigger ["EmptyDetector", [11734.696, 781.97327, 6.7572432]]; -- locations of world space
_this setTriggerArea [600, 600, 0, false]; -- trigger area
_this setTriggerActivation ["ANY", "PRESENT", true]; -- not sure about this line
_this setTriggerTimeout [10, 15, 20, true]; -- trigger time outs ?? whats these?
_this setTriggerText "Blato"; -- city..
_this setTriggerStatements ["{isPlayer _x} count thisList > 0;", "nul = [1,1,250,thisTrigger,[],1,2] call fnc_spawnBandits;", "nul = [thisTrigger] spawn fnc_despawnBandits;"]; - what is going on here at this statement ???
_trigger_0 = _this;
 
illusions, the process is pretty good documented in the files ...\DZAI\init\world_map_configs\custom_markers\cust_markers_tavi.sqf and ...\DZAI\init\world_map_configs\custom_spawns\cust_spawns_tavi.sqf

...\DZAI\init\world_map_configs\custom_markers\cust_markers_tavi.sqf
Code:
_this = createMarker ["dzaicustomspawntest", [6650.9883, 9411.541, -6.1035156e-005]];
_this setMarkerShape "ELLIPSE";
_this setMarkerType "Flag";
_this setMarkerBrush "Solid";
_this setMarkerSize [200, 200];
_this setMarkerAlpha 0;
_dzaicustomspawntest = _this;        //_dzaicustomspawntest must be a unique name
You put the area where AI is to spawn here. Coordinates and area-size are self explaining.


...\DZAI\init\world_map_configs\custom_spawns\cust_spawns_tavi.sqf
Code:
[
        "dzaicustomspawntest",    //This is the marker name to be used as the patrol and spawning area.
        2,                         //This trigger will spawn a group of 2 AI units.
        1,                        //AI spawned by this trigger will have Weapon Grade level 1 (see below for explanation of Weapon Grade)
        true                    //(OPTIONAL) Respawn setting. True: AI spawned will respawn. False: AI will not respawn. See more here: http://opendayz.net/threads/release-dzai-lite-dynamic-ai-package.11116/page-28#post-79148
    ] call DZAI_spawn;
Configuration of the units to spawn. Every single line is very good explained. Works good for me.
 
I read this ( a few times over), I didnt understand the 2nd block mainly because I thought I was missing something .. I been looking at the block of code I posted in my second post above thinking I needed something like that ! funny how you can over complicate something someone made so easy to do.. and its right in front of my face ! DUH !!

Does it need to be broke down like above ( line by line ) or one line ? does that matter ?

Thanks JCrowley ..
 
I'm having a little troubles with this .. even as simple as it seems to be.. but I have follow the instructions to the letter, So I think.
Would you mind looking over a couple blocks I made..


one of my markers - which are all the same as the example, but the loactions -
cust_markers_tavi.sqf
Code:
   _this = createMarker ["N_airfield", [9981.6914, 18889.42]];
    _this setMarkerShape "ELLIPSE";
    _this setMarkerType "Flag";
    _this setMarkerBrush  "Solid";
    _this setMarkerSize [200, 200];
    _this setMarkerAlpha 0;
    _ N_airfield = _this;

this would be the spawn that relates to the above marker ..
cust_spawns_tavi.sqf
Code:
[
        "N_airfield",    //This is the marker name to be used as the patrol and spawning area.
        4,                         //This trigger will spawn a group of 2 AI units.
        1,                        //AI spawned by this trigger will have Weapon Grade level 1 (see below for explanation of Weapon Grade)
        true                    //(OPTIONAL) Respawn setting. True: AI spawned will respawn. False: AI will not respawn. See more here:     http://opendayz.net/threads/release-dzai-lite-dynamic-ai-package.11116/page-28#post-79148
    ] call DZAI_spawn;

the only other thing I changed in the DZAI file after it worked on default settings..

dzai_config.sqf
Code:
//Enable or disable static AI spawns. If enabled, AI spawn points will be generated in cities, towns, and other predefined areas. Does not affect custom-defined spawns (Default: true).
DZAI_staticAI = False;

but this states - Does not affect custom-defined spawns -

My goal here is to only have AI at military and airfields for now.

any suggestions ?
 
In your cust_markers file you left a space in your last line. It may cause a serious enough error that the server stops reading the spawn config from that point onwards.
 
the one I put one the server looks like this ,,

_ N_airfield=_this;

sorry, I retyped it with the space above, this time I copied and pasted like I should have done ..
 
Enable DZAI_debugLevel = 1 in your dzai_config.sqf to enable debug output in your server logs. You should see a line during server startup that says something beginning with:

Code:
DZAI Debug: Created custom spawn area...

If you've set everything up there should be no error messages.
 
Ok, Im still having some troubles here with AI custom spawns ... DZAI script works great on defaults..
Ive got the debug turned on and have been studying the errors I am getting, but I just cant fully narrow down whats its referring to in the line.

here are the first marker/spawn point from my files ..

cust_markers_tavi.sqf
Code:
 _this=createMarker ["N_airfield",[9981.6914, 18889.42]];
    _this setMarkerShape "ELLIPSE";
    _this setMarkerType "Flag";
    _this setMarkerBrush "Solid";
    _this setMarkerSize [200,200];
    _this setMarkerAlpha 0;
    _ N_airfield=_this;

cust_spawns_tavi.sqf
Code:
[
        "N_airfield",    //This is the marker name to be used as the patrol and spawning area.
        4,                         //This trigger will spawn a group of 2 AI units.
        1,                        //AI spawned by this trigger will have Weapon Grade level 1 (see below for explanation of Weapon Grade)
        true                    //(OPTIONAL) Respawn setting. True: AI spawned will respawn. False: AI will not respawn. See more here: http://opendayz.net/threads/release-dzai-lite-dynamic-ai-package.11116/page-28#post-79148
    ] call DZAI_spawn;

now, from my RPT logs ..
............................................................
18:03:29 "Initializing DZAI version 1.9.1.2"
18:03:29 "[DZAI] Reading DZAI configuration file."
18:03:29 "[DZAI] DZAI configuration file loaded."
18:03:29 "[DZAI] Compiling DZAI functions."
18:03:30 "[DZAI] Base classname tables loaded."
18:03:30 "DZAI Debug: Detected mod variant dayz."
18:03:30 "[DZAI] Server is running map tavi. Loading static trigger and classname configs."
18:03:30 "Taviana classnames loaded."
18:03:30 "[DZAI] AI to zombie hostility is enabled."
18:03:30 "[DZAI] Zombie hostility to AI is disabled."
18:03:30 "[DZAI] DZAI settings: Debug Level: 2. DebugMarkers: 2. ModName: . DZAI_dynamicWeaponList: true. VerifyTables: true."
18:03:30 Error in expression <ze [200,200];
_this setMarkerAlpha 0;
_ N_airfield=_this;

_this = createMarke>
18:03:30 Error position: <N_airfield=_this;

_this = createMarke>
18:03:30 Error Missing ;
18:03:30 File z\addons\dayz_server\DZAI\init\world_map_configs\custom_markers\cust_markers_tavi.sqf, line 35

......................................................................

I see the area where the troubles are .. but I dont know whats wrong here
line 35 states .. _ N_airfield=_this;

can I get some direction on a fix for this ?
 
Back
Top