Page 1 of 1
Change Entity Sprite Based Upon Property Value
Posted: Wed Jun 08, 2016 6:11 pm
by ledzilla
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
Posted: Wed Jun 08, 2016 8:32 pm
by Adil
Accumulators can have different animmations based on whether it's discharging or standing.
Re: Change Entity Sprite Based Upon Property Value
Posted: Wed Jun 08, 2016 9:30 pm
by Supercheese
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
Posted: Thu Jun 09, 2016 12:13 am
by ledzilla
Adil wrote:Accumulators can have different animmations based on whether it's discharging or standing.
I know that, but that's not what I was looking for. I was looking more at non-(dis)charging states.
Re: Change Entity Sprite Based Upon Property Value
Posted: Thu Jun 09, 2016 12:15 am
by ledzilla
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.
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.
Re: Change Entity Sprite Based Upon Property Value
Posted: Sat Jun 11, 2016 4:14 am
by ledzilla
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".