Page 1 of 1
Allow changing the hidden field at runtime
Posted: Sat Jan 04, 2025 6:44 am
by IsaacOscar
Bassically, it would be great if you could set the hidden field (
https://lua-api.factorio.com/latest/cla ... tml#hidden) at runtime. (Similarly with hidden_in_factoriopedia).
Perhaps it could also be set per player or per force?
The idea being that mods can hide stuff from all the GUIs until they are actually useful for players (so as to not clutter the GUI or give spoilers).
Re: Allow changing the hidden field at runtime
Posted: Sun Feb 02, 2025 6:58 pm
by binaryDiv
I think this would be really useful!
I'm currently working on a mod that hides military technologies and recipes that aren't useful when playing in peaceful mode. I first thought about disabling (enabled=false) instead of hiding the technologies, which can be done at runtime, but hiding is the much cleaner way to do this (e.g. you can remove the mod and its changes will be automatically undone, which isn't possible when setting "enabled=false").
For some technologies and recipes it could be useful to dynamically enable them during runtime, though.
Re: Allow changing the hidden field at runtime
Posted: Tue Feb 04, 2025 4:45 pm
by protocol_1903
+1, would be very useful for mods that change entities and the like at runtime to operate differently. So there's less confusion about which is which and what the player can actually use
Re: Allow changing the hidden field at runtime
Posted: Tue Feb 04, 2025 5:38 pm
by curiosity
binaryDiv wrote: Sun Feb 02, 2025 6:58 pm
I'm currently working on a mod that hides military technologies and recipes that aren't useful when playing in peaceful mode. I first thought about disabling (enabled=false) instead of hiding the technologies, which can be done at runtime, but hiding is the much cleaner way to do this (e.g. you can remove the mod and its changes will be automatically undone, which isn't possible when setting "enabled=false").
You do realize that if hidden becomes a state, it won't be undone on mod removal either?
Re: Allow changing the hidden field at runtime
Posted: Wed Feb 05, 2025 8:53 pm
by Rseding91
Sorry but this is not going to be done. Prototype values are immutable after startup and anything runtime which wants to be mutable has to make a copy, and save/load it. The entire game is built on top of this principle and it won't be changing.