Change Entity Sprite Based Upon Property Value
Change Entity Sprite Based Upon Property Value
I'm working on making a mod wherein I would like to change the sprite based upon whether the entity energy level is full, empty, or partial. Is there some way to determine the percent of energy filled and change what sprite is used based upon that value? I'm not familiar enough with LUA specifically to know if it's just a matter of syntax or not.
Re: Change Entity Sprite Based Upon Property Value
Accumulators can have different animmations based on whether it's discharging or standing.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
-
- Filter Inserter
- Posts: 841
- Joined: Mon Sep 14, 2015 7:40 am
- Contact:
Re: Change Entity Sprite Based Upon Property Value
I believe the Nixie Tubes mod was forced to hack this in using a "car"-type entity and adjusting the rotation-property based on inputs.
Re: Change Entity Sprite Based Upon Property Value
I know that, but that's not what I was looking for. I was looking more at non-(dis)charging states.Adil wrote:Accumulators can have different animmations based on whether it's discharging or standing.
Re: Change Entity Sprite Based Upon Property Value
I'm thinking now maybe if I add some max values to the mod global, and then compare the current value for "energy" to that max value during on_tick, it might work.Supercheese wrote:I believe the Nixie Tubes mod was forced to hack this in using a "car"-type entity and adjusting the rotation-property based on inputs.
Re: Change Entity Sprite Based Upon Property Value
Well, my idea didn't work, and I'm not certain how the Nixie Tubes mod does what it does. Well, I understand part of it, just don't get how they make it work as a "car".