-
-
Notifications
You must be signed in to change notification settings - Fork 516
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
Allow components/structures to be made unavailable #3785
base: master
Are you sure you want to change the base?
Conversation
I gave my PR another look over (self-review), it all seems good. |
This has been tested, and works for me. |
Re-tested more thoroughly. It is broken a bit, see OP for details. |
I don't plan on fixing these issues any time soon (i frankly don't know how). So if anyone wants to do it go right ahead. It would be nice to get this PR into v4.5.0. Thanks. See #3799 for more info. |
Attempts to fix these issues: When a component is made unavailable, any queued units with that component will remain in the production menu and will only be cleared upon re-opening the menu if there is only 1 queued, otherwise the "ghost" template will remain until unqueued. An error is given when the game attempts to produce the unit: "Machinegun Viper Half-tracks : not researched weapon 0", "Wrong template for player 0 factory, type 1".
This reverts commit da013b7.
Clean up `makeComponentUnavailable` function.
…e2100_Dev into make_unavailable
Attempt to fix issues (again).
Description:
Modders need the ability to remove/make-unavailable components and structures, both through the API and through research.
Adds
removedComponents
andremovedStructures
toresearch.json
.Adds
disableStructure
andmakeComponentUnavailable
to the API.Why it is needed:
Making things redundant isn't always good enough. Lets say you want to add Mk2/Mk3 propulsions, you don't want the objectively inferior versions showing up at all, especially if they share the same exact name. Another example, going from Scavenger tech to Military tech, you don't want the inferior Scavenger stuff showing up at all.
Additional information:
I am a newb at C++, so there may be some big or small problems.
Fixes: #3776
Issues that need to be resolved:
See #3799.