Jump to content
_RoosterCat_

Issue with SpawnAI Sector Tactic Module

Recommended Posts

Working on a Zeus v Zeus Sector control gamemode, and I'm using custom units that I've already added into the AISpawner and they spawn and function correctly. 

To give an example of my issue, there are 4 spawners. 2 for OPFOR 2 for Blufor.
1 Blufor spawner starts connected only to a sector tactics module, and spawn ai options module.
the other 3 spawners are connected to both previously mentioned modules, as well as a trigger with:

Type: none
Activation: none
repeatable

condition:
(Alpha getVariable "owner") == west;

This forces the 3 other spawners to wait until Alpha is captured by Blufor, then unlocks them and allows them to proceed as normal, locking them again if Opfor takes Alpha.

All that is working well, and even works with multiple sectors. My problem is, I have the sectors on an "unlock" feature for Blufor only, so the only sector that shows up is A on the right side of the screen, until it is captured by Blufor. 
Sector > Unlock > Trigger > Sector for anyone wondering how I had that set up.
The screen goes black upon the unlock, which I read was normal, then B and C are visible in the top right where sectors usually are but for some reason both Blufor spawners stop trying to capture the now available Beta and Charlie sectors.
Opfor spawners work as intended and unlock, and begin spawning in units that charge sector A.

Things I've tested:

  1. Redoing all my modules and triggers used
  2. Connecting separate Sector Tactics module to the trigger mentioned before and using deleteVehicle "x" to delete the previous sector tactic. 
    -in doing this, I noticed Opfor continued charging Alpha, but neither Blufor spawners did anything aside from spawn in units that stood around.


Anything I can do to resolve this? I want dynamic spawners that aren't too close to the sectors, but it seems like the sector tactic module breaks for Blufor after B and C are unlocked.
 

Share this post


Link to post
Share on other sites

Here are some missionNamespace variables you can check to see what is happening.


bis_fnc_moduleSpawnAISectorTactic_sectors

A list of sectors the Tatic module is currently monitoring

 

bis_fnc_moduleSpawnAISectorTactic_areas

A list of sector areas the Tactic module holds for all sectors

 

bis_fnc_moduleSpawnAISectorTactic_sectorsWest
bis_fnc_moduleSpawnAISectorTactic_sectorsEast
bis_fnc_moduleSpawnAISectorTactic_sectorsGuer

A list of sectors the Tactic module currently considers captured by side


bis_fnc_moduleSpawnAISectorTactic_sectorsNonWest
bis_fnc_moduleSpawnAISectorTactic_sectorsNonEast
bis_fnc_moduleSpawnAISectorTactic_sectorsNonGuer
bis_fnc_moduleSpawnAISectorTactic_sectorsUnknown

 

_group setVariable ["bis_objective",_objective,true]

Each group has a variable set on them of their current sector they are to attack.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for your response. After testing some more if I don't have the first Blufor spawner, I receive this error: https://imgur.com/a/q9BpDg4 but am unable to expand upon the error yet.

Sorry I have some decent experience with scripting in Arma but new to BIS_FNC type codes, where would I put those lines/how would I use them? I tried googling before but I didnt see anything related(still actively looking).

If I can figure out how to use these, maybe I can use  BIS_fnc_exportCuratorCostTable to further define my mission. I tried before but couldn't piece it together.

Share this post


Link to post
Share on other sites

So after some experimentation I was able to get [] spawn BIS_fnc_exportCuratorCostTable to work using init.sqf(learned how to add those to mission files) and now have been able to actually create a curator cost table... Working my way up!!!


Update: Still trying to get CostTable to grab the modded info not just base game... I'll get it eventually lol

Share this post


Link to post
Share on other sites

Still haven't figured out how to exactly use "bis_fnc_moduleSpawnAISectorTactic_'x' " functions. and on the website https://community.bistudio.com/wiki/Category:Arma_3:_Functions I only see BIS fnc moduleSpawnAISectorTactic which the Syntax used is

[] call BIS_fnc_moduleSpawnAISectorTactic. I've tried using this in triggers and init script but can't piece it together fully

Share this post


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

Still haven't figured out how to exactly use "bis_fnc_moduleSpawnAISectorTactic_'x' " functions

They are not functions.

On 10/17/2023 at 4:00 PM, Larrow said:

Here are some missionNamespace variables you can check to see what is happening.

They are variables associated with the function that lets you see the current values stored by the module/system. Type them into the watch lines of the debug console in a running mission to see what they currently hold and may give you a lead on what is happening.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you again for your responses and helping me understand. Let us begin with all the values now that I understand how to plug them in.

 

Mission start:
 

bis_fnc_moduleSpawnAISectorTactic_sectors                    = [Alpha]
bis_fnc_moduleSpawnAISectorTactic_areas                        = [L Alpha 1-2:41]
 

bis_fnc_moduleSpawnAISectorTactic_sectorsEast            = [Alpha]
bis_fnc_moduleSpawnAISectorTactic_sectorsWest           = []
bis_fnc_moduleSpawnAISectorTactic_sectorsGuer           = []
 

bis_fnc_moduleSpawnAISectorTactic_sectorsNonWest   = [Alpha]
bis_fnc_moduleSpawnAISectorTactic_sectorsNonEast    = []
bis_fnc_moduleSpawnAISectorTactic_sectorsUnknown  = [Alpha]
bis_fnc_moduleSpawnAISectorTactic_sectorsNonGuer   = [Alpha]

 

Upon capturing Alpha:
 

bis_fnc_moduleSpawnAISectorTactic_sectors                 = [Alpha, Charlie, Beta]
bis_fnc_moduleSpawnAISectorTactic_areas                     = [L Alpha 1-2:41]
 

bis_fnc_moduleSpawnAISectorTactic_sectorsWest     = [Alpha]
bis_fnc_moduleSpawnAISectorTactic_sectorsEast     = []
bis_fnc_moduleSpawnAISectorTactic_sectorsGuer    = []
 

bis_fnc_moduleSpawnAISectorTactic_sectorsNonWest    = []
bis_fnc_moduleSpawnAISectorTactic_sectorsNonEast     = []
bis_fnc_moduleSpawnAISectorTactic_sectorsUnknown    = []
bis_fnc_moduleSpawnAISectorTactic_sectorsNonGuer    = [Alpha]


 

If I remove the initial spawner that isnt set to a trigger, I then recieve this error: https://imgur.com/a/uypiGoK

((Edit: line 167 is private["_area","_triggers"]; in the config code) and I don't understand how it has an undefined variable..)


But then whenever capturing alpha without initial spawner:

bis_fnc_moduleSpawnAISectorTactic_sectorsNonEast   = [Alpha] 


I decided to take the testing a bit further and capture Charlie, even though it doesnt show up for 
bis_fnc_moduleSpawnAISectorTactic_sectorsEast     = [] and it didnt change any of the above values.

Something about the initial spawner prevents East from attempting to recapture if they're locked behind triggers and unlocks?
How could I work around this?

Also it appears that even though they are being identified with bis_fnc_moduleSpawnAISectorTactic_sectors, none of the sectors are being slotted into the corresponding group, since East should start out owning the sector.

 

Quote

_group setVariable ["bis_objective",_objective,true]



Also I've tried plugging this into the expression slot of it and that didn't work, do I need to define _group in the init.sqf? I also tried plugging it into the debug, interchanging "bis_objective" for the objective name but got nothing returned. Thank you again

Share this post


Link to post
Share on other sites

looking in the code I see 
 

Quote

_initialized     = missionNamespace getVariable ["bis_fnc_moduleSpawnAISectorTactic_initialized",false];

//make sure the module script runs only once
if (_initialized) exitWith {}; missionNamespace setVariable ["bis_fnc_moduleSpawnAISectorTactic_initialized",true];

 

 So what I'm thinking is that the script only runs once at the very beginning of the mission(as stated above), which calls Alpha to be the only sector as the rest are locked and hidden from view until unlock. 

What confuses me is that bis_fnc_moduleSpawnAISectorTactic_sectors  calls each sector upon the triggered unlock but none of the others do.

I'm thinking of a possible work around I'm going to try to re-initialize the script every time one of the triggers used goes off. [Didnt work with what I attempted yet]

Do you know of any way to have it collect all of the sector information at once, even with the unlocks?

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

×