Storage tanks window

Place to get help with not working mods / modding interface.
User avatar
pyanodon
Smart Inserter
Smart Inserter
Posts: 1909
Joined: Wed Apr 20, 2016 4:42 pm
Contact:

Storage tanks window

Post by pyanodon »

Hello!

I was talking with Nexela about the possibility of have a building similar to the storage tank, but until now we dont know if it´s possible. The idea is have a building where the sprite advance one frame or go back by the amount of fluid inside it. Pretty similar to the storage tank window which "fill" with the amount of liquid, is it possible or a no-no for a noob modder as me? :D
pY Coal processing mod
Discord: Pyanodon #5791
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Storage tanks window

Post by aubergine18 »

Instead of a window showing fluid, could you use a health bar? So add an entity that has a transparent sprite, and then set it's health percentage based on the fill percentage of the storage tank?

Or are you trying to make the whole building change sprite based on fill level? Like those that move upwards as they fill and then down as their contents are drained? If so, maybe a tank sprite (like a vehicle tank) as that can have 16 sprites (at least) set by direction/orientation of the vehicle. Turrets have up to 64 directions. It would need some coding, but nothing too difficult.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
User avatar
pyanodon
Smart Inserter
Smart Inserter
Posts: 1909
Joined: Wed Apr 20, 2016 4:42 pm
Contact:

Re: Storage tanks window

Post by pyanodon »

aubergine18 wrote:Instead of a window showing fluid, could you use a health bar? So add an entity that has a transparent sprite, and then set it's health percentage based on the fill percentage of the storage tank?

Or are you trying to make the whole building change sprite based on fill level? Like those that move upwards as they fill and then down as their contents are drained? If so, maybe a tank sprite (like a vehicle tank) as that can have 16 sprites (at least) set by direction/orientation of the vehicle. Turrets have up to 64 directions. It would need some coding, but nothing too difficult.

I think the second idea is what i mean. Sorry people for my english, i did a image to help what i wanted to say (of course wont be a cup XD).

Image

You said it´s possible with some coding, what coding we´re talking about? The vehicle tank sprite indeed have 16 sprites but the idea is to not change direction, just change the sprite.
pY Coal processing mod
Discord: Pyanodon #5791
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: Storage tanks window

Post by aubergine18 »

It's the only way I know to change sprite currently, is to use something like a tank or turret which switch to different set of sprites based on their direction. Like nixie tubes use a tank or car to choose their color, it's changing direction to switch to different sprite.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”