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

  • Thanks 2
  • 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 1

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 ?

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

×