Turn on/off rendering of all entities with a specific flag/name/whatever
Posted: Wed Feb 20, 2019 6:16 am
Hello,
I am working on a mod that implements different layers of resources (e.g. shallow/mid/deep ore mining.)
I would like to be able to offer the player a way to switch between viewing different "depths" of ore deposits so that the screen isn't too cluttered at any given time, which means I need to be able to toggle on/off the visibility of entire classes of entity in a way that will not absolutely trash performance (so no iterating over the entire map and swapping out all ore entities for different ones...)
I would prefer this to be based off of a flag on the prototype, or the name of a prototype, or something like that - would it be possible to implement such a feature? Something like a RenderLayer that can be enabled/disabled from the GameScript or Surface would work just fine.
I am working on a mod that implements different layers of resources (e.g. shallow/mid/deep ore mining.)
I would like to be able to offer the player a way to switch between viewing different "depths" of ore deposits so that the screen isn't too cluttered at any given time, which means I need to be able to toggle on/off the visibility of entire classes of entity in a way that will not absolutely trash performance (so no iterating over the entire map and swapping out all ore entities for different ones...)
I would prefer this to be based off of a flag on the prototype, or the name of a prototype, or something like that - would it be possible to implement such a feature? Something like a RenderLayer that can be enabled/disabled from the GameScript or Surface would work just fine.