Hi, first I just want to say that I like your additions to the game!
But I have been a tiny bit annoyed by all the new additions to the construction menu (“Paint [horizontal/vertical] wall [red/blue/green]” etc).
So I have been trying to figure out a way to do it simpler/cleaner.
I’m currently not very familiar with CDDA’s code, but I’ve looked around and I think it should be possible (and relatively easy) to do something like the following (for now I’ll concentrate on the wall painting part) :
- In the json files, have only 2 options: “Paint horizontal wall” and “Paint vertical wall” (it might also be possible to combine them into just “Paint wall”).
- For each entry, have each paint as an optional component, so that in the menu you get that you need “Red paint OR Yellow paint OR Blue paint” etc. (The “Start vehicle construction” entry uses this approach.) This eliminates having one entry for each color - instead the player can choose from the colors they have available.
- Now, instead of having different terrain types for each color (i.e. “t_wall_v_w”, “t_wall_v_r” etc.) you could have a post_special function which just sets the color of the wall to the chosen paint color, and voila, the wall should show up in the color you’ve chosen to paint it! One might also add a flag to indicate that the wall has been painted, so that when you e(x)amine the wall it could show “wall (red)”, but that’s not very important I guess.
I haven’t looked deeply into it, but a quick look makes me think this could be done relatively easily. But maybe you’ve already considered it and decided against it?
The only problem I see is that this will probably not play well with tiles, since as far as I can tell tiles are directly related to the terrain id, and therefore currently needs a separate wall tile for each color, right? One solution could be to make tiles aware of the color attribute, and apply a color overlay to walls flagged as painted, but that might be a lot of work and maybe not a good solution? - I haven’t looked at the tiles code.
If this is a good idea I could give it a shot.