User Tools

Site Tools


dev:proposals:paintable_elements

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
dev:proposals:paintable_elements [2023-01-17 14:45]
evictionbot Evict 56independent
— (current)
Line 1: Line 1:
-====== Paintable Elements ====== 
-In real life railways, a lot of stuff is paintable. Italy sometimes paints their tracks white to stave off the brutal summer heat, signs are painted over to make them useless, and platforms can be given a strong yellow to push players away. 
  
-In advtrains, many components could be coloured to help alongside trains. 
- 
-  * ATC (Lua or not) tracks can be coloured for disambiguation with some form of server-wide colour scheme (purple for digiline-data sending components, green for interlocking-helping tracks, so on) 
-  * Station tracks can be disambiguated based on what type of train they are for (maybe a metro train stops for 10 seconds whilst a mainline stops for 60) 
-  * Signal masts can be coloured for the track they aim for instead of being a solid blue 
- 
-This also seems rather simple to implement. I, (56independent) have said this fraudulently multiple times, so here is my proof: 
- 
-This is how the E231 train changes its colour. The actually colour-changing code is only 7 lines long.  
- 
-<code> 
-local meta = itemstack:get_meta() 
-local color = meta:get_string("paint_color") 
-local alpha = tonumber(meta:get_string("alpha")) 
-if color and color:find("^#%x%x%x%x%x%x$") then 
- data.livery = self.base_texture.."^("..self.base_livery.."^[colorize:"..color..":255)" -- livery texture has no own texture.... 
- self:set_textures(data) 
-end 
-</code> 
- 
-From here, it's quite easy to change the texture name to be that for the track pointed. 
- 
-This can be turned into a global function. In fact, it's so easy, i might as well bother to do it given community approval. 
- 
-QED. 
- 
-Later on, a feature to automatically weaken the colour by x every time a train runs over a coloured track or by y every hundred hours would be helpful for realism (which is proven by Italy's tracks not being white all the time.