//pick color
FavoriteColorButton
Click()
switch(input("What is your Favorite color?","Color Selections") in list("Red","Green","Blue"))
if("Red") usr.FavColor = rgb(#FF0000)
if("Green") usr.FavColor = rgb(#00FF00)
if("Blue") usr.FavColor = rgb(#0000FF)
//apply and add color
var/Shirt = new /obj/Items/Shirt
var/icon/i = Shirt.icon
i += usr.FavColor
Shirt.icon = i
var/Pants = new /obj/Items/Pants
var/icon/i = Pants.icon
i += usr.FavColor
Pants.icon = i
usr.contents+=new Shirt;usr.Items+=new Shirt
usr.contents+=new Pants;usr.Items+=new Pants
//Equip/Unequip
Shirt
icon_state="Shirt"
suffix = "A Shirt"
Click()
if(suffix != "Equiped")
usr.overlays+='Shirt.dmi'
suffix = "Equiped"
usr<<output("You put on the Shirt!","InfoBox")
else
usr.overlays-='Shirt.dmi'
suffix = "A Shirt"
usr<<output("You took off the Shirt!","InfoBox")
Problem description:For some reason when i use this method to Add/Create the colored item i need it decides to error with a result of no item, Create an item that doesnt give the right color, or resets the color upon an equip back to the base color. How would i fix this? Im trying to allow the player to pick his/her favorite color, then upon creating a character have the pants/shirt that you get for free become that color and stay that color regaurdless of unequiping/requiping.
Look at that, this may help you.
In tis case you don't need to do var/icon/i = Shirt.icon/Pants.icon Just Shirt.icon += rgb() / Pants.icon += rgb()