Jump to content
silola

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

Recommended Posts

Hey Silola,

 

any fix for the dynamic weather problem??

Share this post


Link to post
Share on other sites

i cannot seem to figure out how to get all spawned dac groups to converge on one spot?  here is my master zone:              

 

 fun=["z1",[1,0,0],[2,2,10,1],[],[],[],[0,0,0,0,1]] spawn DAC_Zone  

 

and here are my other zones for an example:  

 

 fun=["z5",[1,0,0],[2,2,10,1],[],[],[],[0,0,0,1,1]] spawn DAC_Zone

 

what do i have to change to get all my zones to attack my position on the map?  this is a wave attack mission on a base.

You have to force them to leave their spawning zone. Last arg in second array = 0 instead of 1.

fun=["z1",[1,0,0],[2,2,10,0],[],[],[],[0,0,0,0,1]] spawn DAC_Zone  

You need to offer them zones where they can go. -> You can make the other zones as waypoint zones only, i.e. no spawns in there, like:

fun=["z5",[1,0,0],[20],[],[],[],[0,0,0,1,1]] spawn DAC_Zone

BTW, related: I wrote a script for myself where a zone follows the player, you can put the code into editor modules. It's nice for helicopter aproaching player sometimes...

comment "zone, [sizemin, sizemax], [changeMinutes,sizeFactor,sizeFactorAfterMinutes], [probDo, probOff, probWayOff(if Off)]";

0 = [z4, [1500, 2500], [5, 0.5, 30], [0.9, 0.6, 0.3]] spawn
{
   private ["_pos","_dir","_dist","_overland", "_min", "_max", "_size1", "_size2", "_sleep", "_factor", "_currentFactor", "_shrinkTime"];
   tortdoit = true;
   _sleep = (_this select 2 select 0) * 60;
   _shrinkTime = (_this select 2 select 2) * 60;
   _factor = 1 - (_this select 2 select 1);
   sleep (random [0.75 * _sleep, _sleep, _sleep]);
   _min = _this select 1 select 0; _max = _this select 1 select 1;
   if (_min == 0) then {_min = 0.05 * worldsize};
   if (_max == 0) then {_max = 0.1 * worldsize};
   while{tortdoit} do
   {
      _overland=false; _pos = position player;
      if((random 1)<(_this select 3 select 0)) then
      {
         _currentFactor = 1 - _factor*((time min _shrinkTime)/_shrinkTime);
         _size1 = (_min + random(_max - _min)) * _currentFactor;
         _size2 = (_min + random(_max - _min)) * _currentFactor;
         if((random 1)<(_this select 3 select 1)) then
         {
            if((random 1)>(_this select 3 select 2)) then
            {
               _dir = random 360;
               _dist = random [0,_min,_max];

               _pos = [(_pos select 0) + cos _dir * _dist, (_pos select 1) - sin _dir * _dist, 0];
            }
            else
            {
               while {!_overland} do {
                  _pos = [random worldsize, random worldsize, 0];
                  _overland = !(_pos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []);
                  sleep 0.02;
               };
            };
         }
         else
         {
            _pos = position player;
         };
         [_this select 0, _pos, [_size1, _size2, random 360],0,0,0] call DAC_fChangeZone;
      };
   sleep (random [0.75 * _sleep, _sleep, 2 * _sleep]);
   };
};

Share this post


Link to post
Share on other sites

I'm having a hard time with creation and changing of zone mid mission. DAC is loaded via mod and of course dac_intern is placed.

1. I have placed a game logic, which basically does this mid game, creation of zone: 

_zoneDetails = ["z1",[1,0,0],[5,1,100,20],[],[],[],[0,0,0,0]];
[_pos, _size1, _size2, 0, random 360, _zoneDetails] call DAC_fNewZone;

- Nothing happens if I did not spawn another zone via a trigger in editor before. Also, my script does not continue, like as if the call DAC_fnewzone does not return...

2. If I spawned a zone before, it is also able to create one mid game. So after it created the above z1 zone midgame, I cannot change the z1 zone by any means. It always complains: Error dac_change_zone: No valid zone.

[z1, _pos, [_size1, _size2, random 360],0,0,0] call DAC_fChangeZone;

z1 (object?) and "z1" string may be a thing here, but I think I tried all possibilities.

Any ideas?

Share this post


Link to post
Share on other sites

OK, I made it working, but it is necessary to spawn at least a deactivated waypoint zone via the normal trigger mechanism.

 

This is how I spawn a zone, which creates infantry and follows player... more or less.

 

0 = [[1,0,0], [round(5 + random 2),1,100,20], [], [], [], [0,0,0,0]] spawn
{
   private _zoneMinSize = 2000;
   private _zoneMaxSize = 4000;
   private _sleepMinutes = 5;
   private _shrinkTimeMinutes = 60;
   private _shrinkFactor = 1;
   private _zoneChangeProb = 0.95;
   private _zoneOffProb = 0.5;
   private _zoneWayOffProb = 0.1;
 
   if (_zoneMinSize == 0) then {_zoneMinSize = 0.05 * worldsize};
   if (_zoneMaxSize == 0) then {_zoneMaxSize = 0.1 * worldsize};
 
   private ["_pos","_dir","_dist","_overland", "_size1", "_size2", "_currentFactor"];
   private _zoneDetails = ["fzone47", _this select 0, _this select 1, _this select 2, _this select 3, _this select 4, _this select 5];
 
   sleep (random [30, 30, 90]);
 
   _shrinkFactor = 1 - _shrinkFactor;
   private _init = true;
   tortdoit = true;
 
   waituntil {alive player};
   while{tortdoit} do
   {
      _overland=false; _pos = position player;
      if((random 1) < _zoneChangeProb) then
      {
         _currentFactor = 1 - _shrinkFactor *((time min (60*_shrinkTimeMinutes))/(60*_shrinkTimeMinutes));
         _size1 = (_zoneMinSize + random(_zoneMaxSize - _zoneMinSize)) * _currentFactor;
         _size2 = (_zoneMinSize + random(_zoneMaxSize - _zoneMinSize)) * _currentFactor;
         if((random 1) < _zoneOffProb) then
         {
            if (((random 1) > _zoneWayOffProb) || _init) then
            {
               if ((random 1) < 0.45) then {
                  _dir = random 360;
               }
               else
               {
                  _dir = ([0,0,0] getdir (getCameraViewDirection player));
               };
               _dist = random [0, _zoneMinSize, _zoneMaxSize];
 
               _pos = [(_pos select 0) + cos _dir * _dist, (_pos select 1) - sin _dir * _dist, 0];
            }
            else
            {
               while {!_overland} do {
                  _pos = [random worldsize, random worldsize, 0];
                  _overland = !(_pos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []);
                  sleep 0.02;
               };
            };
         }
         else
         {
            _pos = position player;
         };
         if (_init) then
         {
            _init = false;
            [_pos, _size1, _size2, 0, random 360, _zoneDetails] call DAC_fNewZone;
         }
         else
         {
            [fzone47, _pos, [_size1, _size2, random 360],0,0,0] call DAC_fChangeZone;
         };
      };
   sleep (random [_sleepMinutes * 45, _sleepMinutes * 60, _sleepMinutes * 75]);
   };
};

Share this post


Link to post
Share on other sites

OK, I made it working, but it is necessary to spawn at least a deactivated waypoint zone via the normal trigger mechanism.

 

This is how I spawn a zone, which creates infantry and follows player... more or less.

 

0 = [[1,0,0], [round(5 + random 2),1,100,20], [], [], [], [0,0,0,0]] spawn
{
   private _zoneMinSize = 2000;
   private _zoneMaxSize = 4000;
   private _sleepMinutes = 5;
   private _shrinkTimeMinutes = 60;
   private _shrinkFactor = 1;
   private _zoneChangeProb = 0.95;
   private _zoneOffProb = 0.5;
   private _zoneWayOffProb = 0.1;
 
   if (_zoneMinSize == 0) then {_zoneMinSize = 0.05 * worldsize};
   if (_zoneMaxSize == 0) then {_zoneMaxSize = 0.1 * worldsize};
 
   private ["_pos","_dir","_dist","_overland", "_size1", "_size2", "_currentFactor"];
   private _zoneDetails = ["fzone47", _this select 0, _this select 1, _this select 2, _this select 3, _this select 4, _this select 5];
 
   sleep (random [30, 30, 90]);
 
   _shrinkFactor = 1 - _shrinkFactor;
   private _init = true;
   tortdoit = true;
 
   waituntil {alive player};
   while{tortdoit} do
   {
      _overland=false; _pos = position player;
      if((random 1) < _zoneChangeProb) then
      {
         _currentFactor = 1 - _shrinkFactor *((time min (60*_shrinkTimeMinutes))/(60*_shrinkTimeMinutes));
         _size1 = (_zoneMinSize + random(_zoneMaxSize - _zoneMinSize)) * _currentFactor;
         _size2 = (_zoneMinSize + random(_zoneMaxSize - _zoneMinSize)) * _currentFactor;
         if((random 1) < _zoneOffProb) then
         {
            if (((random 1) > _zoneWayOffProb) || _init) then
            {
               if ((random 1) < 0.45) then {
                  _dir = random 360;
               }
               else
               {
                  _dir = ([0,0,0] getdir (getCameraViewDirection player));
               };
               _dist = random [0, _zoneMinSize, _zoneMaxSize];
 
               _pos = [(_pos select 0) + cos _dir * _dist, (_pos select 1) - sin _dir * _dist, 0];
            }
            else
            {
               while {!_overland} do {
                  _pos = [random worldsize, random worldsize, 0];
                  _overland = !(_pos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []);
                  sleep 0.02;
               };
            };
         }
         else
         {
            _pos = position player;
         };
         if (_init) then
         {
            _init = false;
            [_pos, _size1, _size2, 0, random 360, _zoneDetails] call DAC_fNewZone;
         }
         else
         {
            [fzone47, _pos, [_size1, _size2, random 360],0,0,0] call DAC_fChangeZone;
         };
      };
   sleep (random [_sleepMinutes * 45, _sleepMinutes * 60, _sleepMinutes * 75]);
   };
};

 

Hi,

 

have you tried also this option:

 

 

DAC_Direct_Start = false

DAC is expecting one DAC zone per default to become initiated. But if you will activate this option (true), so you can

make the DAC initializing by the DAC Logic only.

This option is needed only if you want to become DAC zones created while a running mission, or if you want

to generate objects only.

 

Silola

Share this post


Link to post
Share on other sites

have you tried also this option:

Will try, seems I overlooked the information in your docs, thanks!

Share this post


Link to post
Share on other sites

DAC_Direct_Start = true; works Now I am having another problem.

I have markers turned on. Let's say 9 groups spawn. Very quickly, groups disappear again... They despawn? Very quickly e.g. 4 were left. I wonder what that is. To my knowledge, DAC should only reduce, but not remove alive units.

 

Only dac_intern and the following script are running:

 

0 = [[1,0,0], [round(5 + random 2),1,100,20], [], [], [], [0,0,0,0]] spawn
{
   private _changeEveryMinutes = 1;
   private _zoneCreateSizeMin = 2000;
   private _zoneCreateSizeMax = 4000;
   private _zoneSizeMin = 2000;
   private _zoneSizeMax = 4000;
   private _zoneChangeProb = 0.95;
   private _zoneOffProb = 0.5;
   private _zoneWayOffProb = 0.1;
   private _shrinkTimeMinutes = 60;
   private _shrinkFactor = 1;
 
   if (_zoneSizeMin == 0) then {_zoneSizeMin = 0.05 * worldsize};
   if (_zoneSizeMax == 0) then {_zoneSizeMax = 0.1 * worldsize};
 
   private ["_pos","_dir","_dist","_overland", "_size1", "_size2", "_currentFactor"];
   private _zoneDetails = ["fzone47", _this select 0, _this select 1, _this select 2, _this select 3, _this select 4, _this select 5];
 
   sleep (random [30, 30, 90]);
 
   _shrinkFactor = 1 - _shrinkFactor;
   private _init = true;
   tortdoit = true;
 
   waituntil {alive player};
   while{tortdoit} do
   {
      _overland=false; _pos = position player;
      if (_init) then
      {
         _init = false;
         _pos = position player;
         _size1 = (_zoneCreateSizeMin + random(_zoneCreateSizeMax - _zoneCreateSizeMin));
         _size2 = (_zoneCreateSizeMin + random(_zoneCreateSizeMax - _zoneCreateSizeMin));
         [_pos, _size1, _size2, 0, random 360, _zoneDetails] call DAC_fNewZone;
      }
      else
      {
         if((random 1) < _zoneChangeProb) then
         {
            _currentFactor = 1 - _shrinkFactor *((time min (60*_shrinkTimeMinutes))/(60*_shrinkTimeMinutes));
            _size1 = (_zoneSizeMin + random(_zoneSizeMax - _zoneSizeMin)) * _currentFactor;
            _size2 = (_zoneSizeMin + random(_zoneSizeMax - _zoneSizeMin)) * _currentFactor;
            if((random 1) < _zoneOffProb) then
            {
               if (((random 1) > _zoneWayOffProb) || _init) then
               {
                  _dir = random [0, ([0,0,0] getdir (getCameraViewDirection player)), 360];
                  _dist = random [0, _zoneSizeMin, _zoneSizeMax];
                  _pos = [(_pos select 0) + cos _dir * _dist, (_pos select 1) - sin _dir * _dist, 0];
               }
               else
               {
                  while {!_overland} do {
                     _pos = [random worldsize, random worldsize, 0];
                     _overland = !(_pos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []);
                     sleep 0.02;
                  };
               };
            }
            else
            {
               _pos = position player;
            };
            [fzone47, _pos, [_size1, _size2, random 360],0,0,0] call DAC_fChangeZone;
         };
      };
      sleep (random [0.75 * _changeEveryMinutes * 60, _changeEveryMinutes * 60, 2 * _changeEveryMinutes * 60]);
   };
};

Share this post


Link to post
Share on other sites

DAC_Direct_Start = true; works Now I am having another problem.

I have markers turned on. Let's say 9 groups spawn. Very quickly, groups disappear again... They despawn? Very quickly e.g. 4 were left. I wonder what that is. To my knowledge, DAC should only reduce, but not remove alive units.

 

Only dac_intern and the following script are running:

 

0 = [[1,0,0], [round(5 + random 2),1,100,20], [], [], [], [0,0,0,0]] spawn
{
   private _changeEveryMinutes = 1;
   private _zoneCreateSizeMin = 2000;
   private _zoneCreateSizeMax = 4000;
   private _zoneSizeMin = 2000;
   private _zoneSizeMax = 4000;
   private _zoneChangeProb = 0.95;
   private _zoneOffProb = 0.5;
   private _zoneWayOffProb = 0.1;
   private _shrinkTimeMinutes = 60;
   private _shrinkFactor = 1;
 
   if (_zoneSizeMin == 0) then {_zoneSizeMin = 0.05 * worldsize};
   if (_zoneSizeMax == 0) then {_zoneSizeMax = 0.1 * worldsize};
 
   private ["_pos","_dir","_dist","_overland", "_size1", "_size2", "_currentFactor"];
   private _zoneDetails = ["fzone47", _this select 0, _this select 1, _this select 2, _this select 3, _this select 4, _this select 5];
 
   sleep (random [30, 30, 90]);
 
   _shrinkFactor = 1 - _shrinkFactor;
   private _init = true;
   tortdoit = true;
 
   waituntil {alive player};
   while{tortdoit} do
   {
      _overland=false; _pos = position player;
      if (_init) then
      {
         _init = false;
         _pos = position player;
         _size1 = (_zoneCreateSizeMin + random(_zoneCreateSizeMax - _zoneCreateSizeMin));
         _size2 = (_zoneCreateSizeMin + random(_zoneCreateSizeMax - _zoneCreateSizeMin));
         [_pos, _size1, _size2, 0, random 360, _zoneDetails] call DAC_fNewZone;
      }
      else
      {
         if((random 1) < _zoneChangeProb) then
         {
            _currentFactor = 1 - _shrinkFactor *((time min (60*_shrinkTimeMinutes))/(60*_shrinkTimeMinutes));
            _size1 = (_zoneSizeMin + random(_zoneSizeMax - _zoneSizeMin)) * _currentFactor;
            _size2 = (_zoneSizeMin + random(_zoneSizeMax - _zoneSizeMin)) * _currentFactor;
            if((random 1) < _zoneOffProb) then
            {
               if (((random 1) > _zoneWayOffProb) || _init) then
               {
                  _dir = random [0, ([0,0,0] getdir (getCameraViewDirection player)), 360];
                  _dist = random [0, _zoneSizeMin, _zoneSizeMax];
                  _pos = [(_pos select 0) + cos _dir * _dist, (_pos select 1) - sin _dir * _dist, 0];
               }
               else
               {
                  while {!_overland} do {
                     _pos = [random worldsize, random worldsize, 0];
                     _overland = !(_pos isFlatEmpty [-1, -1, -1, -1, 0, false] isEqualTo []);
                     sleep 0.02;
                  };
               };
            }
            else
            {
               _pos = position player;
            };
            [fzone47, _pos, [_size1, _size2, random 360],0,0,0] call DAC_fChangeZone;
         };
      };
      sleep (random [0.75 * _changeEveryMinutes * 60, _changeEveryMinutes * 60, 2 * _changeEveryMinutes * 60]);
   };
};

 

Please try different DAC_Marker settings. I think u can use 1-10 ... so for example "DAC_Marker = 3" or "DAC_Marker = 5"

With some settings u can see marker for each unit and not only for each group.

 

The group reduce function don't delete the leader of the group, so maybe u make any other mistake.

 

One reason could be, if the "_setJoin" Value (within DAC_Config_Behaviour) is to high, some groups will join other groups and then the old group is deleted ... incl. the respective marker.

The same can happen if u create many small DAC groups (2-3 units per group, for example), then the probability is very high that the small groups joins larger groups.

 

I think that's your problem. Try to disable this function by setting this value to 0 >>>> _setJoin = 0;

 

The DAC readme says:

 

This parameter determines, from which groupsize a group dissolves and joins

the nearest group. This behavior can lead to a respawn of a new group when a camp is available.

 

Silola

  • Like 1

Share this post


Link to post
Share on other sites

Great, thanks, that was exactly the effect, because I spawned them in a pretty small area.

Share this post


Link to post
Share on other sites

I'm getting a []: 'bin\config.bin/CfgPatches/DAC_Source/' not an array error when saving a scenario in the editor. Any clues?

Share this post


Link to post
Share on other sites

I'm getting a []: 'bin\config.bin/CfgPatches/DAC_Source/' not an array error when saving a scenario in the editor. Any clues?

Yes. I posted the solution here in this thread in September, some array thing in config.cpp, please look, I am on a smartphone. But you have to depbo yourself. Maybe Silola should have a look.

  • Like 1

Share this post


Link to post
Share on other sites

Yes. I posted the solution here in this thread in September, some array thing in config.cpp, please look, I am on a smartphone. But you have to depbo yourself. Maybe Silola should have a look.

 

Thanks, you'll look for your post.

 

Edit:

Found it, thanks again!

 

The DAC mod throws an error message at mission start, in latest DEV build... something like "[] - config.bin\cfgpatches\dacSource: Not an array"...

Not exactly sure if it's solved, but I think so. I removed

name = "DAC_Source.pbo";
mail = "silola@freenet.de";
from dac_source.pbo\config.cpp and now the error is gone... Maybe some attribute is not working any more...

 

And for Silola:

https://community.bistudio.com/wiki/CfgPatches

 

Edit #2:

Tortuosit's solution didn't work, what did, though, is changing the CfgPatches section inside config.cpp to look like so:

class CfgPatches
{
	class DAC_Source
	{
		units[] = {};
		weapons[] = {};
		requiredAddons[] = {"A3_Data_F"};
		requiredVersion = 0.1;
		author = "Silola";
	};
}; 

 

I think the problem was with the author line.

Edited by Neviothr

Share this post


Link to post
Share on other sites

Yeah, can't remember what I changed, because I changed another mod as well; one had multiple authors, which did not work. Here in DAC the cfgpatches in config.cpp I use is like this:

 

class CfgPatches
{
	class DAC_Source
	{
		units[]={};
		weapons[]={};
      name = "DAC_Source.pbo";
		mail = "silola@freenet.de";
		requiredAddons[]=	{	
								"A3_Data_F","A3_Misc_F","A3_Structures_F","A3_Plants_F_Bush","A3_Roads_F","A3_Rocks_F","A3_Signs_F",
								"A3_Soft_F","A3_Structures_F_Wrecks","A3_Structures_F_Mil","A3_Structures_F_Ind","A3_Structures_F_Households"
							};
		requiredVersion=0.1;
		versionStr = "3.1";
		versionAr[] = {3,1};
		author = "Silola";
	};
};
  • Like 1

Share this post


Link to post
Share on other sites

I'm getting an error along the lines of the below whenever previewing a mission.

Error in expression <ue;_dist = 100000;_wn = 1;

_tempList = List _zone;

if(count _tempList > 0) the>
Error position: <List _zone;

if(count _tempList > 0) the>
Error list: Type Script, expected Object 

I've narrowed it down to dac_find_wplog.sqf and dac_find_polylog.sqf

Any ideas?

 

Edit:

Never mind, this ended up being a problem with the DAC parameters inside the trigger.

The handle can't have the same name as the zone, FYI.

Edited by Neviothr

Share this post


Link to post
Share on other sites

Was there ever a repository of DAC missions put up anywhere ?  I fancy playing around ;)

Share this post


Link to post
Share on other sites

Was there ever a repository of DAC missions put up anywhere ?  I fancy playing around ;)

 

 

Not that I am aware of Krem...I offered to host on my Github where I host the configs but I got no takers :(

  • Like 2

Share this post


Link to post
Share on other sites

Does this work with ASR AI?

 

Yes it does.  Recommend you disable the join group setting on either the DAC side or the ASR side.  Can't recall the exact variables at the moment but on the DAC side it's in DAC_Config_Creator.sqf.  DAC_Config_Behaviour?  Damn getting old can't remember these things lol

  • Like 1

Share this post


Link to post
Share on other sites

does the addon version have to be present on all the clients computer for a multiplayer session or only the server (and of course the mission creator) ?

Share this post


Link to post
Share on other sites
4 hours ago, tebbbs said:

does the addon version have to be present on all the clients computer for a multiplayer session or only the server (and of course the mission creator) ?

Yes because using one of the available modules will create a dependency for DAC.

Share this post


Link to post
Share on other sites

Of course server and each client.

Share this post


Link to post
Share on other sites

can i get link to download dac 3.1, the link on the 1st page is saying not found. does this for x-cam as well

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

×