Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Changing the grass color (or How Do I Get Magenta Knot Grass)?  (Read 1244 times)

Darchitect

  • Bay Watcher
    • View Profile

Working on a texture pack.

Edited the raws in a saved game to change several of the grasses' colors (knot, reed, rye) to magenta, just to see how it worked.

Nothing happened when I loaded my game... All the grass is still using its default color. I tried editing the main raws just to see if that helped. No love.

I'm sure this is something simple, but I can't figure it out!
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Changing the grass color (or How Do I Get Magenta Knot Grass)?
« Reply #1 on: June 13, 2013, 12:38:51 pm »

Edit the colors of the grass in the plant grass file, generate a new word, Voila!
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Darchitect

  • Bay Watcher
    • View Profile
Re: Changing the grass color (or How Do I Get Magenta Knot Grass)?
« Reply #2 on: June 13, 2013, 01:02:06 pm »

I was afraid of that... New world generation each time to check a color... Eeeesh.  :'(

Never anything easy about this simulator, eh?

I suppose I have to generate a new world each time I change a stone or soil's tile in the raws as well?

Le sigh. Ok. Here we go!

And thank you.
Logged

Knight Otu

  • Bay Watcher
  • ☺4[
    • View Profile
Re: Changing the grass color (or How Do I Get Magenta Knot Grass)?
« Reply #3 on: June 13, 2013, 02:20:32 pm »

Editing the save raws definitely works. I just tested it, and it worked. Is it possible that you only edited the first of the four colors, or that the grass you were looking at was dry?
Logged
Direforged Original
Random Raw Scripts - Randomly generated Beasts , Vermin, Hags, Vampires, and Civilizations
Castle Otu

Darchitect

  • Bay Watcher
    • View Profile
Re: Changing the grass color (or How Do I Get Magenta Knot Grass)?
« Reply #4 on: June 13, 2013, 02:53:45 pm »

Ok, this is weird. I went back and changed ALL (normal) grasses... And now some are showing up as magenta, but others are showing up as teal within the same species.

Most of the teal-colored grass is reed grass. But occasional bits of it are colored magenta. Some of them are "dense," others are normal. What gives?

Is there a general grass modifier somewhere that can override colors occasionally?

I was initially trying to just get a solid block of color for all grass...
I'm also suspicious that the program just isn't checking the files at start-up. I'm running this on my Mac right now. I'll switch over to Windows in a bit to see what it does there.
Logged

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: Changing the grass color (or How Do I Get Magenta Knot Grass)?
« Reply #5 on: June 13, 2013, 03:11:12 pm »

Post your edited raws if you really want detailed help.

>> I'm also suspicious that the program just isn't checking the files at start-up.

seems unlikely.  i mean, of course some things are moddable in save games and others aren't, but i've never heard of it being variable from one minute to the next.
« Last Edit: June 13, 2013, 03:18:19 pm by smakemupagus »
Logged

Obsidian Soul

  • Bay Watcher
  • ...and the severed part sails off in an arc!
    • View Profile
Re: Changing the grass color (or How Do I Get Magenta Knot Grass)?
« Reply #6 on: June 13, 2013, 04:15:16 pm »


I'm still a noob at this, but I've successfully changed the colors of grasses without having to generate new worlds. You edit the graphics folder, not the saves.

1) Go to your raw/objects folder.
2) Find the file plant_grasses.txt and backup the file while you're at it somewhere else, in case something goes wrong.
3) Find the following code snippet within it. The highlighted lines determines the tiles used (from the main tileset), and the color variations of the grass.

Quote
[PLANT:KNOTGRASS]
   [ALL_NAMES:knotgrass]
   [USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
   [BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
   [GRASS]
   [GRASS_TILES:'.':',':'`':''']
   [GRASS_COLORS:2:0:1:2:0:0:6:0:1:6:0:0]

   [WET]
   [DRY]
   [BIOME:GRASSLAND_TEMPERATE]
   [BIOME:SAVANNA_TEMPERATE]
   [BIOME:SHRUBLAND_TEMPERATE]
   [BIOME:ANY_TEMPERATE_FOREST]

4) The format, from what I can gather is:
Quote
   [GRASS_TILES:'X':'X':'X':'X']
   [GRASS_COLORS:A:B:C:D:E:F:G:H:I:J:K:L]

Where:

X = tile from the main tileset to be used. You can also use numbers, rather than the actual character enclosed in apostrophes. Refer to this wiki article for the numbers of each tile. e.g. [GRASS_TILES:'.':',':'`':'''] is the same as [GRASS_TILES:46:44:60:39]

From what I can tell A, B, C, D, E, and F determine the colors of live plants.

While G, H, I, J, K, and L determine the color of dead or dry plants.

There are actually two sets for each, making a total of 4 sets of color raws.

A = foreground color of live variant 1
B = background color of live variant 1
C = brightness of the colors of live variant 1
D = foreground color of live variant 2
E = background color of live variant 2
F = brightness of the colors of live variant 2
G = foreground color of dead variant 1
H = background color of dead variant 1
I = brightness of the colors of dead variant 1
J = foreground color of dead variant 2
K = background color of dead variant 2
L = brightness of the colors of dead variant 2

Refer to this wiki article for help on the foreground, background, and brightness values and how they work together

So all in all to get magenta knotgrass, I think this would work:
Quote
[PLANT:KNOTGRASS]
   [ALL_NAMES:knotgrass]
   [USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
   [BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]
   [GRASS]
   [GRASS_TILES:'.':',':'`':''']
   [GRASS_COLORS:5:0:1:5:0:1:5:0:0:5:0:0]
   [WET]
   [DRY]
   [BIOME:GRASSLAND_TEMPERATE]
   [BIOME:SAVANNA_TEMPERATE]
   [BIOME:SHRUBLAND_TEMPERATE]
   [BIOME:ANY_TEMPERATE_FOREST]

5 is the color number for magenta. 0 is black. Thus 5:0:1 means the tile will show a foreground color of magenta, a background color black, and a brightness of 1 (which means it will show as light magenta).

That would show knotgrass as bright magenta when live, and dark magenta when dead... I think. ;D Note that the game apparently uses random tiles being used for grasses for generic shrubs sometimes.