Jump to content
silola

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

Recommended Posts

I think it has to do with _sidepos when you call DAC_fNewZone. This function expects at a first argument the position where it has to be created. If you look at what the command "position player" or equivalently "getPos player" you can see that they return an array [x,y,z]. Therefore you should give the position of "_sidepos" instead of just giving it as a value. Try please, assuming _sidepos is a marker, the following

[(getMarkerPos _sidepos) ,300,300,0,0,_infVT] call DAC_fNewZone;

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

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

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

 

Hope it helps

Share this post


Link to post
Share on other sites

I think it has to do with _sidepos when you call DAC_fNewZone. This function expects at a first argument the position where it has to be created. If you look at what the command "position player" or equivalently "getPos player" you can see that they return an array [x,y,z]. Therefore you should give the position of "_sidepos" instead of just giving it as a value. Try please, assuming _sidepos is a marker, the following

[(getMarkerPos _sidepos) ,300,300,0,0,_infVT] call DAC_fNewZone;

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

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

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

 

Hope it helps

 

Ok that is taken care of but a new problem emerges :/

Enemy soldiers wont attack me and they appear to be named in "green" at cursor point. Like allies do. Honestly, I am getting annoyed now.

 

Here is the new Obj.sqf:

// Objective: Destroy the Drone

// find center of AO...looking for gamelogic location which created before in editor
_sidepos = [base1,base2,base3] call BIS_fnc_selectRandom;
_side = createCenter west;

// add marker on AO/target
_marker = createMarker ["side_area", _sidepos];
_marker setMarkerShape "Ellipse";
_marker setMarkerColor "ColorRed";
_marker setMarkerText "Clear Area";
_marker setMarkerSize [1,1];

_veh = createVehicle ["B_UAV_02_CAS_F",getMarkerPos "side_area", [], 0, "NONE"];
	sleep 1;

// Add task
//Task ID-Task name-Task description and some other options
["Task2",true,["Reports coming in of a new Drone unit being deployed on the Island.
This will bring our location out. Find it, destroy it immediately",
"Destroy the Drone","Destroy the Drone"], getMarkerPos "side_area",
"AUTOASSIGNED",6,true,true] call BIS_fnc_setTask;

sleep 4;

// spawn enemy
_infVTA = ["z1",[1,0,0],[8,1,6,4],[1,1,4,3],[1,1,3,3],[1,1,4],[1,1,1,1]];
_infV = ["z2",[3,0,0],[8,1,6,4],[2,1,4,3],[],[],[1,1,1,1]];
_infT = ["z3",[1,0,0],[8,1,6,4],[],[1,1,3,3],[],[1,1,1,1]];

switch (_sidepos) do {
  case base1: { [(_sidepos),300,500,0,25,_infVTA] call DAC_fNewZone;};
  case base2: { [(_sidepos),300,300,0,0,_infT] call DAC_fNewZone;};
  case base3: { [(_sidepos),500,300,0,30,_infV] call DAC_fNewZone;};
};

sleep 2;

// WAIT UNTIL objective destroy
waitUntil {sleep 5; !alive _veh};

// task complete hint
["Task2","Succeeded"] call BIS_fnc_taskSetState;

// delete AO marker and target
deleteMarker "side_area";
sleep 10;

// remove mans/vehicles/air/static "optional"
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[
	"air","StaticWeapon","Landvehicle"
	],900];
	sleep 10;
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[
	"man"
	],900];

["zone"] call DAC_fDeleteZone;

sleep 15;

["Task2"] call BIS_fnc_deleteTask;

// go for next side mission
[]execVM "side_finder.sqf";

Share this post


Link to post
Share on other sites

Maybe it has to do with the side you are selecting in the last array. Note that to spawn east side units (CSAT) it should look like this (assuming 0 is CSAT and 1 NATO in DAC_config_Units.sqf):

_infVTA = ["z1",[1,0,0],[8,1,6,4],[1,1,4,3],[1,1,3,3],[1,1,4],[0,0,0,0,0]];

while

_infVTA = ["z1",[1,0,0],[8,1,6,4],[1,1,4,3],[1,1,3,3],[1,1,4],[1,1,1,0,0]];

would generate west side units. Notice as well, that the forth parameter that I have put to 0 in the last array [1,1,1,0,0] is related to camp configurations. Do you have DAC camps configured?

Share this post


Link to post
Share on other sites

Maybe it has to do with the side you are selecting in the last array. Note that to spawn east side units (CSAT) it should look like this (assuming 0 is CSAT and 1 NATO in DAC_config_Units.sqf):

_infVTA = ["z1",[1,0,0],[8,1,6,4],[1,1,4,3],[1,1,3,3],[1,1,4],[0,0,0,0,0]];

while

_infVTA = ["z1",[1,0,0],[8,1,6,4],[1,1,4,3],[1,1,3,3],[1,1,4],[1,1,1,0,0]];

would generate west side units. Notice as well, that the forth parameter that I have put to 0 in the last array [1,1,1,0,0] is related to camp configurations. Do you have DAC camps configured?

I am playing as East so 1,1,1,0 is ideal for me for spawning NATO enemy troops. Plus I dont want camps hence ive left it to 0.

Even that undefined newzone error is coming in obj1.sqf but not in obj2.sqf and both have the same values.

 

I donno what happened since I switched to dac zones "on the fly" approach. My beautiful mission seems busted now and I am sad. :'(

Share this post


Link to post
Share on other sites
// Objective: Capture the town

// find center of AO...looking for gamelogic location which created before in editor
_sidepos = [city1,city2] call BIS_fnc_selectRandom;
_side = createCenter west;

// Add task
//Task ID-Task name-Task description and some other options
["Task1",true,["Clear the area by any means necessary.
NATO have acquired a new base on the island.
Finish them off quickly.","Clear Area","Clear Area"],
_sidepos,"AUTOASSIGNED",6,true,true] call BIS_fnc_setTask;

sleep 0.6;

// spawn enemy
_infTA = ["z1",[1,0,0],[8,1,6,4],[],[1,1,3,3],[1,1,4],[1,1,1,0]];

[(getPos _sidepos),300,500,0,25,_infTA] call DAC_fNewZone;

Tried getpos, getposATL in the last line. nothing seems to work. Silola need some help here man.

Share this post


Link to post
Share on other sites

Ok so I got rid of the gamelogics and instead made 2 markers: city1 and city2.

 

now my objectiveinit.sqf is:

// create missions list array
_allmissions = [0] call BIS_fnc_selectrandom;

_mkrs = ["city1","city2"];
_pos = _mkrs call BIS_fnc_selectRandom;

// spawn enemy
switch (_allmissions) do {
  case 0: { [(getMarkerPos _pos)] execVM "sidemissions\side1.sqf";};
};

// execute the selected mission...

And now the side1.sqf is:

// Objective: Capture the town
_sidepos = (_this select 0);

// find center of AO...looking for gamelogic location which created before in editor
_side = createCenter west;

// Add task
//Task ID-Task name-Task description and some other options
Enemy have acquired a new base on the island.
Finish them off quickly.","Clear Area","Clear Area"],_sidepos,"AUTOASSIGNED",6,true,true] call BIS_fnc_setTask;

sleep 0.6;

// spawn enemy
_infTA = ["z1",[1,0,0],[8,1,6,4],[],[1,1,3,3],[1,1,4],[1,1,1,0]];
[(getPos _sidepos),300,500,0,25,_infTA] call DAC_fNewZone;

sleep 2;

// WAIT UNTIL objective destroy
waitUntil {sleep 5;{alive _x && side _x == west} count allunits == 0};

// task complete hint
["Task1","Succeeded"] call BIS_fnc_taskSetState;

// delete AO marker and target
deleteMarker "side_area";
sleep 10;

// remove mans/vehicles/air/static "optional"
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[
	"air","StaticWeapon","Landvehicle"
	],900];
	sleep 10;
{if (!(isplayer _x)) then {deleteVehicle _x;};} foreach nearestobjects [_sidepos,[
	"man"
	],900];

["zone"] call DAC_fDeleteZone;

sleep 15;

["Task1"] call BIS_fnc_deleteTask;

// go for next side mission
[]execVM "side_finder.sqf";

Even now the same not defined newzone is popping up.

Share this post


Link to post
Share on other sites

you are doing something strange. You pass as an argument a position in [(getMarkerPos _pos)] execVM "sidemissions\side1.sqf";}; and then you ask the position of the position in the following line: [(getPos _sidepos),300,500,0,25,_infTA] call DAC_fNewZone;

 

Also, in

 // Add task
//Task ID-Task name-Task description and some other options
Enemy have acquired a new base on the island.
Finish them off quickly.","Clear Area","Clear Area"],_sidepos,"AUTOASSIGNED",6,true,true] call BIS_fnc_setTask;

you seem to have an error.

Share this post


Link to post
Share on other sites

I have tried getpos _sidepos, getmarkerpos _sidepos, and even _sidepos alone in the call newzone, with brackets, without brackets but to no avail. I hope someone checks these scripts that i have posted.

And the task appears to not have '["Task1",'. But it works all well, not a single error. Ill anyway change that and see. But why wouldnt it throw an error? I mean it allots me the task all good.

Share this post


Link to post
Share on other sites

Ok guys this creating DAC Zones 'on-the-fly' isnt working for me. I put down gamelogics city1 and city 2 and here is the objective.sqf snippet:

// Objective: Capture the town

_infVT = ["z2",[2,0,0],[13,1,6,4],[2,1,4,3],[1,1,3,3],[],[1,1,1,0]];
_infV = ["z3",[3,0,0],[13,1,6,4],[2,1,4,3],[],[],[1,1,1,0]];

// find center of AO...looking for gamelogic location which created before in editor
_sidepos = [city1,city2] call BIS_fnc_selectRandom;
_side = createCenter west;

// add marker on AO/target
_marker = createMarker ["side_area", _sidepos];
_marker setMarkerShape "Ellipse";
_marker setMarkerColor "ColorRed";
_marker setMarkerText "Clear Area";
_marker setMarkerSize [1,1];


// Add task
//Task ID-Task name-Task description and some other options
["Task1",true,["Clear the area by any means necessary.
NATO have acquired a new base on the island.
Finish them off quickly.","Clear Area","Clear Area"],
getMarkerPos "side_area","AUTOASSIGNED",6,true,true] call BIS_fnc_setTask;

sleep 4;

// spawn enemy
switch (_sidepos) do {
  case city1: { [_sidepos,300,300,0,0,_infVT] call DAC_fNewZone;};
  case city2: { [_sidepos,200,150,0,0,_infV] call DAC_fNewZone;};
};

.......

It keeps showing an error: http://postimg.org/image/uyip4ihap/

 

Something to do with DAC_New_Zone not defined? O.o

 

Hi,

 

if your mission starts without any DAC zone (because u want to create the zones "on the fly")

then it's important to use the following function (Readme >>> page 37):

 

 

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

Hi,

 

if your mission starts without any DAC zone (because u want to create the zones "on the fly")

then it's important to use the following function (Readme >>> page 37):

 

 

 

Silola

Thanks Silola, Yes I have put down a game logic with  DAC_Direct_Start = true. By the way no offence but the readme needs some serious grammatical editing.

Share this post


Link to post
Share on other sites

I know :(

 

But what exactly is your current problem with your mission?

Share this post


Link to post
Share on other sites

Maybe it's an option to send me a template mission (without any other addons), so I can check the mission.

Share this post


Link to post
Share on other sites

Maybe it's an option to send me a template mission (without any other addons), so I can check the mission.

Yeah Ill try a little more tonight. Actually at work right now. ;)

 

Will get back with results later today.

Share this post


Link to post
Share on other sites

Here is that Mission Silola. Fix it for me plz?

 

http://www.filedropper.com/covertopsdacmidmissionstratis

 

And by the way, what does this error denote?:

http://postimg.org/image/8acinomtf/

 

I have to restart my mission 2-3 times to get the DAC zones to start.

 

Ok ... there is no DAC initialization within your mission and that's the reason for all the error messages.

 

If you use the addon version, then u have to insert the DAC logic (intern or extern) to initialize DAC.

But if you use the script version of DAC, then u need the following code line (first line) within your init.sqf:

 

DAC_Basic_Value = 0; execVM "DAC\DAC_Config_Creator.sqf";

 

Otherwise you can't call any DAC function without any error.

Basicly DAC shows you a small message, after the initialization process was successful, as u can see here ...

 

XTpWhwn.png

 

And now .... good luck with your mission ;)

 

Silola

 

====================================================

 

As long as you edit your mission, turn on the DAC markers, in order to see what happens, during a new DAC zone is generated:

 

DAC_Marker = 1;

Edited by Silola

Share this post


Link to post
Share on other sites

Ok ... there is no DAC initialization within your mission and that's the reason for all the error messages.

 

If you use the addon version, then u have to insert the DAC logic (intern or extern) to initialize DAC.

But if you use the script version of DAC, then u need the following code line (first line) within your init.sqf:

 

DAC_Basic_Value = 0; execVM "DAC\DAC_Config_Creator.sqf";

 

Otherwise you can't call any DAC function without any error.

Basicly DAC shows you a small message, after the initialization process was successful, as u can see here ...

 

XTpWhwn.png

 

And now .... good luck with your mission ;)

 

Silola

 

====================================================

 

As long as you edit your mission, turn on the DAC markers, in order to see what happens, during a new DAC zone is generated:

 

DAC_Marker = 1;

Thanks :)

Share this post


Link to post
Share on other sites

I wanna do an in-depth DAC tutorial for Arma 3 soon. Would you be ok with it Silola? It might help others :)

Share this post


Link to post
Share on other sites

I wanna do an in-depth DAC tutorial for Arma 3 soon. Would you be ok with it Silola? It might help others :)

 

It's ok for me :)

 

Silola

Share this post


Link to post
Share on other sites

It's ok for me :)

 

Silola

All of a sudden a new problem. Sigh.

 

Enemy AI spawned with DAC "on the fly" feature have suddenly become allies to me. They dont fire at me, however enemy spawned with spawngroup script attack me in the same mission. I am playing as east, and this is my spawn DAC script for testing purpose:

// spawn enemy
_values = ["z1",[1,0,0],[1,1,2,2],[],[],[],[1,1,1,0]];
[_sidepos,80,80,0,0,_values] call DAC_fNewZone;

WHat is the issue Silola?

Share this post


Link to post
Share on other sites

All of a sudden a new problem. Sigh.

 

Enemy AI spawned with DAC "on the fly" feature have suddenly become allies to me. They dont fire at me, however enemy spawned with spawngroup script attack me in the same mission. I am playing as east, and this is my spawn DAC script for testing purpose:

// spawn enemy
_values = ["z1",[1,0,0],[1,1,2,2],[],[],[],[1,1,1,0]];
[_sidepos,80,80,0,0,_values] call DAC_fNewZone;

WHat is the issue Silola?

Nevermind. Res_Side was set to wrong.. :P

Share this post


Link to post
Share on other sites

Hi,

 

to create a  DAC tutorial is a nice idea, but atm I think it's better for u to learn the basics first ;)

 

No idea what's now going wrong with your mission. Maybe it's a problem with your DAC_Unit_Config.

 

But ... please delete the DAC logic unit first, because you are using the script version of DAC

and then it makes no sense (but maybe problems) if you use this logic unit.

 

And as I said before, you have to initialize DAC via init.sqf then.

Another important thing is ... don't spawn EAST units on side WEST, don't spawn WEST units on side EAST ... so check your DAC_Unit_Config in connection to this limitation.

 

Silola

Share this post


Link to post
Share on other sites

Hi,

 

to create a  DAC tutorial is a nice idea, but atm I think it's better for u to learn the basics first ;)

 

No idea what's now going wrong with your mission. Maybe it's a problem with your DAC_Unit_Config.

 

But ... please delete the DAC logic unit first, because you are using the script version of DAC

and then it makes no sense (but maybe problems) if you use this logic unit.

 

And as I said before, you have to initialize DAC via init.sqf then.

Another important thing is ... don't spawn EAST units on side WEST, don't spawn WEST units on side EAST ... so check your DAC_Unit_Config in connection to this limitation.

 

Silola

Yeah tht problem is fixed but a new one now. Gosh I am fed up. Thing is if I run the side mission as an independent init.sqf it works well. But now when I have put it in the random mission generator, It is spawning units via DAC, no issue, and assigning me the task to clear the area. All works well. 

 

Problem comes when I have killed all enemy units (west side) it doesnt succeed the task. Here is the rpt file. Please look in it Silola. I am not able to get task complete after clearing all enemy units.Here it is: http://www.filedropper.com/arma32015-11-3023-21-03

 

 

 

And this is my side1.sqf. This shoots well if i run this mission in init.sqf, but doesnt run when I put it among 11 side missions and ask sidefinder.sqf to assign me this task:

// Objective: Capture the town

// find center of AO...looking for gamelogic location which created before in editor
_sidepos = _this select 0;
_side = createCenter west;

sleep 4;

// spawn enemy
_values = ["z1",[1,0,0],[1,1,2,2],[],[],[],[1,1,1,0]];
[_sidepos,80,80,0,0,_values] call DAC_fNewZone;


// Add task
//Task ID-Task name-Task description and some other options
["Task1",true,["Clear the area by any means necessary.
NATO have acquired a new base on the island.
Finish them off quickly.","Clear Area","Clear Area"],
_sidepos ,"AUTOASSIGNED",6,true,true] call BIS_fnc_setTask;

sleep 2;

// WAIT UNTIL objective destroy
waitUntil {sleep 5;{alive _x && side _x == west} count allunits == 0}; //// problem here. 

// task complete hint
["Task1","Succeeded"] call BIS_fnc_taskSetState;

sleep 15;

// remove mans/vehicles/air/static "optional"
["z1"] call DAC_fDeleteZone;

sleep 15;

["Task1"] call BIS_fnc_deleteTask;

titleText ["", "BLACK FADED"];
sleep 2;
player setpos [((getPos hq select 0)+8), getPos hq select 1, getPos hq select 2];
player setdir (((getPos hq select 0) - (getPos player select 0)) atan2 ((getPos hq select 1) - (getPos player select 1)));
titleText ["Incoming transmission from HQ", "BLACK IN"];

// go for next side mission
[]execVM "side_finder.sqf";

Share this post


Link to post
Share on other sites

Sorry, but I can't help u along the whole mission. If you have some troubles with DAC ... let me know,

but only if the readme and all the 30 demo missions don't give you any solution ;)

 

Silola

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

×