AFX2 TGEA181 Bugs: Saving Mission Also Saves Some Spells
If you are running AFX effects during the same session you edit a mission, there are some cases where a spell or effectron object will be saved as part of the mission when it is saved, and this is not normally what you would want.
Starting with AFX 2.0, MagicSpells and Effectrons can be created using the TorqueScript "new" operator instead of the console functions castSpell() and startEffectron(). However, where spells and effectrons created using the console functions are explicitly added to the "MissionCleanup" group, those created using the "new" operator are placed in a group determined by the variable, $instantGroup.
The variable $instantGroup often points to "MissionCleanup" on the server, but when the mission editor is opened, $instantGroup is changed to "MissionGroup" and it stays that way even after the mission editor is closed. "MissionGroup" is the group that determines what the mission editor saves as part of a mission. This means that any AFX effects created via the "new" operator after doing some mission editing will get added to "MissionGroup" rather than "MissionCleanup". If any of these effects are still active when the mission is saved, they'll get saved as part of the mission.
A current workaround to this problem is to explicitly add any spell or effectron created via "new" to a different group, as in this example:
%spell = new afxMagicSpell() {
datablock = SomeMagicSpellDatablock;
};
MissionCleanup.add(%spell);
Note -- this is not really a problem unless you find it necessary to run effects during your mission editing sessions.