Jump to content
t-800a

[RELEASE] T8 Units - a less dynamic AI creator

Recommended Posts

Hi T800. What effect will an AI mod like ASR have on your script. I see your units have basic movement and response commands such as throw smoke and reinforce units that are being engaged. I suppose these commands will conflict with what ASR_AI are trying to do?

 

Btw, just want to thank you for the script. Has made a HUGE difference in mission making and the time required!

  • Like 1

Share this post


Link to post
Share on other sites

Hi T800. What effect will an AI mod like ASR have on your script. I see your units have basic movement and response commands such as throw smoke and reinforce units that are being engaged. I suppose these commands will conflict with what ASR_AI are trying to do?

 

Btw, just want to thank you for the script. Has made a HUGE difference in mission making and the time required!

Thanks!

I don't know how ASR works, and have never tested it.

In the past I only used Fabrizios bCombat which worked without porblems.

If a addon/script starts 'messing' with waypoints and the groups they will probably conflict with my Script. Like bCombat did/does only manage the individual units and leaves waypoints and groups as they are, they worked nicely together.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks!

I don't know how ASR works, and have never tested it.

In the past I only used Fabrizios bCombat which worked without porblems.

If a addon/script starts 'messing' with waypoints and the groups they will probably conflict with my Script. Like bCombat did/does only manage the individual units and leaves waypoints and groups as they are, they worked nicely together.

 A I see, I suspected that much. If I understand ASR correct, its actually the opposite of B-Combat. In that the waypoints are effected and not the individual units. Will test it a bit and see what happens.

Share this post


Link to post
Share on other sites

I've been testing and playing T8 for the past few weeks now and tried improving a few things myself.  There is one thing that still bugs me and I don't have a straight answer for.  fe:  You spawn a container with 6 groups all with the patrol around task at 300m.  A random WP will be chosen for their first patrol point.  This works but you hardly if ever get an even spread of those six patrols along the circle.  So most of the time half of the circle is empty while the other half is overcrowded.

 

It's a hard thing to solve considering how the original code is engineered.  Each group gets created and then the spawn directive is used to handing it a task.  The task gives the group waypoints and tells them what to do, then picks that random waypoint as their first waypoint.  This causes each group to have their own set of waypoints , usually close to the other waypoints but not entirely the same.  Since the spawn directive is used you can't save the last chosen waypoint if you want to try and spread them evenly out.  There is also no return value and using a global is not an option since that one would just get overwritten by each spawn script that can run in any order.

 

It's a doozy to try to improve :(

Share this post


Link to post
Share on other sites

just send one patrol clockwise and the other one counterclock, add a third one in any direction and they will sooner or later balance, also use different group sizes, 8 men take longer to finish a WP than 3, which in turn changes the distribution again...

Share this post


Link to post
Share on other sites

Hello all, 

 

I am still looking if anyone knows how to enable this script to push the skill presets down to an individual group instead of the entire BLUFOR or OPFOR.  Otherwise to position snipers in my mission and give them longer ranges than infantry they will have to be instantiated via init in Eden. I have been testing it but so far have not found a way.

Share this post


Link to post
Share on other sites

Hello all, 

 

I am still looking if anyone knows how to enable this script to push the skill presets down to an individual group instead of the entire BLUFOR or OPFOR.  Otherwise to position snipers in my mission and give them longer ranges than infantry they will have to be instantiated via init in Eden. I have been testing it but so far have not found a way.

 

You will not be able to do this without changing the T8 scripts.  Look at following code

 

https://github.com/Celludriel/T8_Units/blob/master/T8/fnc/fn_spawn.sqf#L260

 

to

 

https://github.com/Celludriel/T8_Units/blob/master/T8/fnc/fn_spawn.sqf#L300

 

After spawning he is taking one of the skillsets from the configuration and applying this to each unit.  This makes it pretty hard coded into the script.  A better way to do this is abstracting the setting of the skill to a seperate function that can be overridden.  For example:

SKILL_APPLIER = "T8\custom\skillApplier.sqf";

<content default skillApplier>

			private [ "_presetSkill", "_presetBehavior" ];
			_presetSkill	= 0;
			_presetBehavior = 0;
			
	// Setup Origin Array
			_originArray = [ _markerArray, _type, _infGroup, _taskArray, _customFNC ];
			
			switch ( _groupSide ) do
			{
				case WEST:
				{
					_presetSkill	= ( T8U_var_Presets select 0 ) select 0;
					_presetBehavior = ( T8U_var_Presets select 0 ) select 1;
				};
				
				case EAST:
				{
					_presetSkill	= ( T8U_var_Presets select 1 ) select 0;
					_presetBehavior = ( T8U_var_Presets select 1 ) select 1;				
				};
				
				case RESISTANCE:
				{
					_presetSkill	= ( T8U_var_Presets select 2 ) select 0;
					_presetBehavior = ( T8U_var_Presets select 2 ) select 1;				
				};
			};

			// Set the skill for the Group
			// -> forEach units _group		
			{
				private [ "_tmpUnit" ];
				_tmpUnit = _x;
				{
					_tmpUnit setskill [ ( _x select 0 ), ( _x select 1 ) ];
				} forEach ( T8U_var_SkillSets select _presetSkill );
				
				// Add a HIT event to all Units
				_tmpUnit addEventHandler [ "Hit", { _this call T8U_fnc_HitEvent; } ];
				
				// enable / disable fatigue
				_tmpUnit enableFatigue T8U_var_enableFatigue;

				// add units to return array
				_return pushBack _tmpUnit;

			} foreach units _group;

This is just conceptual do not take this code for working.  Anyhow next up  you could in principle write your own skillApplier.sqf, and just manage how skills get assigned yourself.  It's a small refactor to T8, I could do this , but I already have a pull request open for @T-800a he has not had the time to review yet

  • Like 1

Share this post


Link to post
Share on other sites

It's a small refactor to T8, I could do this, but I already have a pull request open for @T-800a he has not had the time to review yet.

No longer an open pull request... found myself in a "SQF-mood" yesterday and got some stuff done. :D

 

I pulled it into the dev built and modified the teleport a bit, so it is optional per group.

[[ GROUP STUFF ], [ TASK STUFF ], [ COMMUNICATION STUFF ], [ TELEPORT:BOOL ]],
[[ _someGroup,  "someMarker" ], [ "PATROL" ], [],[ false ]],
[[ _someGroup,  "someMarker" ], [ "PATROL_AROUND" ], [], [ true ]]
Also new in the dev build:

One single handle (spawned function) to controll communication & reactions of the groups, no longer each group has its own spawned handle.

This was something a had in mind for a long time, but was always to lazy to do.

Whats up next:

To empower you people who want to configure things per group I would love to move the SQF config stuff into the missionConfigFile. There you could define various reuseable classes (that contain thingls like skill, teleport, ...) which you could apply to single or multiple groups.

Also need to move Cells spawncontainer configuration out of the SQF!

  • Like 5

Share this post


Link to post
Share on other sites

Nice on making the teleport optional.  I was thinking about the spawn container as well.  It was a good idea at the time, for rapid dynamic container generation.  I'm not sure it is my best implementation I ever made.  In java I would just create three beans and inject them into my class.  However this is a long way of from java dependency injection.  So best I could do was recreate the arrays each time.  Also I wonder if I had to add ALL the unit types ... some of them are just useless.  It should be up to the library user which units they want to allow in their random containers.

 

Should you feel the function needs more improvement just let me know what you have in mind and I'll put some more work in it.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you celludriel and T-800a for clarification and insights.  As it seems like you have this on the development radar, I won't try to force it but the code examples furthered my understanding.  Asking you guys was partly for me to make sure I wasn't misunderstanding how T8 works, I didn't think group-level skill assignment was possible as-is, so again, I appreciate your time in helping me understand at least on the surface that I read the code correctly.

  • Like 2

Share this post


Link to post
Share on other sites

occupy is more static then garrison. with garrison units will move between various buildings or positions with some cover nearby. wit occupy units wont move around, also they stick with window positions, and they stick a bit better togehter.

  • Like 1

Share this post


Link to post
Share on other sites

Hello. Noobie interrogation here. You said we can spawn vehicle with your script too. I mean, with crew inside, capable of following waypoints created in zones.
I'm curious to know how you do that.
Btw, I'm using your script in a lot of mission, almost perfect everytime.

Share this post


Link to post
Share on other sites

Hello. Noobie interrogation here. You said we can spawn vehicle with your script too. I mean, with crew inside, capable of following waypoints created in zones.

I'm curious to know how you do that.

Btw, I'm using your script in a lot of mission, almost perfect everytime.

Just like your normal groups with a little twist:

UnitsYouWantToSpawn = [
	[[[ "O_APC_WHEELED_02_RCWS_F" ], "your_marker", false ], [ "PATROL" ]],
	[[[ "O_APC_WHEELED_02_RCWS_F", "O_soldier_TL_F", "O_medic_F", "O_soldier_F", "O_soldier_AR_F" ], "your_marker", false ], [ "PATROL" ]]
];
Don't forget the false after the marker, as this will tell the script your group it not a infantry group, and wont make the units leave their vehicles on waypoints.

Share this post


Link to post
Share on other sites

Thank you, much appreciated. FYI my friends and I are very satisified with your script, good job.

  • Like 1

Share this post


Link to post
Share on other sites

I try to spawn units via T8U_fnc_TriggerSpawn

The group def:

_smallgroup = [ "aif_sniper", "aif_support_MG" ];
_biggroup = [ "aif_TeamLeader", "aif_support_MG", "aif_riflemanGL", "aif_riflemanM4", "aif_riflemanM4", "aif_riflemanGLM4", "aif_rifleman", "aif_medic_G" ];

MyGroupContainer:

_mrkVillage =
[
 [ [ _biggroup, "vill1" ], [ "PATROL" ], [ true, true, false ]],
 [ [ _smallgroup, "vill1" ], [ "DEFEND" ], [ true, false, false ]]
];

The func call:

[ _mrkVillage,"T8_Trigger1",50,"this","WEST","PRESENT",false,"",""] call T8U_fnc_TriggerSpawn;

But it cames up with the error:

Error in expression <ndition", "_trigger" ];

_unitsArray		= param [ 0, "NO-UNITS-SET", [""]];
_marke>
23:02:03   Error position: <param [ 0, "NO-UNITS-SET", [""]];
_marke>
23:02:03   Error Type Array, expected String
23:02:03 File C:\xxx\Arma 3 - Other Profiles\xxx\missions\T8_demo.Sara_dbe1\T8\fnc\fn_triggerSpawn.sqf, line 7

I can't find the Problem.

Share this post


Link to post
Share on other sites

Hi,

to make the container/variable work with T8U_fnc_TriggerSpawn or T8U_fnc_Zone it needs to be a global variable, not a private variable (indicated by the underline dash).

And in the function it need to be declared as a string.

like here:

NEODYN_var_unitsVillage =
[
 [ [ _biggroup, "vill1" ], [ "PATROL" ], [ true, true, false ]],
 [ [ _smallgroup, "vill1" ], [ "DEFEND" ], [ true, false, false ]]
];

[ "NEODYN_var_unitsVillage", "T8_Trigger1",50,"this","WEST","PRESENT",false,"",""] call T8U_fnc_TriggerSpawn;
  • Like 1

Share this post


Link to post
Share on other sites

Great thx!

 

Could u also please correct this in your doc.  ;)

Share this post


Link to post
Share on other sites

This script is awesome. Keep up the great work!.

 

 

Feature request. The ability to give a new command to a spawned unit.

 

Like. I tell my patrol to GARRISON an area. and then if a variable is true, can i give an ATTACK command to the group.

Share this post


Link to post
Share on other sites

Ops bad odd stuff happen.

 

I wanna set multiple zones for T8U_fnc_Zone. But its working very strange.

 

Here is my setup:

 

init.sqf

if (isServer) then {
	
	
	[] call compile preprocessFileLineNumbers "functions\server_fnc.sqf";

		

		
	private _cities = call fnc_urbanAreas;
		
	private _markers = [];
	
	{
		private _pos = _x select 0;
		private _name = [5,"All"] call Zen_StringGenerateRandom;
		_markers pushBack createMarker [_name, _pos];
		
	} forEach _cities;
	
	{
		_x setMarkerSize [200, 200];
		_x setMarkerShape "ELLIPSE";
		_x setMarkerType "Empty";
		_x setMarkerColor "ColorBlack";
		_x setMarkerBrush "Solid";
		_x setMarkerAlpha 1;
		
	} foreach _markers;
	
null = _markers execVM "T8_missionEXEC.sqf";
//_markers = ["=e/za","b67;S","E(i/G","@)-)0","1@\UH","h3rhn","EH%0L","z{R|H","h()ge",",_~bp","2$(P1","0*(G{","zE@lX","#0zD7","^!hlX","op-S5","L%O|}","efnew","WDOQ-","Gk}A:","wt089","&_z%b"]
};

T8_missionEXEC.sqf

#include <T8\MACRO.hpp>
waitUntil { !isNil "T8U_var_useHC" };
waitUntil { !isNil "T8U_var_InitDONE" };
__allowEXEC(__FILE__);


sleep 5;

_smallGroup       = [

	"LOP_AM_Infantry_AR",
	"LOP_AM_Infantry_Corpsman",
	"LOP_AM_Infantry_Rifleman",
	"LOP_AM_Infantry_TL"
];

_mediumGroup      = [

	"LOP_AM_Infantry_AR",
	"LOP_AM_Infantry_AT",
	"LOP_AM_Infantry_Corpsman",
	"LOP_AM_Infantry_GL",
	"LOP_AM_Infantry_Marksman",
	"LOP_AM_Infantry_Rifleman",
	"LOP_AM_Infantry_SL",
	"LOP_AM_Infantry_TL"
];

_bigGroup         = [

	"LOP_AM_Infantry_AR",
	"LOP_AM_Infantry_AT",
	"LOP_AM_Infantry_Corpsman",
	"LOP_AM_Infantry_GL",
	"LOP_AM_Infantry_Marksman",
	"LOP_AM_Infantry_Rifleman",
	"LOP_AM_Infantry_SL",
	"LOP_AM_Infantry_TL",
	"LOP_ISTS_Infantry_AR",
	"LOP_ISTS_Infantry_AT",
	"LOP_ISTS_Infantry_Corpsman",
	"LOP_ISTS_Infantry_GL",
	"LOP_ISTS_Infantry_Marksman",
	"LOP_ISTS_Infantry_Rifleman",
	"LOP_ISTS_Infantry_Rifleman_2",
	"LOP_ISTS_Infantry_Rifleman_3",
	"LOP_ISTS_Infantry_TL"
];


{

	talibs =  
	[ 
		   [ [ _smallGroup, _x], [ "GARRISON" ] ], 
		   [ [ _mediumGroup, _x], [ "PATROL_URBAN" ] ], 
		   [ [ _bigGroup, _x], [  "PATROL_GARRISON"] ], 
		   [ [ _bigGroup, _x], [ "PATROL_AROUND" ] ] 
	]; 
	 sleep 3;
	null = [ "talibs", _x, "EAST", "WEST", 1000, "this", "","" ] spawn T8U_fnc_Zone;

} forEach _this;

Behavior:

 

If I am in range of any of the zones one of them are activated but not the closest one.

Its looks like it fully randomized activates the one of them.

I do not knew why.

 

VIDEO

Share this post


Link to post
Share on other sites

Hi, getting back in to Arma after a bit of a hiatus. Used t8 units a bit last time I dabbled with mission making and found it very good!

Just wondering, which version would you recommend me using, the v.061 build from January or the dev version?

I don't really want to be fighting with too many bugs, as I tend to introduce plenty my self with my lacking script skillsand all, but the Eden interface looks very tempting indeed..?

Share this post


Link to post
Share on other sites

Can you plz add the respawn function for the enemy ai?

Share this post


Link to post
Share on other sites

Hi, can somebody help me? I recibe the message "Something went seriously wrong!, Error in Unit's spawning definition" when I try to make an Attack spawn.

 

But I don't know what I'm writting bad in my code:

 

ataque1 =
[
     [ [ grupopeque, "c1", true, EAST ], [ "ATTACK", "B_1" ] ],
     [ [ grupopeque, "c2", true, EAST ], [ "ATTACK", "B_2" ] ]
];

And in the trigger:

null = [ ataque1 ] spawn T8U_fnc_Spawn;

Thanks for your time !!

Share this post


Link to post
Share on other sites

Hello T8

 

I have the Module version of T8U installed and am trying to create a group (opfor) that will attack a marker when A Radio trigger is activated.

So my marker names are AttackStart and AttackHere

I have it working in the Script version installed in the mission folder, Just want to try out your Module version.

Can This be done?

 

Great job by the way. I am finding this easier to use then DAC.

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

×