Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate possible problem with Zeus slots not allowing objects to be placed #342

Closed
NikkoJT opened this issue Apr 23, 2021 · 6 comments
Closed

Comments

@NikkoJT
Copy link
Collaborator

NikkoJT commented Apr 23, 2021

https://discord.com/channels/101479298812121088/277196621908017162/833464791346446336

Investigation is underway. Still unclear whether this can be resolved F3-side, will update with further news.

@NikkoJT NikkoJT added T:Bug S0:Needs Investigation Bug that requires investigation to determine cause labels Apr 23, 2021
@NikkoJT NikkoJT added this to the 3.5.X milestone Apr 23, 2021
@NikkoJT
Copy link
Collaborator Author

NikkoJT commented Apr 25, 2021

Initial testing strongly suggests that the problem is located in f_fnc_zeusAddAddons.sqf.

If nothing in that file is actually required, my preliminary recommendation is to drop that function and instead use the editor zeus module attributes to allow all addons.

@NikkoJT NikkoJT modified the milestones: 3.5.X, 3.5.6 Apr 27, 2021
@NikkoJT
Copy link
Collaborator Author

NikkoJT commented May 3, 2021

Further testing has confirmed that the problem is located in f_fnc_zeusAddAddons.sqf.

That file does exactly 2 things, both of which can be done in the editor, so in the interests of making Zeus usable again the expedient plan appears to be to do that.

@SamLex
Copy link
Member

SamLex commented May 3, 2021

I've been out of this for far too long and not experienced this issue personally so not wanting to interfere, but wanted to share some finding for a dig into this today.

The Zeus module initialisation function uses nearly identical code to f_fnc_zeusAddAddons.sqf for "all addons including unofficial ones". And in local testing the results of curatorAddons and activedAddons are the same with the module dropdown set + the script commented out and f_fnc_zeusAddAddons.sqf.
image

f_fnc_zeusAddAddons.sqf however does set the "Addons" variable that is used by the module initialisation code. It is also called from f_fnc_zeusInit.sqf with spawn. Further, since f_fnc_zeusInit.sqf is run from the object initialisation field of the Zeus/Curator modules it is run before the module itself is initialised as per Initialisation Order.

This leads to the possibility that f_fnc_zeusAddAddons.sqf and the module initialisation run at the same time, and interfere with each other in weird ways.

My suggestion would be to change f_fnc_zeusAddAddons.sqf to work with the module initialisation, rather than duplicate its behaviour, and change how f_fnc_zeusAddAddons is called to ensure it runs before the module initialisation. Something like:

Change these to call

[_curator,_addons] spawn f_fnc_zeusAddAddons;
//Add desired objects
[_curator,_objects] spawn f_fnc_zeusAddObjects;

Remove this line since it overrides the module dropdown in the ARRAY and STRING cases

_curator setVariable ["Addons",0,true];

Change these to only set the Addons variable. This is equivalent to setting the dropdown in the module

if (_mode) then {
_curator setVariable ["Addons",3,true];
// If true was passed, add all available addons to curator list
_cfgPatches = configfile >> "cfgpatches";
for "_i" from 0 to (count _cfgPatches - 1) do {
_class = _cfgPatches select _i;
if (isclass _class) then {_addons pushBack (configname _class);};
};
_addons call bis_fnc_activateaddons;
removeallcuratoraddons _curator;
} else {
_curator setVariable ["Addons",0,true];
removeallcuratoraddons _curator;
};

These changes should have the same effect as changing the module dropdown to "all addons including unofficial" but is done in code which helps with updating older missions. We could also change the template to have that dropdown set by default to be extra sure.

@NikkoJT
Copy link
Collaborator Author

NikkoJT commented May 3, 2021

Thanks for the input, Lexer. I will arrange for your possible fix to be tested next session.

@SamLex
Copy link
Member

SamLex commented May 3, 2021

Thanks Nikko. I plan to attend session again myself soon, but probably best if this is tested by someone familiar with the issue.

I can raise a PR with this fix if it seems to be working

@NikkoJT
Copy link
Collaborator Author

NikkoJT commented May 24, 2021

Resolved in 3.5.6; #348 remains active.

@NikkoJT NikkoJT closed this as completed May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants