ID:272433
 
Code:
mob/var/pickedicon
mob/var/pickedhair

obj
Base_Prev
icon = 'base.dmi'
Click()
var/image/i=image(src.icon,locate(15,155,1))
usr<<i
usr.pickedicon=src.icon
usr.Preview_Body()


obj
Hair_Prev
icon = 'hairse.dmi'
Click()
var/image/h=image(src.icon,locate(15,155,1))
usr<<h
usr.pickedhair=src.icon

turf
Finished
Click()
usr.icon=usr.pickedicon
usr.overlays+=usr.pickedhair
usr.loc=locate(22,165,1)

mob
verb
Preview_Body()
src.dir = NORTH
sleep(7)
src.dir = WEST
sleep(7)
src.dir = SOUTH
sleep(7)
src.dir = EAST
spawn()Preview_Body()

Problem description:
After i press finish my icon is still there , can someone please tell me how to delete it. And if you can i would u tell me how when i press finish it wont let me rotate my icon.
You might want to make an ANIMATED ICON (like for the base.dmi, make an icon_state of it thats rotating) also make an hair obj for you to overlay on the base icon.

turf        
Create
Click()
usr.loc = locate(10,10,1) // go to the creation screen
usr.invisibility = 999 // make the mob invisible
..()

Base_Prev
icon = 'base.dmi'
Click()
del usr.tmpIcon // delete the past base icon
var/image/I = image(src.icon,usr,icon_state="preview") //assign icon_state to animated base icon
usr.tmpIcon = I
usr.client.screen += usr.tmpIcon
usr.icon = src.icon
..()

Hair_Prev
icon = 'hair.dmi'
layer = MOB_LAYER + 1
var
Hairstyle = /obj/hair // make an obj hair for the actual overlay
Click()
del usr.tmpHair // delete the past hair icon
var/image/I = image(src.icon,usr,icon_state="preview") //assign icon_state to animated hair icon
usr.tmpHair = I
usr.client.screen += usr.tmpHair
usr.hairstyle = src.Hairstyle
..()

Finish
Click()
if(!usr.icon) //check whether he has an icon
usr << "Please Choose a Base Icon"
return
if(usr.hairstyle)
usr.overlays += new usr.hairstyle //add the hair overlays if there is
del usr.tmpIcon //del the icon image
del usr.tmpHair //del the hair image
usr.loc = locate(50,50,1) // go to location after the creation part
usr.invisibility = 0 // set to invisibility zero to see the mob
..()


//sample of hairstyle

obj/hair
icon = 'hairstyle.dmi'
layer = MOB_LAYER + 1


mob
var/tmp // you declare the variables as temporary because
tmpIcon // you don't want save it
tmpkHair
hairstyle


Hope this helps... also try finding some bugs, because I just wrote this in a notepad, haven't tried it. ^^
In response to Samehada24
Nah it doesnt work but this is wat it says when i click it

runtime error: wrong type of value for list
proc name: Click (/turf/Base_Prev/Click)
usr: BLACK ST4R (/mob)
src: Base Prev (14,162,1) (/turf/Base_Prev)
call stack:
Base Prev (14,162,1) (/turf/Base_Prev): Click(Base Prev (14,162,1) (/turf/Base_Prev), "Main.map1", "icon-x=13;icon-y=17;left=1")

runtime error: wrong type of value for list
proc name: Click (/turf/Hair_Prev/Click)
usr: BLACK ST4R (/mob)
src: Hair Prev (13,158,1) (/turf/Hair_Prev)
call stack:
Hair Prev (13,158,1) (/turf/Hair_Prev): Click(Hair Prev (13,158,1) (/turf/Hair_Prev), "Main.map1", "icon-x=24;icon-y=25;left=1")
In response to BLACK ST4R
BLACK ST4R wrote:
Nah it doesnt work but this is wat it says when i click it

runtime error: wrong type of value for list
proc name: Click (/turf/Base_Prev/Click)
usr: BLACK ST4R (/mob)
src: Base Prev (14,162,1) (/turf/Base_Prev)
call stack:
Base Prev (14,162,1) (/turf/Base_Prev): Click(Base Prev (14,162,1) (/turf/Base_Prev), "Main.map1", "icon-x=13;icon-y=17;left=1")

runtime error: wrong type of value for list
proc name: Click (/turf/Hair_Prev/Click)
usr: BLACK ST4R (/mob)
src: Hair Prev (13,158,1) (/turf/Hair_Prev)
call stack:
Hair Prev (13,158,1) (/turf/Hair_Prev): Click(Hair Prev (13,158,1) (/turf/Hair_Prev), "Main.map1", "icon-x=24;icon-y=25;left=1")


Just found the problem... replace the usr.client.screen inside the Click function with usr.client.images.

You should also need to learn to find errors yourself.


world
turf = /turf/grass


turf/grass
icon = 'turf.dmi'


mob
var/tmp // you declare the variables as temporary because
tmpIcon // you don't want save it
tmpHair
hairstyle



turf
Create
Click()
usr.loc = locate(10,10,1) // go to the creation screen
usr.invisibility = 999 // make the mob invisible
..()

Base_Prev
icon = 'mob.dmi'
Click()
del usr.tmpIcon // delete the past base icon
var/image/I = image(src.icon,usr,icon_state="preview") //assign icon_state to animated base icon
usr.tmpIcon = I
usr.client.images += usr.tmpIcon
usr.icon = src.icon
..()

Hair_Prev
icon = 'hair.dmi'
layer = MOB_LAYER + 1
var
Hairstyle = /obj/hair // make an obj hair for the actual overlay
Click()
del usr.tmpHair // delete the past hair icon
var/image/I = image(src.icon,usr,icon_state="preview") //assign icon_state to animated hair icon
usr.tmpHair = I
usr.client.images += usr.tmpHair
usr.hairstyle = src.Hairstyle
..()

Finish
icon = 'check.dmi'
Click()
if(!usr.icon) //check whether he has an icon
usr << "Please Choose a Base Icon"
return
if(usr.hairstyle)
usr.overlays += new usr.hairstyle //add the hair overlays if there is
del usr.tmpIcon //del the icon image
del usr.tmpHair //del the hair image
usr.loc = locate(50,50,1) // go to location after the creation part
usr.invisibility = 0 // set to invisibility zero to see the mob
..()


//sample of hairstyle

obj/hair
icon = 'hairstyle.dmi'
layer = MOB_LAYER + 1