ID:933549
 
Code:
turf 
dirt
icon = 'dirt.dmi'
density = 0
icon_state = "dirta"
icon_state = "dirtstop"
density = 1


I am wanting to condense my icon files as I am creating a long list in the object tree just in the creation of one map. To do this I want to group related icons as icon_states so that the entire group only holds one place on the object tree. Creating the states is not the issue, where I am getting stuck is with certain icons, especially turfs I usually have one that serves as a blocking tool to prevent the player from walking throgh certain areas. Problem is no matter how I try to isolatethat one state and designate it as dense, all of the icon_states become dense. I found that I can custom edit a state in the map/object interface by right clicking on the state but it will not let me do this for the parent state and if I name the parent as just another state it overides one of the other icons. Usually the next one in line. Is there a way to solve this issue?

You need to create each one as a separate object. An icon can only have 1 state active at a time. Create each type of dirt you want as a subtype to it.

turf
dirt
icon = 'dirt.dmi' //if you set the icon here, all subtypes will inherit the icon. same goes for anything set here.
density = 0 //by default, you can have all dirt type turfs (/turf/dirt) not be dense
Dirta
icon_state = "dirta"
//since you set the density above, this will inherit it and be 0. you can still set it here if you want.
Dirtstop
icon_state = "dirtstop"
density = 1 //if you set the density for this specific object,
//it overwrites the 0 you set earlier and doesn't inherit anymore. this is an explicit setting.


Using inheritance can help save you some time when creating different instances of a type of turf/obj/what have you, especially if many of them will have similar properties and only one or 2 will have them set differently, which you would set accordingly.

You don't have to do it that way, of course. You could set each one individually if you wish.
Very nice, thank you so much. I was trying to seperate them but I guess my mind is kinda dense at times because it didnt occur to me to name them individually. Thanks again.