ID:145390
 
Code:
turf
grass
icon = 'turfs.dmi'
icon_state = "grass"
density = 0
water
icon = 'turfs.dmi'
icon_state = "water"
density = 1


whenever i try to add a water turf, it changes my grass turf to water on the map file..i always get this problem..please help..:

You didn't indent properly, so "water" becomes the default icon state for all turfs.

The following will make it so that only grass displays as grass, and only water displays as water.
turf
grass
icon = 'turfs.dmi'
icon_state = "grass"
density = 0
water
icon = 'turfs.dmi'
icon_state = "water"
density = 1

In response to Shadowdarke
I didn't think it would even compile like that.

I guess he could load the map editor without compiling though.
In response to Shadowdarke
thank you, i told you it was simple =P. im just starting out, so hopefully ill get better at this =).
In response to Scoobert
The compiler probably thinks he's making a new type, the turf/grass, then just going back to editing the variables of the base type. Obviously, you can do something like that.
obj
obj2
icon = 'base object's icon'

Then it just does the same for the second derived type, then thinks he's going back to the base type and overriding what he did before.

So
type1
type2
variable = thing1
type3
variable = thing2

Ends up being equivalent to
type1
variable = thing2 //was thing1, but this overrides it
type2
type3
In response to Loduwijk
Oh yeah, I didn't think about that. I have never tried to make a type without puting anything into it.
In response to Scoobert
Just as a little bit of added information, you don't have to put "density=0" in the grass coding. Density is, by default, zero, unless changed. You DO, however, have to keep it after water, unless you want people walking on water.