Jump to content
t-800a

[RELEASE] T8 Units - a less dynamic AI creator

Recommended Posts

Any ideas on a hot fix for compatibility with new patch?

Oh, havent looked into the script since the patch. What is the problem?

Share this post


Link to post
Share on other sites

There is script errors, fnc_spawn i think its number expected boolen given. There was another also, maybe group count. I did get the error in the showcase, doesnt happen in the first steps tut.

Share this post


Link to post
Share on other sites

I think it's pushback returning true now which is breaking the count loops

edit: whoops you already posted before I did

Share this post


Link to post
Share on other sites

updated script to version V052:

  • pushback/count errors fixed
  • added possibility to define a custom function for each group which will be called for each unit
  • communication var array now consists of 3 parts
  • in CONFIG: T8U_var_ZeusModul -> T8U_var_ZeusModules (now is an array where you can add multiple zeus modules)
  • other small fixes / undfined var stuff / ...

The BASIC SETUP part contains information about which units should be spawned and where they are spawned. This breaks down into:

1. ARRAY that contains unit class names

2. STRING that contains the marker where you want to spawn units

3. BOOL (optional:true) set to false if the group you spawn also has vehicles

4. SIDE (optional: T8U_var_EnemySide) the side of the units.

5. STRING (optional) a custom function that will be executed for every unit in the Group. In the function you may define_this will be the single unit.

3. to 5. Don’t need to be in the order shown here.

The COMMUNICATION SETUP defines if a group can call for help and if they can react to such calls. The whole array is optional, if it is not set a group is able to call for help, and be called as help.

1. BOOL (optional:true) if true, a group can call other groups for help

2. BOOL (optional:true) if true the group can react to help calls of other groups

3. BOOL (optional:true) if true the group itself can react if fired upon. You should set this to false for DEFEND and DEFEND_BASE! (e.g. a group that is called for help and gets fired upon will, if not in superiority, throw smokes and hold if this is true)

Edited by t-800a

Share this post


Link to post
Share on other sites

Release frontpaged on the Armaholic homepage.

** documentation, script and example mission bundled in one download!

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

We have also "connected" these pages to your account on Armaholic.

This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have.

When you have any questions already feel free to PM or email me!

Share this post


Link to post
Share on other sites

This looks really good. I really like your garrison functions. Really nice that they move around from time to time rather than just sticking in one position the entire time.

Share this post


Link to post
Share on other sites

Has anyone been able to spawn Independant side units using this? I'm having a real hard time getting anything but CSAT to spawn.

Surely I must be making an error somewhere, would anyone be able to help me? Ill put my "T8_missionEXEC.sqf" below:

/*

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

___ T8 Units _______________________________________________________________________________________________________

File: T8_missionEXEC.sqf

Author: T-800a

E-Mail: t-800a@gmx.net

This file creates the Units, kind of

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to

Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

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

*/

// We dont want players here

waitUntil { !isNil "T8U_var_useHC" };

private [ "_exit" ]; _exit = false;

if ( T8U_var_useHC ) then { if ( isDedicated ) then { _exit = true; } else { waitUntil { !isNull player }; if ( hasInterface ) then { _exit = true; }; }; } else { if ( !isServer ) then { _exit = true; }; };

if ( _exit ) exitWith {};

// check if T8_Units is loaded

waitUntil { !isNil "T8U_var_InitDONE" };

sleep 5;

////////////////////////////////////// CUSTOM FUNCTION //////////////////////////////////////

//

// This function is called for every unit in a group

// where it is defined in the groups definiton below

//

T8u_fnc_rmNVG_TEST =

{

_this spawn

{

sleep 5;

private ["_i"];

_i = true;

switch ( side _this ) do

{

case WEST: { _this unlinkItem "NVGoggles"; };

case EAST: { _this unlinkItem "NVGoggles_OPFOR"; };

case RESISTANCE: { _this unlinkItem "NVGoggles_INDEP"; };

default { _i = false; };

};

if ( _i ) then

{

_this removePrimaryWeaponItem "acc_pointer_IR";

_this addPrimaryWeaponItem "acc_flashlight";

sleep 1;

group _this enableGunLights "forceon";

};

};

};

////////////////////////////////////// UNIT SETUP //////////////////////////////////////

// Pre-defined Arrays for Groups ( group setup )

_smallGroup = ["I_soldier_F", "I_medic_F", "I_officer_F"];

_bigGroup = ["I_soldier_SL_F", "I_medic_F", "I_soldier_F", "I_soldier_AR_F", "I_soldier_TL_F", "I_soldier_F", "I_soldier_F", "I_soldier_LAT_F"];

// this groups of units are spawned directly at mission start

_SpawnChakChak=

[

[[_smallGroup, "markerChakChak"], ["PATROL_URBAN"]],

[[_smallGroup, "markerChakChak"], ["PATROL_URBAN"]],

[[_bigGroup, "markerChakChak"], ["GARRISON"]]

];

[ _SpawnChakChak ] spawn T8U_fnc_Spawn;

// this groups of units are spawned on demand with triggers created by a function -> T8U_fnc_Zone

// they are spawned when a WEST unit is near and they will be cached when no WEST unit is near

SpawnThisUnitsViaTrigger =

[

[ [ _groupArrayFullTeam, "MarkerByTrigger", "T8u_fnc_rmNVG_TEST" ], [ "DEFEND_BASE" ] ],

[ [ _groupArrayFireTeam, "MarkerByTrigger", "T8u_fnc_rmNVG_TEST" ], [ "PATROL_AROUND" ] ]

];

// [ _unitsArray, _marker, _distance, _condition, _actSide, _actType, _actRepeat, _onAct, _onDeAct ] call T8U_fnc_TriggerSpawn;

[ "SpawnThisUnitsViaTrigger", "MarkerByTrigger", 800, "this", "WEST", "PRESENT", false, "", "" ] call T8U_fnc_TriggerSpawn;

SpawnZonePU =

[

[ [ _groupArrayFireTeam, "MarkerZonePU", "T8u_fnc_rmNVG_TEST" ], [ "PATROL_AROUND" ] ],

[ [ _groupArrayT_APC, "MarkerZonePU", false ], [ "PATROL_URBAN" ] ]

];

// [ _unitsArray, _marker, _owner, _actSide, _distance, _condition, _onAct, _onDeAct ] call T8U_fnc_Zone

[ "SpawnZonePU", "MarkerZonePU", "EAST", "WEST" ] spawn T8U_fnc_Zone;

BLUFOR_attack_01 =

[

[ [ _groupArrayBluTeam, "BLUFOR_attack_spawn_01", true, WEST ], [ "ATTACK", "Marker04" ] ],

[ [ _groupArrayBluTeam, "BLUFOR_attack_spawn_01", true, WEST ], [ "ATTACK", "Marker04" ] ]

];

// im Radio-Trigger: [ BLUFOR_attack_01 ] spawn T8U_fnc_Spawn;

BLUFOR_attack_02 =

[

[ [ _groupArrayBluTeam, "BLUFOR_attack_spawn_02", true, WEST ], [ "ATTACK", "overwatchTHIS" ] ],

[ [ _groupArrayBluTeam, "BLUFOR_attack_spawn_02", true, WEST ], [ "ATTACK", "overwatchTHIS" ] ]

];

// im Radio-Trigger: [ BLUFOR_attack_02 ] spawn T8U_fnc_Spawn;

Changing the units back to the original CSAT ones works, but AAF ones dont.

EDIT: Never mind, i managed to get it working. The problem was in my "T8_UnitsCONFIG.sqf" - to get Independant side to spawn, you have to use "RESISTANCE" instead of "GUER", in this line:

"// standard side for spawned units

T8U_var_EnemySide = RESISTANCE; "

Awesome script, thanks for all the hard work :)

Edited by WalrusNZ
My own error in configuring script

Share this post


Link to post
Share on other sites

Seems like any units placed via MCC get deleted for some reason by this script. I would assume it attempts to control any units placed on the map. Probably should just leave them alone!!

This is easy to reproduce. Just spawn a group of units near the airport via MCC spawn function. Then teleport them near the Charkia marker.

Share this post


Link to post
Share on other sites

@WalrusNZ

glad you figured it out, you could also do sth. like this:

MyUnitContainer = 
[ 	
[ [ MyEastTeam, "MarkerEAST", EAST ], [ "PATROL" ] ],
[ [ MyWestTeam, "MarkerWEST", WEST ], [ "PATROL" ] ],
[ [ MyResiTeam, "MarkerRESI", RESISTANCE ], [ "PATROL" ] ],	
[ [ MyCiviTeam, "MarkerCivi", CIVILIAN ], [ "PATROL" ] ]	
];

this then will overwrite the basic setting from the config.

@Delta99

Sorry I have never used MCC, also the script should leave anything else alone/neither try to control anything else. I never had any trouble using it with DAC.

The only time I deleteVehicle is when I cache them, and those groups are checked for a variable added by my script. But I will look into this later.

Share this post


Link to post
Share on other sites
@WalrusNZ

glad you figured it out, you could also do sth. like this:

MyUnitContainer = 
[ 	
[ [ MyEastTeam, "MarkerEAST", EAST ], [ "PATROL" ] ],
[ [ MyWestTeam, "MarkerWEST", WEST ], [ "PATROL" ] ],
[ [ MyResiTeam, "MarkerRESI", RESISTANCE ], [ "PATROL" ] ],	
[ [ MyCiviTeam, "MarkerCivi", CIVILIAN ], [ "PATROL" ] ]	
];

this then will overwrite the basic setting from the config.

Oh awesome, that is exactly what I needed, thanks alot!

Edit: How would I use this in conjunction with the "spawn T8U_fnc_Zone" function for multiple sides in terms of caching the units when the zone is deactivated?

For example, in my mission i have 3 factions. Faction 1 is the player faction, Blufor, who i dont use the script on. Faction 2 and 3 are the AAF and CSAT, both AI only sides. So far i have managed to spawn both AI factions, however, i dont understand how to get the cache to work. In my unitsCONFIG.sqf i have T8U_var_EnemySide set to EAST, for spawning the CSAT guys.

They (the CSAT) cache just fine when the zone is deactivated, but for the AAF when i set the cache variable from EAST to RESISTANCE - eg ["unitsBastamAssault", "markerBastam_1", "RESISTANCE", "WEST", 1500] spawn T8U_fnc_Zone; I get an error telling me "There is a serious error in your T8U_fnc_Zone call" , and gives me back the code i gave as an example above. What am i doing wrong? Thanks again

Figured it out again, after paying closer attention to the documentation. It was the switch from RESISTANCE to GUER that threw me.

Edited by WalrusNZ
I suck at reading

Share this post


Link to post
Share on other sites

I cant understand how make that the script generate infinity or many times a squad, respawn this squad infinity times or chosen time that I written. How? please, help me ^_^

Share this post


Link to post
Share on other sites
I cant understand how make that the script generate infinity or many times a squad, respawn this squad infinity times or chosen time that I written. How? please, help me ^_^

Something like this?

// will spawn every 60 sec till the mission is ended
[] spawn 
{
  while { true } do
  {
     sleep 60;
     [ yourUnitContainer ] spawn T8U_fnc_Spawn;
  };
};

// will spawn every 60 sec till the mission mission time has passed 2400 sec
[] spawn 
{
  while { time < 2400 } do
  {
     sleep 60;
     [ yourOtherUnitContainer ] spawn T8U_fnc_Spawn;
  };
};

@Delta99

I loaded up MCC yesterday, was overwhelmed and didn't get anything to work as I want with it. But, if I spawn a group with regular Zeus they are not affected in any way.

Share this post


Link to post
Share on other sites

mmm nice but this script dont check if the units spawns was dead, I want that each squad respawn when died, how check the script that each squad declared was dead can respawn?

Share this post


Link to post
Share on other sites
@WalrusNZ

glad you figured it out, you could also do sth. like this:

MyUnitContainer = 
[     
   [ [ MyEastTeam, "MarkerEAST", EAST ], [ "PATROL" ] ],
   [ [ MyWestTeam, "MarkerWEST", WEST ], [ "PATROL" ] ],
   [ [ MyResiTeam, "MarkerRESI", RESISTANCE ], [ "PATROL" ] ],    
   [ [ MyCiviTeam, "MarkerCivi", CIVILIAN ], [ "PATROL" ] ]    
];

this then will overwrite the basic setting from the config.

@Delta99

Sorry I have never used MCC, also the script should leave anything else alone/neither try to control anything else. I never had any trouble using it with DAC.

The only time I deleteVehicle is when I cache them, and those groups are checked for a variable added by my script. But I will look into this later.

This ended up being an MCC bug after I looked at it again.

It seem that MCC was spawning units cached even though I asked it not to. So, when I placed them near the Charkia marker they cached / disappeared. I haven't noticed this before with MCC because usually units are spawned near me so even if they are marked for caching they don't because a player is near.

So, all is good as this was an MCC bug.

Share this post


Link to post
Share on other sites

I know this is entirely setup to spawn AI BUT it would be great to be able to apply your patrols, garrison etc etc on already placed units. Is this possible in some way calling a function deeper down in your code?

Share this post


Link to post
Share on other sites

How to hide a zone marker with this script?

Edited by Champ-1

Share this post


Link to post
Share on other sites
How to hide a zone marker with this script?

Also somewhat related, is there any way I can check to see if all the spawnable units in the zone have been killed, and from there change the colour of the marker? Using spawn T8U_fnc_Zone of course.

Share this post


Link to post
Share on other sites
mmm nice but this script dont check if the units spawns was dead, I want that each squad respawn when died, how check the script that each squad declared was dead can respawn?

Maybe work with a trigger that checks if an area is clear and then executes the spawn again?

How to hide a zone marker with this script?

try something like this in your init.sqf:

{ _x setMarkerAlpha 0; } count [ "marker_01", "marker_02", "marker_03" ];

Also somewhat related, is there any way I can check to see if all the spawnable units in the zone have been killed, and from there change the colour of the marker? Using spawn T8U_fnc_Zone of course.

Sorry, nothing implemented in the script that would do this.

I know this is entirely setup to spawn AI BUT it would be great to be able to apply your patrols, garrison etc etc on already placed units. Is this possible in some way calling a function deeper down in your code?

I have never tried it, but it should work for most of them. Have a look at the files in T8\T8_tasks\ those are the ones you will need.

Init of the gorub leader should be sth. like this:

fun = ( groub this ) spawn { waitUntil { !isNil "T8U_var_InitDONE" }; [ _this, "SomeMarker" ] spawn T8U_task_Patrol; };

fun = ( groub this ) spawn { waitUntil { !isNil "T8U_var_InitDONE" }; [ _this, "SomeMarker" ] execVM "T8\T8_tasks\patrol.sqf"; };

Edited by t-800a

Share this post


Link to post
Share on other sites

Hey I seem to be getting an odd issue with patrol garrison and patrol urban where sometimes groups will get waypoints to [0,0,0]. I'm not 100% sure whats causing it but 'patrol' doesn't seem to have the issue

EDIT: to clarify a bit, they will usually get one or two legit waypoints and then only waypoints to [0,0,0]

Share this post


Link to post
Share on other sites

For those two the script looks for nearby roads, and the waypoints are placed on those roads, maybe there is a problem finding those roads.

Could you make a screenshot of the marker placement / or send me your mission? Would make it easier to recreate the problem for me.

Share this post


Link to post
Share on other sites

Missed this script until God-Father pointed it out for me ! :) 

 

One quick question: has anyone tested it successfully on HC ?

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

×