fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

FR: Add scripting function to recalculate loadout counts

Open JohnAFernandez opened this issue 3 years ago • 2 comments

There should be a way for FSO to be forced to recalculate loadout values, so that if a script updates sexp variables, it can be reflected in the loadout screen. Currently, the variables cannot be updated at the right time to change loadout values.

Alternatively, we could allow direct control over the values. It all depends on the effort the developer wants to put in.

JohnAFernandez avatar Jun 06 '22 19:06 JohnAFernandez

This is a feature absolutely required by BtA.

MjnMixael avatar Jun 06 '22 19:06 MjnMixael

Chatting with @JohnAFernandez, and it seems like a way to do this is by adding a hook at line 518 of missionscreencommon.cpp, that, in thinking, should allow modifications after everything else is loaded. Will examine after stable is completed.

wookieejedi avatar Jun 07 '22 15:06 wookieejedi

Adding a hook there didn't quite work. The loadout seems to actually be built during mission parse, so missionscreencommon.cpp was too late. A hook in missionparse.cpp just before loadout calculations begin is what was required in my testing. PR soon.

MjnMixael avatar Aug 18 '22 16:08 MjnMixael