ID:165398
 
obj
Shades
name = "Shades"
icon = 'shades.dmi'//dont have a base icon so cant make weights icon!lol
worn = 0
price = 158
verb
Wear()
if(src.worn == 1)
src:worn = 0
usr.overlays -= 'shades.dmi'//temp icon
usr << "You remove the [src.name]."
src.suffix = ""
else
src:worn = 1
usr.overlays += 'shades.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"

For that code, How would i add in an if veriable to change the over lay to another icon so say kid.dmi = kidhsades.dmi
Why are you using the ':' operator when you don't need to? Use the '.' operator...

As for your suggestion. 1) Go read the DM Guide and other resources as displayed in the left panel of this page.
2) Describe what you want to accomplish better, and in proper English.
In response to Kaioken
Right, I am using proper english ^.^ My methods of explaining may just be a little jerked. Okay.... At the moment the shades are made for a larger icon but i have made an option for a smaller icon to be used in my game so to make an 'if' to add another .dmi file into that list to fit the smaller icon but so it does it automaticly without a seperate item.
In response to Keiron
Keiron wrote:
Right, I am using proper english ^.^

Meh, don't make me go all grammar nazi on you.

so to make an 'if' to add another .dmi file into that list to fit the smaller icon but so it does it automaticly without a seperate item.

So what's the problem? Surely you know how to use a simple if() statement?

Anyway, time to go coding nazi on you. :P

--When posting on the forum, put your code between DM tags, like this:
Your code here



--Don't use the == operator for true/false values. Use boolean checking - read more here: http://bwicki.byond.com/ByondBwicki.dmb?TrueFalse

-- ... You'd probably prefer the suffix to be "Worn", not "Equipped"? :D

--Either way, no need for the worn variable - just check the suffix instead!

--Use the . operator.

After you fix those, if you still actually can't figure out to use a simple if() check, I'll help you. O_o (hint:)
if(some_value) usr.overlays += X
else usr.overlays += Y
In response to Kaioken
Hey dude, Thanks for the help so much its up and working thanks to your help.
In response to Keiron
Umn.. im embarased to say but it didnt work... Another embarasement to say is im noob at coding and dont really know what im doing so help would be very much apreacheiated (SP) :(
In response to Keiron
Well, post your updated code (in DM tags). A more detailed description of what actually happens rather than "doesnt work" could come in use, too. :P
In response to Kaioken
Right.. its not more of a 'it doesnt work' But more of a 'Im a noob and dont what im doing ^.^' '

obj
Shades
name = "Shades"
icon = 'shades.dmi'//dont have a base icon so cant make weights icon!lol
worn = 0
price = 158
verb
Wear()
if(src.icon == 'kidbase.dmi')
src.worn = 1
usr.overlays += 'gord.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"
if(src.worn == 1)
src:worn = 0
usr.overlays -= 'shades.dmi'//temp icon
usr << "You remove the [src.name]."
src.suffix = ""
else
src:worn = 1
usr.overlays += 'shades.dmi'
usr << "You wear the [src.name]."
src.suffix = "Equipped"


What im trying to achieave(Sp) Is To change the diffrent shades icon depending on what icon the src has at the time.
If you want me to elaborate more then please say, And i thank you for your time and effort if you help me.