Custom Land Vehicles Spawn

Donzap

New Member
Hi guys, I have a military base in NWAF with DZAI working fine spawning AI on foot. They protect the base pretty well, but since some players go there with an armored vehicle and get the stuff and leave, I want to add a vehicle patrol with an armored SUV to make things a little bit harder, so my players don't get bored too soon.

I have tried the same way I added AI on foot, that is, adding a custom spawn marker in cust_markers_chernarus.sqf:

Code:
// NWAF Patrulla en coche
    _this = createMarker ["cochenwaf", [4395.54, 10503.4, 0]];
    _this setMarkerShape "ELLIPSE";
    _this setMarkerType "Empty";
    _this setMarkerBrush "Solid";
    _this setMarkerSize [200, 200];
    _this setMarkerAlpha 0;
    _cochenwaf = _this;        //_cochenwaf must be a unique name

And then Spawn a SUV unit in cust_spawns_chernarus.sqf:
Code:
// NWAF Patrulla en coche
    [
        "cochenwaf",     //This is the marker name to be used as the patrol and spawning area.
        "ArmoredSUV_PMC_DZ",    //Insert a vehicle classname here. Acceptable vehicle types: Air or Land vehicles. Spawn will be cancelled if classname is invalid or banned.
        [3,1],                    //Set number of passenger and gunner units here. A driver unit will always be created. DZAI will not add more units to a vehicle than the vehicle type allows. Only land vehicles may have passenger units.
        2,                        //Weapon grade setting. 1 = weapon chosen from Military loot table (see below for explanation of Weapon Grade)
        true,                    //(OPTIONAL)* Respawn setting. True: AI will respawn with vehicle after a specified time. False: AI and vehicle will not respawn after being destroyed. (Default)
        900                        //(OPTIONAL)* Respawn time. Number of seconds to wait until AI and vehicle are respawned. (Default: 600). Timer begins after AI group is wiped out or vehicle is destroyed, whichever comes first.
    ] call DZAI_spawn_vehicle;

I have added "ArmoredSUV_PMC_DZ" to dynamic_vehicle.sqf in my server mission folder.

But no SUV in NWAF appeared, so I change dzai_config.sqf to add 1 maxlandpatrol (I thoung this setting was only for random spawn, that's why I have not used until now) and added an armored SUV to "stock":
Code:
DZAI_maxLandPatrols = 1;
DZAI_vehList = [["ArmoredSUV_PMC_DZ",1]];

Now I have a random spawn armored SUV driving between cities, but no SUV on NWAF.
In my arma2oaserver.RPT I have the spawing of every AI working except NWAF SUV, not showing at all "cochenwaf" marker in it.

What am I doing wrong? Did I miss something?

Thank you everyone.
 
look at your code...
cochenwaf in your spawn vehicle script
is not the same as
_cochenwaf = _this
defined in your markers

.... notice the underscore?
The last line in your marker (_cochenwaf) is the global variable to refer to your marker. LOCAL variables have an underscore, global variables do not. So remove the underscore from your marker definition so that the spawn scripts will be able to recognize the marker location.
Code:
// NWAF Patrulla en coche
    _this = createMarker ["cochenwaf", [4395.54, 10503.4, 0]];
    _this setMarkerShape "ELLIPSE";
    _this setMarkerType "Empty";
    _this setMarkerBrush "Solid";
    _this setMarkerSize [200, 200];
    _this setMarkerAlpha 0;
    cochenwaf = _this;        //_cochenwaf must be a unique name
 
I have just tried, but doesn't work.
The other markers and spawns are with the underscore and are working properly.
The example included in DZAI script has it also.

Any other idea?
 
Test it by creating a vehicle at a spawn location that you know works with infantry. Then you can tell if its your marker location or the vehicle spawn script.


I am a sarge fan and dont use dzai so I dont know about the config settings specific to dzai.

If nobody answers I can look into it when I get home
 
Try to add another vehicle instead or an Armoured suv, also shouldnt it be ArmouredSUV_PMC_DZ not ArmoredSUV_PMC_DZ.
 
According to the epoch github its armored .. https://github.com/vbawol/DayZ-Epoch/search?utf8=✓&q=ArmoredSUV_PMC_DZ
and according to the example in Sheeps Epoch Repack line 20 in custom spawns chernarus
Code:
[
        "dzaicustomspawntest",    //This is the marker name to be used as the patrol and spawning area.
        "ArmoredSUV_PMC_DZ",    //Insert a vehicle classname here. Acceptable vehicle types: Air or Land vehicles. Spawn will be cancelled if classname is invalid or banned.

Donzap, you are apparently correct in your assumption about DZAI_maxlandpatrols being for the randomly created vehicles ... thats what this code does,
if ((DZAI_maxHeliPatrols > 0) or {(DZAI_maxLandPatrols > 0)}) then {
"DZAI_centerMarker" setMarkerPos [7652.9634, 7870.8076];
"DZAI_centerMarker" setMarkerSize [5500, 5500];

I am reasonably sure that if you define a marker and name it with an underscore _variablename, that markername will not be visible to other scripts such as the one that actually spawns the vehicles. You must use a markername without an underscore so its a global variable.
Other than that, all your code looks correct. So if you want to upload your mission files so we can look at the complete package ...
 
Test it by creating a vehicle at a spawn location that you know works with infantry. Then you can tell if its your marker location or the vehicle spawn script.


I am a sarge fan and dont use dzai so I dont know about the config settings specific to dzai.

If nobody answers I can look into it when I get home

Good Idea!!!
I will test that first.

About SUV, I will test with another vehicle, just in case... but I'm 100% sure is ok.

Thx guys!
 
Just to check, is the following line in the bottom of your cust_spawns_chernarus.sqf? It must be the only thing at the end of the file.

Code:
//----------------------------Do not edit anything below this line -----------------------------------------
DZAI_customSpawnsReady = true;

If this line is absent, or it is not the last line, it will prevent custom vehicle spawns from being created properly. Other than that, I don't have any useful suggestions at this time and I can't tell anything wrong with the given information.
 
Just to check, is the following line in the bottom of your cust_spawns_chernarus.sqf? It must be the only thing at the end of the file.

Code:
//----------------------------Do not edit anything below this line -----------------------------------------
DZAI_customSpawnsReady = true;

If this line is absent, or it is not the last line, it will prevent custom vehicle spawns from being created properly. Other than that, I don't have any useful suggestions at this time and I can't tell anything wrong with the given information.

That was my problem!!! All that part was missing.
My fault, I used the old custom markers and spawns files, so were not complete for the new DZAI version.

Thank you very much!
 
@Donzap : That's great to hear. In a future update I'll move the DZAI_customSpawnsReady line to another file outside of the cust_spawns_(etc) file to make things less error-prone.
 
Back
Top