ID:149115
 
ok this time i have an overlay bug. When i get into a car it keeps the overlays. i want to make it so when you get into the cars it takes the overlays away but when you get in it puts them back. heres the code.

mob/Cars
verb
Get_into_Blue_Car()
if(usr.incar>=1)
usr.icon=usr.oicon
usr.icon_state=usr.oicon_state
usr<<"You get out of your car."
usr.incar=0
else
usr.oicon=usr.icon
usr.oicon_state=usr.icon_state
usr.incar=1
usr.icon = 'car.dmi'
usr.icon_state = "blue"
usr << "You Get into your Car"


What do i do to fix this?

Alienman
usr.overlays=null
In response to Strange Kidd
ok that worked now i can't get the overlays to pop back up after you get out of the car. heres what the code looks like now

mob/Cars
verb
Get_into_Blue_Car()
if(usr.incar>=1)
usr.icon=usr.oicon
usr.icon_state=usr.oicon_state
usr<<"You get out of your car."
usr.incar=0
else
usr.oicon=usr.icon
usr.oicon_state=usr.icon_state
usr.incar=1
usr.icon = 'car.dmi'
usr.icon_state = "blue"
usr << "You Get into your Car"
usr.overlays = null

Thanks,
Alienman
In response to Alienman22774
you'll need to have the overlays in a list.
mob
var
/list/olays = list()
verb
get_in_car()
src.icon = 'car.dmi'
src.olays = src.overlays
src.overlays = null

You'll have to change this a bit, and find a place to put it. And just reverse this to have him get out of the car.
In response to Airson
so i need to make a list of overlays for my Character Selection. -_- its over 48,000 letters oh god don't say i have to make it all over -_-

Alienman
In response to Alienman22774
No you shouldn't have do this make a var like a list

mob/var
list/ovrlays=list()

heres the verb that adds the overlays

mob/verb/addoverlay()
usr.ovrlays+='overlay.dmi'
usr.overlays+='overlay.dmi'

mob/Cars
verb
Get_into_Blue_Car()
if(usr.incar>=1)
usr.icon=usr.oicon
usr.icon_state=usr.oicon_state
usr<<"You get out of your car."
usr.incar=0
usr.overlays+=usr.ovrlays
else
usr.oicon=usr.icon
usr.oicon_state=usr.icon_state
usr.incar=1
usr.icon = 'car.dmi'
usr.icon_state = "blue"
usr << "You Get into your Car"
usr.overlays = null

also dont forget
when you get rid of the overlays use usr.ovrlays-='overlay.dmi'
In response to Strange Kidd
its still leaving the overlays off when i get out of the car. heres a piece of the Character Selection

if("Light")
character = new /mob/Light()
switch(input("What color do you want your shirt to be?","character") in list("White", "Orange", "Yellow", "Gray", "Black", "Blue", "Red", "Green"))
if("Yellow")
character.overlays += 'Yellow Shirt.dmi'
switch(input("What Color do you want your Pants to be?","character") in list("White", "Gray", "Black", "Blue"))
if("Gray")
character.overlays += 'Gray Pants.dmi'
switch(input("What Color do you want your Hair to be? (MORE SOON!)","character") in list("Green", "Blonde", "Black", "Red"))
if("Blonde")
character.overlays += 'Blonde Hair.dmi'
switch(input("Do you want a face icon?", "Face Icon",text) in list("Yes","No"))
if("Yes")
var/econ = input("Pick icon:","Icon") as icon
character.faceicon = econ

There is a LOT more than that. It is taking the overlays off when i get out of the car insead of putting them back.

Alienman
In response to Alienman22774
try something like this

mob/loginchara
var/pants
var/shirt
var/chara
Login()
var/charaname=input("What is your desired name?",Name?")as text
switch(input("What skin color do you want")in list("Light","Dark")
if("Light")
chara=/mob/Light()
switch(input("Which shirt color do you want","Shirt color")in list("Red","Black"))
if("Red")
chara.shirt='redshirt.dmi'
if("Black")
chara.shirt='blackshirt.dmi'
switch(input("Which pants color do you want","Pants color")in list("Red","Black"))
if("Red")
chara.pants='redpants.dmi'
if("Black")
chara.pants='blackpants.dmi'
chara.ovrlays+=pants
chara.ovrlays+=shirt
chara.overlays+=pants
chara.overlays+=shirt
chara.name=charaname
client.mob=chara

client.mob=chara I don't know if that's right but you can fix it
In response to Strange Kidd
no way am i doing that since my ull character selection is over 150,000 letters now. what i'll just do is amke the car an overlay but the cars will be big enough to cover the character and look bad. Oh well.


Alienman
In response to Alienman22774
oh ok...