Jump to content
Marvinn2002

Activate and Desactivate AI Spawn Module with Sectors

Recommended Posts

Im trying to create a AI Spawn Module, but i dont know how to put a condition between the Sector and Ai Spawn



Im the practice is something about that example:

BLUFOR captured Sector A>Sector A activate a AI spawn module for BLUFOR in the same area>OPFOR captured Sector B>Sector A removes the AI spawn module(but dont delete entire AI) and put AI OPFOR

Someone knows how to do that?

I don't have a idea to how implement that in Eden Editor
 

  • Like 1

Share this post


Link to post
Share on other sites

Place a sector as normal, connectiing side logics for sides that can capture the sector (ie Blufor and Opfor) etc. Then once you have your standard sector setup..

  • Place a systems > logic entities > misc > unlock and sync it to the sector
  • Place a triggers > trigger, do nothing to it other than...
    • Set activation to Blufor
    • Tick repeatable
    • Sync the trigger to the unlock you created above
  • Place a systems > modules > other > SpawnAI, fill out any attributes you want (side and faction being Blufor) and sync it to the trigger you created above

Repeat the setup above for the opposite side making sure the triggers activation and spawnAI are set to Opfor.

 

When a side captures the area the SpawnAI module that is synced to the the unlock trigger that has an activation of said side will start to spawn units. If the sector is captured by the opposite side their SpawnAI module will start to spawn units and the opposite side will stop.

TEST_MISSION

  • Like 2
  • Thanks 5
  • Confused 1

Share this post


Link to post
Share on other sites

Thanks man, can you help me in this question about AI Spawn Module??

@Larrow

Im trying to spawn AI with some custom loadouts with this system.

What i did?

I put in the expression this:

group execVM "loadoutIA.sqf";

loadoutIA.sqf

params[ "group", "module", "groupData" ];

waitUntil {!isNull player};

_unit = group select 0;
/* Seleção Aleatória De Items */

_cloth = ["pika","mao","legalize","lacoste1","flamengo","U_I_C_Soldier_Bandit_4_F","U_C_Poloshirt_blue","U_I_C_Soldier_Bandit_5_F"] call BIS_fnc_selectRandom;    //Select Random Cloth
_hat = ["H_Cap_surfer","H_Cap_khaki_specops_UK","H_Bandanna_surfer","",""] call BIS_fnc_selectRandom;
_vest = ["V_HarnessO_gry","V_TacVest_brn","V_TacVest_blk",""] call BIS_fnc_selectRandom;
_backpack = ["CUP_B_Bergen_BAF","","",""] call BIS_fnc_selectRandom;
_glass = ["G_Shades_Green","G_Shades_Blue","G_Shades_Red","G_Shades_Black","G_Bandanna_shades",""] call BIS_fnc_selectRandom;

  /* Remove Items */
removeAllWeapons _unit;
removeAllItems _unit;
removeAllAssignedItems _unit;
removeUniform _unit;
removeVest _unit;
removeBackpack _unit;
removeHeadgear _unit;
removeGoggles _unit;

/* Add Items */
_unit forceAddUniform _cloth;
_unit addVest _vest;
_unit addBackpack _backpack;
_unit addHeadgear _hat;
_unit addGoggles _glass;
_unit addItemToUniform "ACE_EarPlugs";
_unit addItemToUniform "TFAR_anprc152";
_unit addItemToUniform "ACE_morphine";
_unit addItemToUniform "ACE_salineIV_250";
for "_i" from 1 to 2 do {_unit addItemToVest "ACE_fieldDressing";};


_unit linkItem "ItemMap";
_unit linkItem "ItemCompass";
_unit linkItem "ItemWatch";
_unit linkItem "ItemRadio";
_unit linkItem "ItemGPS";

_unit setFace "PersianHead_A3_01";
_unit setSpeaker "male01per";

if(true) exitWith{};

And the editor answers this error:
 

Quote

Error: local variable in global space


Do you know how to fix that??

Thanks for the system.

Share this post


Link to post
Share on other sites

Expression

_this execVM "loadoutIA.sqf";

loadoutIA.sqf

params[ "_group", "_module", "_groupData" ];

//The below will make each unit in the group have the same random equipment
//Or move it below to //HERE - to make each unit in the group have different equipment
_cloth = selectRandom ["pika","mao","legalize","lacoste1","flamengo","U_I_C_Soldier_Bandit_4_F","U_C_Poloshirt_blue","U_I_C_Soldier_Bandit_5_F"];
_hat = selectRandom ["H_Cap_surfer","H_Cap_khaki_specops_UK","H_Bandanna_surfer","",""];
_vest = selectRandom ["V_HarnessO_gry","V_TacVest_brn","V_TacVest_blk",""];
_backpack = selectRandom ["CUP_B_Bergen_BAF","","",""];
_glass = selectRandom ["G_Shades_Green","G_Shades_Blue","G_Shades_Red","G_Shades_Black","G_Bandanna_shades",""];

{
	_x params[ "_unit" ];

	//HERE

	/* Remove Items */
	removeAllWeapons _unit;
	removeAllItems _unit;
	removeAllAssignedItems _unit;
	removeUniform _unit;
	removeVest _unit;
	removeBackpack _unit;
	removeHeadgear _unit;
	removeGoggles _unit;

	/* Add Items */
	if !( _cloth == "" ) then {
		_unit forceAddUniform _cloth;
		{
			if ( _unit canAddItemToUniform _x ) then {
				_unit addItemToUniform _x;
			};
		}forEach [
			"ACE_EarPlugs",
			"TFAR_anprc152",
			"ACE_morphine",
			"ACE_salineIV_250"
		];
	};

	if !( _hat == "" ) then {
		_unit addHeadgear _hat;
	};

	if !( _vest == "" ) then {
		_unit addVest _vest;
		for "_i" from 1 to 2 do {
			if ( _unit canAddItemToVest "ACE_fieldDressing" ) then {
				_unit addItemToVest "ACE_fieldDressing";
			};
		};
	};

	if !( _backpack == "" ) then {
		_unit addBackpack _backpack;
	};

	if !( _glass == "" ) then {
		_unit addGoggles _glass;
	};

	_unit linkItem "ItemMap";
	_unit linkItem "ItemCompass";
	_unit linkItem "ItemWatch";
	_unit linkItem "ItemRadio";
	_unit linkItem "ItemGPS";

	[ _unit, "PersianHead_A3_01" ] remoteExec [ "setFace", 0, _unit ];
	[ _unit, "male01per" ] remoteExec [ "setSpeaker", 0, _unit ];

}forEach units _group;

 

  • Like 2

Share this post


Link to post
Share on other sites
On 6/12/2018 at 6:32 AM, Larrow said:

Place a sector as normal, connectiing side logics for sides that can capture the sector (ie Blufor and Opfor) etc. Then once you have your standard sector setup..

  • Place a systems > logic entities > misc > unlock and sync it to the sector
  • Place a triggers > trigger, do nothing to it other than...
    • Set activation to Blufor
    • Tick repeatable
    • Sync the trigger to the unlock you created above
  • Place a systems > modules > other > SpawnAI, fill out any attributes you want (side and faction being Blufor) and sync it to the trigger you created above

Repeat the setup above for the opposite side making sure the triggers activation and spawnAI are set to Opfor.

 

When a side captures the area the SpawnAI module that is synced to the the unlock trigger that has an activation of said side will start to spawn units. If the sector is captured by the opposite side their SpawnAI module will start to spawn units and the opposite side will stop.

TEST_MISSION

Hey, I am wanting to do mothing quite a lot more overly complicated than this, which would be to:

 

1 have the AI spawn only work if the sector is captured by its team (I.E. if "X side" does not own the sector its AI can not spawn in a given point)

2 have the AI spawn only work if there are no entities of other (hostile) sides (I.E. BLUFOR AI can only spawn in said point if there are neither GUER nor OPFOR units present in a given area [likely needs to be done with a trigger for each side/faction])

 

It is because I once had a mission where I fought a constant CSAT VIPER spawn point right in front of me, less than 150 meters away, with at least around 8 Viper soldiers appearing every spawn (which was at most every 30 seconds apart from each other), and on top of that I was still blamed for myself ending up going down... So I kinda of got some PTSD from this terribly awlful experience.

Share this post


Link to post
Share on other sites
20 hours ago, LuizBarros99 said:

1 have the AI spawn only work if the sector is captured by its team (I.E. if "X side" does not own the sector its AI can not spawn in a given point)

2 have the AI spawn only work if there are no entities of other (hostile) sides (I.E. BLUFOR AI can only spawn in said point if there are neither GUER nor OPFOR units present in a given area [likely needs to be done with a trigger for each side/faction])

Something like THIS ?

  • Thanks 1

Share this post


Link to post
Share on other sites
On 7/17/2019 at 7:47 AM, Larrow said:

Something like THIS ?

OMFG, That is EXACTLY what I was after! (RN it is nearly midnight, so tomorrow I will test it more in depth, specifically trying to make it work with multiple sectors in a similar fashion to the mission I made in my STEAM WS)
Also onto something else, how could I do something similar, but a lot simpler for PLAYER spawns? To be precise: The scenario that I have is that once the "logistics things" of an airbase are destroyed, this causes the conditions of a trigger to be met and it gets triggered to activate a "set Task status" module. But I would like to have this same trigger also disable the player spawn.
I bet that if I were to properly comprenhend the system that you made, I would likely be able to get this done. But I am still very unfamiliar with all of the ArmA modules (specially the logic ones). Not to mention that I am still almost analphabet in relation to scripting. Which talking about it, I could imagine this being done with the "On Activation" parameter, but I would have to try countless options such as stuff like "deleteVehicle" and the Var name of the spawn module.

Edited by LuizBarros99
tried to remove the strikethrough that I added by mistake...

Share this post


Link to post
Share on other sites
22 hours ago, LuizBarros99 said:

how could I do something similar, but a lot simpler for PLAYER spawns? To be precise: The scenario that I have is that once the "logistics things" of an airbase are destroyed, this causes the conditions of a trigger to be met and it gets triggered to activate a "set Task status" module.

Are you using BIS respawn system? Should be as simple a placing a respawnPosition module and syncing to a trigger, something like TEST.

Share this post


Link to post
Share on other sites
20 hours ago, Larrow said:

Are you using BIS respawn system? Should be as simple a placing a respawnPosition module and syncing to a trigger, something like TEST.

Oh, so when the trigger is active it allows to spawn, and once deactivated it disables? Or is it the other way around?

Share this post


Link to post
Share on other sites
1 hour ago, LuizBarros99 said:

Oh, so when the trigger is active it allows to spawn, and once deactivated it disables? Or is it the other way around?

If I need the trigger to become disabled in order to "turn off" the spawn point, I bet that I could just copy the trigger and replace the "!alive" with "alive". So that once the units are no longer alive the trigger deactivates, and (hopefully) also deactivates the spawn point synced to it

EDIT: Now I realised that I would need to change the condition from an "alive 'x' && alive 'y'" condition to something like an "alive 'x' or alive 'y'" condition, as having the "&&" would cause the spawn to be disabled as soon as the first unit gets taken out...

Edited by LuizBarros99
Now I realised that I would need to change the condition

Share this post


Link to post
Share on other sites
On 8/25/2019 at 11:21 PM, Larrow said:

Are you using BIS respawn system? Should be as simple a placing a respawnPosition module and syncing to a trigger, something like TEST.

Yes, it would be about what you did. The only minor issue that I ran into is that there are multiple logistics entities, but I can only set a single owner for a trigger. See the picture as a reference:

 AirBaseLogistics.png

Edited by LuizBarros99
Edited it so that the picture is under "reference" (AKA looks a bit prettier)

Share this post


Link to post
Share on other sites

I'm testing using something like "alive INDLOG_01 or alive INDLOG_02 or alive INDLOG_03 or alive INDTRUC_01 or alive INDTRUC_02 or alive INDTRUC_03" as the activation condition for the trigger, and synce it to the spawn modules. Now I will test it.

Share this post


Link to post
Share on other sites
14 minutes ago, LuizBarros99 said:

I'm testing using something like "alive INDLOG_01 or alive INDLOG_02 or alive INDLOG_03 or alive INDTRUC_01 or alive INDTRUC_02 or alive INDTRUC_03" as the activation condition for the trigger, and synce it to the spawn modules. Now I will test it.

 

On 8/25/2019 at 11:21 PM, Larrow said:

Are you using BIS respawn system? Should be as simple a placing a respawnPosition module and syncing to a trigger, something like TEST.

 

This worked like wonders when using the trigger synced to the spawn module. Thanks for giving me the heads up to make it as a trigger sync-ed to the spawn module.

  • Like 1

Share this post


Link to post
Share on other sites
On 8/28/2019 at 7:01 AM, LuizBarros99 said:

Yes, it would be about what you did. The only minor issue that I ran into is that there are multiple logistics entities, but I can only set a single owner for a trigger. See the picture as a reference:

 AirBaseLogistics.png

I'm thinking about making a trigger that the condition is basically "one of the logistic items/entity" being alive, by basically doing a "alive 'x'" for each of the entities, so that if at least one of them is not destroyed, then the trigger is still activated (and the spawn should hopefully still work)

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

×