Jump to content
Sign in to follow this  
silola

Dynamic-AI-Creator (DAC) V3.0 released

Recommended Posts

Allo.

Working on a mission with DAC in mind, (as usual)

I have a couple questions.

One : How do I set the DAC zone to turn off when not in use, and re-generate when units re-enter the zone?

How I currently have that set up.

(Center refers to the game logic placed at the same grid as the trigger)

Condition : Player distance Z1_Center < 4000

OnAct : fun = ["z1",[1,1,0],[11,4,100,20],[],[ ],[3,2,50,0,100,999],[0,11,1,11,1]] spawn DAC_Zone;[Z1] call DAC_activate

OnDea : [Z1] call DAC_Deactivate

Share this post


Link to post
Share on other sites
Hi!

I've been using DAC for a while now, suddenly the AI only gets assigned one WP and stops at that one WP.

I've tried different factions, behaviour. Disabled mods you name it...

Has anybody else encountered this? And if so how did you solve it?

Haven't run into this problem before.. make sure in your zone that there are at least 4-5 waypoints generated (ie: dont set it to just 2 wp)

Allo.

One : How do I set the DAC zone to turn off when not in use, and re-generate when units re-enter the zone?

How I currently have that set up.

(Center refers to the game logic placed at the same grid as the trigger)

Condition : Player distance Z1_Center < 4000

OnAct : fun = ["z1",[1,1,0],[11,4,100,20],[],[ ],[3,2,50,0,100,999],[0,11,1,11,1]] spawn DAC_Zone;[Z1] call DAC_activate

OnDea : [Z1] call DAC_Deactivate

I think you should lose the activation line at the end:

OnAct : fun = ["z1",[1,1,0],[11,4,100,20],[],[ ],[3,2,50,0,100,999],[0,11,1,11,1]] spawn DAC_Zone;

There is no need to create the zone de-activated then immediately re-activate it unless I am missing something?

Also you should use a separate repeating trigger for the unit detection and put [Z1] call DAC_activate in the OnAct field.. [Z1] call DAC_deactivate in the deactivation field

**Actually I'm pretty sure that when DAC deactivates an already activated zone it will create new units instead of bringing back the existing ones.. ie: you have 11 groups spawning in.. you kill 4 groups then the zone deactivates due to leaving area.. then unit re-enters zone DAC will re-create the 11 groups instead of 7

I don't have the manual in front of me but I'm pretty sure this is how it works.

Share this post


Link to post
Share on other sites

OnAct : fun = ["z1",[1,1,0],[11,4,100,20],[],[ ],[3,2,50,0,100,999],[0,11,1,11,1]] spawn DAC_Zone;

There is no need to create the zone de-activated then immediately re-activate it unless I am missing something?

Also you should use a separate repeating trigger for the unit detection and put [Z1] call DAC_activate in the OnAct field.. [Z1] call DAC_deactivate in the deactivation field

**Actually I'm pretty sure that when DAC deactivates an already activated zone it will create new units instead of bringing back the existing ones.. ie: you have 11 groups spawning in.. you kill 4 groups then the zone deactivates due to leaving area.. then unit re-enters zone DAC will re-create the 11 groups instead of 7

I don't have the manual in front of me but I'm pretty sure this is how it works.

Thats my goal, is so when the zone is depleted of enemies and you leave it, they all return fresh and new.

The Activate/Deactivate thing was going to be my solution to that.

Share this post


Link to post
Share on other sites

I see now.. OK so just use another trigger for activation, de-activation and set the DAC zone to start de-activated. I've only had one coffee this morning but it should work :p

Share this post


Link to post
Share on other sites

I'm having some problems creating, deactivating then reactivating zones......units appear in other zones, wp appear in other zones plus other errors.

anyway I'm chasing these errors today and found this one in \DAC\Scripts\DAC_Add_Group.sqf

line 19

{{DAC_East_Units set [count DAC_East_Units_x]} should be

{{DAC_East_Units set [count DAC_East_Units,_x]}

DAC\Scripts\DAC_Hint_Sectors.sqf

line 13

_status = 0;_text1 = "",_text2 = "",_text3 = "";_hint = ""; should be

_status = 0;_text1 = "";_text2 = "";_text3 = "";_hint = "";

\DAC\Scripts\DAC_Init_Waypoint.sqf and \DAC\Scripts\DAC_Insert_Waypoint.sqf and \DAC\Scripts\DAC_New_Waypoints.sqf

line 23

_DAC_WP_Typ = _this select 0;_wpConfig = [];_checkResol = 90;_tempList = [];_DAC_EnemyZone = objNull;_rx = 0, should be

_DAC_WP_Typ = _this select 0;_wpConfig = [];_checkResol = 90;_tempList = [];_DAC_EnemyZone = objNull;_rx = 0;

Edited by Squ33z3

Share this post


Link to post
Share on other sites

Any way to stop the AI from deleting units in the group? Performance won't be an issue and the AI rarely return to full strength in time for the engagement type we're expecting.

Thanks

Share this post


Link to post
Share on other sites
Any way to stop the AI from deleting units in the group? Performance won't be an issue and the AI rarely return to full strength in time for the engagement type we're expecting.

Thanks

By deleting do you mean reducing (in order to be built up again later)? If so then in DAC_Config_creator.sqf you set the THIRD PARAMETER in DAC_Reduce_Value to 0. So it reads like:

DAC_Reduce_Value = [2000,2050,0]

Share this post


Link to post
Share on other sites

*I have a large mission where the objectives are static (opposed to progressive). The DAC creates ~130 groups & ~500 units. I want to strictly rely on the squad reducer as a performance saver, which has proven very effective. Anyhow, creating this much WPs & groups takes some time. Is there any variable assigned a value, after all groups and wps have been created? I would like there to be a black screen with some text like "Initializing The DAC... (This may take up to 2minutes)", when DAC is creating groups & wps. Until it's done ofcourse, then players are free to proceed with the mission. How would I accomplish sucha task?

*I would like to have a constant patrol helo. When the DAc created helo(s) in any given dac zone are dead, I want to initialize that zone again, to keep helo patrols constant. How would I do this?

Share this post


Link to post
Share on other sites
*I have a large mission where the objectives are static (opposed to progressive). The DAC creates ~130 groups & ~500 units. I want to strictly rely on the squad reducer as a performance saver, which has proven very effective. Anyhow, creating this much WPs & groups takes some time. Is there any variable assigned a value, after all groups and wps have been created? I would like there to be a black screen with some text like "Initializing The DAC... (This may take up to 2minutes)", when DAC is creating groups & wps. Until it's done ofcourse, then players are free to proceed with the mission. How would I accomplish sucha task?

There are several things you can do. You can give the player something to do for a couple of minutes, which will not only allow for zone buildup but will also allow some time for that zone to become more complex than it's initial starting point (by allowing time for zone patrols to be underway for example). In mine I often have a helo fly in, pick me up, and drop me off at the starting point, this lasts about 3 or 4 minutes and things are generally well underway by then.

Or, you could drop a couple of ammo crates around the place, give the player some illusion of getting prepared :)

In the file DAC_Config_Creator.sqf you can set the array DAC_Com_Values = [0,2,0], which will display initialisation details.

And, in the same file, you can set DAC_Fast_Init = true which will have almost the same effect as your black screen idea: it will reduce the drawing distance to minimum, and also increase the fog to maximum, in order to allocate as much resources to the DAC initialisation as possible. Only works in SP though.

Share this post


Link to post
Share on other sites

If you want to do it specifically for a black screen until DAC is finished init use waituntil {(DAC_Basic_Value > 0)}

Something like

make_screen_black_code;
disableUserInput true;

waituntil {(DAC_Basic_Value > 0)};

disableUserInput false;
fade_in_code;

disableUserInput so players don't shoot the guy in front of them at the start point :p

And, in the same file, you can set DAC_Fast_Init = true which will have almost the same effect as your black screen idea: it will reduce the drawing distance to minimum, and also increase the fog to maximum, in order to allocate as much resources to the DAC initialisation as possible. Only works in SP though.

Just tried this - great for testing missions thx!!

Edited by SavageCDN

Share this post


Link to post
Share on other sites
By deleting do you mean reducing (in order to be built up again later)? If so then in DAC_Config_creator.sqf you set the THIRD PARAMETER in DAC_Reduce_Value to 0. So it reads like:

DAC_Reduce_Value = [2000,2050,0]

Thank you very much. So I just plop this on the Config, and this will stop the AI from Shooting each other to reduce group size?

Share this post


Link to post
Share on other sites
Thank you very much. So I just plop this on the Config, and this will stop the AI from Shooting each other to reduce group size?

Hmm.. if the AI are shooting each other it's not to keep the group size down :) There must be another problem (most likely a side setting that is incorrect ie: you are spawning Russians but the side setting is set to West)

What DMarkwick was referring to was DAC_Reduce_Value = [2000,2050,0] which reduces an AI group down to just the leader if there is no player unit closer than 2000m. Setting the third value to zero disables this feature.

Unless I'm mis-understanding your question?

*I would like to have a constant patrol helo. When the DAc created helo(s) in any given dac zone are dead, I want to initialize that zone again, to keep helo patrols constant. How would I do this?

I think the only way would be to check for when all helis are dead, delete the heli zone then re-create it

Edited by SavageCDN

Share this post


Link to post
Share on other sites
Hmm.. if the AI are shooting each other it's not to keep the group size down :) There must be another problem (most likely a side setting that is incorrect ie: you are spawning Russians but the side setting is set to West)

What DMarkwick was referring to was DAC_Reduce_Value = [2000,2050,0] which reduces an AI group down to just the leader if there is no player unit closer than 2000m. Setting the third value to zero disables this feature.

Unless I'm mis-understanding your question?

Well, what I'm trying to stop is AI targeting non-essential members of their group for "Sizing down".

And I put it in the DAC_Intern logic and it did nothing. :l

Share this post


Link to post
Share on other sites
I think the only way would be to check for when all helis are dead, delete the heli zone then re-create it

Thanks Savage.

Okay, I checked for helicopter type. I can set a variable when a helo is present. I can then deactivate the zone after no helos are present and then reactivate it. The only problem is that the new helo spawns at the same spawn location as the previous helo. I guess it's no big deal though as long as player don't catch onto it.

Here's how I did it...

*Trigger#1

-Repeatable

-Condition

{_x isKindOf "Helicopter"} count thisList > 0

-OnAct

helos=true; publicVariable "helos";

*Trigger #2

Repeatable

-condition

helos && {_x isKindOf "Helicopter"} count thisList < 1

-OnAct

[z1] call DAC_Deactivate;helos=false;publicVariable "helos"

-DeAct

[z1] call DAC_Activate

I did it several times, It seemed to work okay. I'm not sure how reliable it would be, my experience with repeatable triggers hasn't been the best . Also idk if publicVariable is nessecary either. Should I only run those triggers on the server? ie condition isServer &&... :cool:

---------- Post added at 22:51 ---------- Previous post was at 22:38 ----------

How would I be able to detect if the helos in the list are opfor and in the air. I have a friendly transport chopper and also there's one empty opfor helo that's part of my mission. So those would count as "helicopters", thus making the method above worthless to me.. to some degree

---------- Post added at 23:14 ---------- Previous post was at 22:51 ----------

Or I need to find out how to detect if a specific dac zones AI are all dead. Any idea how to do that?

Edited by Iceman77

Share this post


Link to post
Share on other sites
Well, what I'm trying to stop is AI targeting non-essential members of their group for "Sizing down".

And I put it in the DAC_Intern logic and it did nothing. :l

You might need to explain this in more detail... you want to stop the AI from shooting other members of it's own group (this should not be happening)? Or you want to stop DAC from 'reducing' group units when far away from players for performance reasons. If 2nd reason there is no way to tell DAC which units you want to be reduced from a group.. it reduces all but the leader. Once the player is close enough DAC will 'restore' the group to it's original level

Ok grabbing more coffee :)

I can then deactivate the zone after no helos are present and then reactivate it. The only problem is that the new helo spawns at the same spawn location as the previous helo. I guess it's no big deal though as long as player don't catch onto it.

Hmmmm... that might be an issue specifically with heli zones as I'm pretty sure an infantry zone would spawn the units at random waypoints. Remember too that de-activating a DAC zone keeps the existing units and waypoints for when it is re-activated while deleting and re-creating a DAC zone creates new units and waypoints.

I did it several times, It seemed to work okay. I'm not sure how reliable it would be, my experience with repeatable triggers hasn't been the best . Also idk if publicVariable is nessecary either. Should I only run those triggers on the server? ie condition isServer &&... :cool:

It looks OK to me and I don't think you would need to PV... normal DAC zones don't require this but I guess I'm not 100% sure. Also I've never actually tried repeatable triggers for activation/de-activation so it might be worth doing a quick test of that.

How would I be able to detect if the helos in the list are opfor and in the air. I have a friendly transport chopper and also there's one empty opfor helo that's part of my mission. So those would count as "helicopters", thus making the method above worthless to me.. to some degree

Hmmm... someone else might have to answer that.. some kind of side=west check with a height check but I'm not sure how to go about doing that :confused:

Or I need to find out how to detect if a specific dac zones AI are all dead. Any idea how to do that?

Pretty sure there is a way... probably a DAC variable array that the zone's units are added to at start.. but I'm not sure what that would be. I have a bunch of DAC-related notes on the home PC might have some info there.. I'll check later.

Edited by SavageCDN

Share this post


Link to post
Share on other sites

@savage - yeah I think I'd rather check for a variable only, than side, height, alive etc etc. I'll try and find the variable that is set when a dac zones generated AI are all dead.

Share this post


Link to post
Share on other sites
You might need to explain this in more detail... you want to stop the AI from shooting other members of it's own group (this should not be happening)? Or you want to stop DAC from 'reducing' group units when far away from players for performance reasons. If 2nd reason there is no way to tell DAC which units you want to be reduced from a group.. it reduces all but the leader. Once the player is close enough DAC will 'restore' the group to it's original level

Ok grabbing more coffee :)

Yes, I want the AI to stop shooting each other, please :)

Performance won't be an issue for me.

Share this post


Link to post
Share on other sites

Can you post the init line from your DAC zone? If the AI are actually shooting each other then there is a setting wrong somewhere... most likely in the last set of [] in the trigger init. You might be spawning Russian units but have the 'side' variable set to West or something similar ie: [1,0,0,0]

Share this post


Link to post
Share on other sites

yup savage is more than likely correct. Make sure your setting the SIDE & FACTION correctly. It would be possible to do setg the side and then set the wrong faction (that doesnt exist for that side) ie; setting opfor side with blufor faction. For example [1,0,0,0] would try to create WEST units (1) from russian faction (0)

Share this post


Link to post
Share on other sites

That was the issue. Thank you.

How do I make Independents Hostile to BLUFOR then?

Share this post


Link to post
Share on other sites
That was the issue. Thank you.

How do I make Independents Hostile to BLUFOR then?

In the editor make sure Independents are friendly to OPFOR, then in DAC_Config_Creator.sqf:

DAC_Res_Side	= 0

(0 for East, 1 for West, 2 for IND)

Share this post


Link to post
Share on other sites
And If Im using the .PBO version, I just plop that in DAC_INTERN. Correct?

Yes you can put the DAC_Res_Side = 0 variable in the init line of DAC_INTERN (or I think you can also use another game logic.. not sure I've only started using the pbo verison recently)

If you use DAC_Extern you will need the DAC folder from \@DAC\Configs (copy paste to your mission folder) - this is the better way if you are making a LOT of changes to the default config files, but means you have to edit .sqf files instead of doing everything in the editor.

Share this post


Link to post
Share on other sites

Question (may have asked it before but ran into the problem again recently):

I can't seem to figure out something that has been bugging me for a while with DAC. Whenever I have 2 sides using DAC (east and west), and both are using respawn camps, it screws up. I can't remember if I'm also moving any DAC zones post-init but possibly.

What happens is that after a group is eliminated it will respawn at the camp... however it respawns not as it's own group but into another existing DAC group (same side). This effect snowballs and I've seen DAC groups with > 100 units in them after a while (at least that's what the DAC_Marker is showing on the map). Now I've actually confirmed that this group does not in fact have 100 units (teleport near it and visually confirm size). I assume DAC is still spawning in new groups however it is very difficult to troubleshoot with map markers that either 1: don't exist for that group or 2: aren't showing the actual # of units in that group.

Has anyone seen this before?? Please say yes or I'll think I'm losing it :p

The first few times I ran into this I assumed it was my in-experience using DAC or scripting in general but now I'm sure it's nothing I'm doing wrong...

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
Sign in to follow this  

×