Jump to content
dmarkwick

DAC3 initialisation tutorial (for DAC beginners)

Recommended Posts

So, Silola has released DAC3, and we're all excited over the possibilities and functionalities this gives us. But, the initialisation line is a little imposing for newcomers, I guess what it could do with is a step-by-step tutorial.

So I thought I would write up a tutorial/explanation for Silola's excellent DAC3 initialisation line, and try to make it as friendly as possible so that new DAC users can perhaps learn the ropes a little quicker. First off, lets look at a typical DAC zone initialisation line:

null=["z1",[1,0,0],[8,3,25,15],[5,3,20,10],[6,2,30,15],[4,1,12],[0,0,2,0]] spawn DAC_Zone

Looks pretty scary. Let's strip out the zone's name, and the code that executes the script, and replace the arrays with meaningful names:

[zone info],[infantry],[unarmed vehicles],[armed vehicles],[helo units],[AI side setup]

in fact, lets reduce it down to one single element of the initialisation:

[infantry] which contains the numbers [8,3,25,15]

Only 4 numbers. If you can understand these 4 numbers, you will understand the basics of DAC initialisation. The 4 numbers break down like this:

The number of patrols (8 patrols).

The size of these patrols (size 3).

The number of waypoints to choose from (A pool of 25 waypoints).

The number of waypoints for each patrol (15 waypoints chosen at random from the pool of 25 waypoints).

Number of patrols and size of patrols is easy to understand. The waypoint numbers mean that, for this zone, 25 patrol waypoints will be generated at random positions, and each patrol will each recieve 15 random waypoints chosen from this list. Each patrol gets a different selection.

So, if we apply that DAC element to the infantry section of the initialisation, the zone will have:

8 patrols each between 2 and 8 units each, and each patrol will have 15 random waypoints chosen from a pool of 25 waypoints. Each patrol has a different selection of waypoints.

That's already quite a complex action from a very simple 4 number array.

*************************************************************************

Next up: how to string together a formiddable force using the above easy sequence.

Part of the DAC initialisation line looks somewhat like this when viewed abstractly:

[infantry],[unarmed vehicles],[armed vehicles],[helo units]

and applying the first post's logic to each part would give you something like this:

[8,3,25,15],[5,3,20,10],[6,2,30,15],[4,1,12]

(helo units have one less parameter, their waypoints are always a fixed number for some reason)

So that simple sequence of numbers will give you a zone that has:

8 groups of infantry, each group consisting of 2-9 units (size 3), each group has 15 waypoints to visit taken at random from a total pool of 25 waypoints. Also 5 groups of unarmed vehicles, each with 2-9 infantry in however many vehicles it takes to carry that number, each group has 10 waypoints taken from a list of 20 possibles. Also, 6 armoured groups each with 1-2 vehicles are patrolling 15 waypoints from a list of 30 waypoints. Flying around above all this are 4 helicopters each containing 2-4 troops, flying at random between 12 waypoints.

Now that's some complex action going on for very little working out IMO.

**************************************************************************

Next up: further zone initialisation.

so we have something that looks like this:

[infantry],[unarmed vehicles],[armed vehicles],[helo units]

and we need to add two more sequences that define zone activity and unit makeup, which we add to the beginning and end respectively:

[zone activity],[infantry],[unarmed vehicles],[armed vehicles],[helo units],[unit makeup]

Zone activity is reasonably simple to understand, the first number simply links zones so that those zones will share waypoints. Let me explain:

if 2 zones each have "1" as this value, they will share waypoints and units can travel from one zone to another because this number is the same in each zone. If however there is a third zone and it has a "2" for this value, it is not the same number so it will not share it's waypoints with the others.The other numbers in this sequence are not important just yet. They control when the zone becomes active, right now we want the zones active immediately so we'll ignore them.

A typical zone activity sequence looks like this:

[1,0,0]

indicating that it belongs in the "1" club, and any other zones who are also in the "1" club will share waypoints. We'll ignore the other two numbers for now, just leave them both at 0, they concern whether the zone is active and what extra processing we might include. We'll keep it simple for now.

Unit makeup is the easiest to understand (as well as the most exciting), it's simply a list of 4 numbers that define:

the side (east west etc),

the type of units used,

the behavior of these units,

and the type of camp for this zone (which we are not concerned with just now).

DAC has lists of units already for you to choose from (DAC_Config_Units.sqf), and the best thing is you can make your own up. Yep, fancy UK forces wandering around the island? Simply gather the unit names into a list, add this list to the end and give it a new number (as I type this a new list would be number 9) and use that number in the sequence. It's the same for the behavior, there's lists of behaviors for units to follow and again you can write your own. There's 3 to choose from right now, and the behavior controls things like different awarenesses (cycles between a list), different formations (list again), pauses at waypoints, shouts used etc. All used along the patrols, this is why you sometimes see some groups walking with guns slung, some running.

So a typical unit makeup sequence would look like this:

[0,0,2,0]

which in this case breaks down to:

Eastern side, (0=east, 1=west, 2=res, 3=civ)

troops include:

"RU_Soldier_Crew","RU_Soldier_Pilot","RU_Soldier_SL","RU_Soldier","RU_Soldier_GL","RU_Soldier_MG","RU_Soldier2","RU_Soldier_Medic","RU_Soldier_AT","RU_Soldier_Sniper","RU_Soldier_AR","RU_Soldier_Marksman","RUS_Soldier_Sab","RUS_Soldier_Marksman"

unarmed vehicles include:

"UAZMG","UralOpen_INS","UAZ_RU","UAZ_AGS30_RU","BRDM2_INS","UAZ_MG_INS","GAZ_Vodnik_HMG","GAZ_Vodnik"

armed vehicles include:

"T72_RU","ZSU_INS","BMP3","2S6M_Tunguska","T90","BMP3","BTR90"

and helos include:

"Mi17_rockets_RU","Ka52","Mi24_V","Mi24_P"

and the bahaviour for these units in this zone is:

"careless","safe","aware","combat","stealth"

"line","vee","column","wedge","stag column","ech left","ech right"

among other attributes.

So now we have the rather imposing looking, but easily understood initialisation sequence that looks like this:

[1,0,0],[8,3,25,15],[5,3,20,10],[6,2,30,15],[4,1,12],[0,0,2,0]

giving us all the above units, activities, behaviours and makeups.

Well, that's about as simple as I can get it I guess. No doubt I could clarify it more as time goes on, if any newcomers to DAC still find something confusing, let me know and I'll either amend this 1st post or make a new one specifically. I don't wish to go into complex initialisations, just the basics, enough to get you started.

(Various edits for clarity & format etc)

Edited by DMarkwick
  • Like 2

Share this post


Link to post
Share on other sites

Thank you and of course Silola! I read a good part from the .pdf and checked out the first missions, but it was still to much for my poor little head! Now i get the logic behind it.

Share this post


Link to post
Share on other sites

Awesome job DMarkwick

@ a Moderator, requesting to make this threat sticky, to avoid hundrets of unnecessary threats.

Share this post


Link to post
Share on other sites

Thanks nice guide!

Please don't use nil for variable assignments. You'll break every function/script that uses nil/isNil, etc.

null, dummy, or numbers (0 = etc), is possible.

nil=["z1",[1,0,0],[8,3,25,15],[5,3,20,10],[6,2,30,15],[4,1,12],[0,0,2,0]] spawn DAC_Zone

Share this post


Link to post
Share on other sites

Hi :)

Please don't use nil for variable assignments. You'll break every function/script that uses nil/isNil, etc.

null, dummy, or numbers (0 = etc), is possible.

That's no a mistake by DMarkwick, but my mistake :D

Thanks DMarkwick for support :)

Greeting

Silola

Share this post


Link to post
Share on other sites
Thanks nice guide!

Please don't use nil for variable assignments. You'll break every function/script that uses nil/isNil, etc.

null, dummy, or numbers (0 = etc), is possible.

Fixed it.

Share this post


Link to post
Share on other sites
Hi :)

That's no a mistake by DMarkwick, but my mistake :D

Thanks DMarkwick for support :)

Greeting

Silola

*Kicks Silola behind the ass* :) :D

Share this post


Link to post
Share on other sites

Not sure what I'm doing wrong, but I've extracted the files into the /Addons folders and for some reason there is no "DAC" class for Game Logic. I'm running arma verson 1.05.

---------- Post added at 06:41 PM ---------- Previous post was at 05:50 PM ----------

Anyone have an idea? I would really like to utilize this lol.

---------- Post added at 08:24 PM ---------- Previous post was at 06:41 PM ----------

I've tried everything, never had any problems with other mods. Like I said when I'm in the editor and I add a Game Logic unit, there is no DAC option under the Game Logic drop menus as shown in the read me.

Share this post


Link to post
Share on other sites
Not sure what I'm doing wrong, but I've extracted the files into the /Addons folders and for some reason there is no "DAC" class for Game Logic. I'm running arma verson 1.05.

---------- Post added at 06:41 PM ---------- Previous post was at 05:50 PM ----------

Anyone have an idea? I would really like to utilize this lol.

---------- Post added at 08:24 PM ---------- Previous post was at 06:41 PM ----------

I've tried everything, never had any problems with other mods. Like I said when I'm in the editor and I add a Game Logic unit, there is no DAC option under the Game Logic drop menus as shown in the read me.

For troubleshooting of the DAC itself (which is not my work ;)) better to go to this thread.

Share this post


Link to post
Share on other sites

@DMarkwick

Thanks for this thread. Great idea getting the uninitiated on board... More fun for the new guys -PLUS-

More DAC visibility = more dynamic missions for everyone. :)

Share this post


Link to post
Share on other sites

Hope your gunnu do a 2nd post covering some of the other stuff in the user manual - like the camps and object spawning. Good stuff!

Share this post


Link to post
Share on other sites

Well I wasn't planning to, all that stuff is pretty easy to figure out once you've got a basic understanding. As ever, it's always the very fist step that's the most difficult.

Share this post


Link to post
Share on other sites

Any DAC made famous missions out there that I can dissect to understand further how mission designers use DAC for?

Share this post


Link to post
Share on other sites

Sorry to raise an old thread, but I'm trying to figure out how to put a zone on "Stand by" as it says in the read me, And activate it by a condition, like Bluefor present. It's only mentioned that it can be done, but not how. Help?

Share this post


Link to post
Share on other sites

Set the trigger's condition field to "this", and select your desired trigger Activation from the drop-down list, would be the easiest way to do it.

Share this post


Link to post
Share on other sites
Set the trigger's condition field to "this", and select your desired trigger Activation from the drop-down list, would be the easiest way to do it.

Thanks for the reply. Yeah I tried that. It works for the first zone, but the next one won't initialize when entered under the same conditions.

Share this post


Link to post
Share on other sites

It's not something basic like you copy & pasted the zone trigger, but didn't double-check the zone name is it? ;)

Share this post


Link to post
Share on other sites
It's not something basic like you copy & pasted the zone trigger, but didn't double-check the zone name is it? ;)

Nope, But I checked several times lol. Either trigger will function only if it's triggered first. I have the following

1st trigger

Named: z1

blurfor

Once

Present

Condition field: this

Activation field: fun = ["z1",[1,0,0],[3,3,20,6],[],[],[],[0,0,0,0,1]] spawn DAC_Zone

2nd Trigger

Named z2

blurfor

Once

Present

Condition field: this

Activation field: fun = ["z2",[1,0,0],[3,3,20,6],[],[],[],[0,0,0,0,1]] spawn DAC_Zone

Share this post


Link to post
Share on other sites

Named z2

Gamelogic

Repeatedly

Present

Condition field: time > 1

Activation field: fun = ["z2",[1,1,0],[3,3,20,6],[],[],[],[0,0,0,0,1]] spawn DAC_Zone

The red 1 in the activation field will make the zone not spawn any units. Then use

[z2] call DAC_Activate

in a trigger or something to activate the zone, you can also use

[z1] call DAC_Deactivate

to turn off a zone, if you want to activate or deactivate multiple zones use [z1,z2,z3] DAC_Activate.

Share this post


Link to post
Share on other sites
Named z2

Gamelogic

Repeatedly

Present

Condition field: time > 1

Activation field: fun = ["z2",[1,1,0],[3,3,20,6],[],[],[],[0,0,0,0,1]] spawn DAC_Zone

The red 1 in the activation field will make the zone not spawn any units. Then use

[z2] call DAC_Activate

in a trigger or something to activate the zone, you can also use

[z1] call DAC_Deactivate

to turn off a zone, if you want to activate or deactivate multiple zones use [z1,z2,z3] DAC_Activate.

Ahh GOT IT ! Works like a charm ! Thanks sooo much !

Edited by strike0277

Share this post


Link to post
Share on other sites

Thanks for this DMarkwick. I messed around with DAC awhile back and really got nowhere. I'll read this thread and give it another try. :)

Share this post


Link to post
Share on other sites

this is a great useful tut. one question, is it possible to halt all action/units until all waypoints and units are generated? for example if i have a bunch of normal blufor units attacking dac space how can i make everything wait until all dac processing is complete?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×