Page MenuHomeFeedback Tracker

AISpawner garbage Collector Error
Closed, ResolvedPublic


If you create an AISpawner and later switch the Side and Faction
You get the following Error:

if !(|#|_group isEqualTo _groupPrev) then
Error undefined variable in expression: _group
File A3\Modules_F_Heli\Misc\ModuleSpawnAI\main.sqf, line 223"


Not A Bug
Operating System
Windows 10 x64
Operating System Version
Whatever the latest is. Updated nightly.
Steps To Reproduce

I setup a trigger to switch the "Side" and "Faction" on the spawner when the area is taken over by another team.
The following was placed in a trigger were it looked at a variable in a resupply box
if(resupplyBox getVariable "alphaOwner" == west)then{ao="West";alphaSpawner setVariable["Side","West"];alphaSpawner setVariable["Faction","BLU_F"];};
if(resupplyBox getVariable "alphaOwner" == east)then{ao="East";alphaSpawner setVariable["Side","East"];alphaSpawner setVariable["Faction","OPF_F"];};
The variable in the resupply box was changed by the zone when it changed sides using the following line in the expression
resupplyBox setVariable["alphaOwner", (_this select 1)];

Additional Information

The purpose of doing this was so I could use the spawners to build a zone controlled map and when a zone was taken over spawners inside the controlled area would no longer produce enemies.

I put other as the category because it is less of an AI issue and more of an issue with a module or resource management issue.

I put severity at Major because I'm not sure how often you did something like this in garbage collection.
Not sure if this might help you all or not but seems this system is a bit overly complex for what it does. I'll explain. You can set the despawn for cars , people and so on at different amounts. In truth then all one needs is the class of the object to have a type which it does already and a death time stamp. Then this should simply add those that die to a FIFO one maybe for vehicle and one for bodies.. Then simply check the time stamp against current time. If the time has been reached call the classes function to clean itself up and it.
in short I don't really care if the previous group was the same in garbage collection. just my two cents.

Event Timeline

GRHayes created this task.Nov 8 2017, 9:32 AM

Apparently the person who programmed this spawner didn't intend for variables to be changed after being placed in the map.
Changing ManpowerCap to 0 gets you the same error.

changing InfantryInGroup it simply ignores.

changing Infantry to 0 after start of mission gets you the same error above.

The spawner module reads all needed data from config when it is initialized. If you later change the input variables, you will break it as the modified data will not be compatible with the data retrieved from configs.

The reading and pre-processing of the config data in the init is done for performance reasons.

Wulf closed this task as Resolved.Nov 9 2017, 11:05 AM
Wulf claimed this task.
Wulf changed Resolution from Open to Not A Bug.Nov 10 2017, 8:37 AM

Thanks for the reply.
Please don't take this wrong. I spent several days before bothering to post the issue. During that time I searched through forums youtube videos and any place I could find information on them. I found 2 sets of youtube videos showing how to use them. Beyond that the vast majority of reading said one thing don't bother with them write your own spawners. The primary consensus is don't use them because you can't achieve what you need to with them.

The way they are now they are pretty much the end point of a mission. You can't go on beyond them without using deletevehicle on them. So unless you want someone to control a couple points for a few minutes then end the mission there is pretty much no use for them.

If everyone is writing their own spawners which you can find more than a few in addons well that efficiency you want to have well isn't there because it simply isn't getting used.