ID:1619552
 
(See the best response by TRex2314.)
Hi, i have been have alot of trouble lately finding a way to put some sort of character creation into my game such as "please choose a skintone","please choose a hairstyle","please choose a hair color","please choose a name". and such.. i was just wondering if somebody could possibly provide me with instructions along with a code, thanks! P.S Ive never coded before.


Best response
I recommend you read the guide to do this. I'll recommend you start doing this by using procs like Click Switch, and Input.
Alright, I was able to find a demo of a character creation that i then put into my game but now have 1 problem, everything works fine except things like armor and clothing that i put at the spawn point no longer appear in-game, please take a look at the code below
|
|
\ /





mob/Login() //During Login
usr.icon='base.dmi' //Put Zeta_Icon as the user's Icon
usr.overlays+='SSJ.dmi' //Put SSJ hair as ovelay
usr.loc = locate(5,5,1)
return..()



mob
var
pl=1000
maxpl=1000
weightdown=0

obj/AkatsukiHat
name="AkatsukiHat"
icon='AkatHat.dmi'
var/worn=0
verb
Get()
set src in oview(1)
set category = null
Move(usr)
Wear()
set category = null
if(worn==0)
usr.overlays+=src.icon
src.worn+=1
src.suffix="<Worn>"
usr<<"You wear [src]."
usr.weightdown+=1
else
usr.overlays-=src.icon
src.worn-=1
src.suffix=""
usr<<"You takeoff [src]."
usr.weightdown-=1
Drop()
set category = null
if(worn==1)
usr.overlays-=src.icon
src.suffix=""
src.worn-=1
usr.weightdown-=1
usr<<"You drop [src]."
src.loc = locate(usr.x,usr.y,usr.z)



mob
Stat()
statpanel("[usr]")
stat(src)
stat("")
stat("Powerlevel:","[usr.pl]/[usr.maxpl]")
statpanel("Inventory")
stat("Your Items:","")
stat(usr.contents)

mob
Move()
if(usr.weightdown==1)
usr.maxpl+=(rand(10,100))
..()








obj/AkatsukiRobe
name="AkatsukiRobe"
icon='AkatRobe.dmi'
var/worn=0
verb
Get()
set src in oview(1)
set category = null
Move(usr)
Wear()
set category = null
if(worn==0)
usr.overlays+=src.icon
src.worn+=1
src.suffix="<Worn>"
usr<<"You wear [src]."
usr.weightdown+=1
else
usr.overlays-=src.icon
src.worn-=1
src.suffix=""
usr<<"You takeoff [src]."
usr.weightdown-=1
Drop()
set category = null
if(worn==1)
usr.overlays-=src.icon
src.suffix=""
src.worn-=1
usr.weightdown-=1
usr<<"You drop [src]."
src.loc = locate(usr.x,usr.y,usr.z)

mob
player
icon = 'base.dmi'


obj/RedAura
name="GM RedAura"
icon='Aura Red.dmi'
var/worn=0
verb
Get()
set src in oview(1)
set category = null
Move(usr)
Wear()
set category = null
if(worn==0)
usr.overlays+=src.icon
src.worn+=1
src.suffix="<Worn>"
usr<<"You wear [src]."
usr.weightdown+=1
else
usr.overlays-=src.icon
src.worn-=1
src.suffix=""
usr<<"You takeoff [src]."
usr.weightdown-=1
Drop()
set category = null
if(worn==1)
usr.overlays-=src.icon
src.suffix=""
src.worn-=1
usr.weightdown-=1
usr<<"You drop [src]."
src.loc = locate(usr.x,usr.y,usr.z)



//-----------------------------------------------------------------


mob
var
Eyes // Define a couple of description variables, for the tutorial's sake.
Hair
choices // This defines the type of mobs that you can choose.
icon = 'base.dmi' /* All of the following mobs will have this icon. No need to do it multiple
times, so I just define it at the base.*/

Boy // More choices. You can change these to your desire.
Girl
verb
Look_at(mob/M as mob in oview(1)) // Make the 'Look at' verb require an arguement of a mob who is one space away from you.
src << "You look at [M]."
src << "[M] has [M.Eyes] eyes, and [M.Hair] hair." // Display the target mob's variables to whoever used the verb.

login_mob // This is the login mob.
Login() // Now is when the fun begins. This is the Login() proc that is called when login_mob logs in.
var/mob_path = "mob/choices/" // This is where we define the path for the race selections.
var/choice = input("Please select a skintone") in list ("White","Tan","Dark") // Defines the variable 'choice' to what they choose.
mob_path += choice // Add their choice to mob_path, making it the mob they want.
var/mob/choices/new_mob = new(mob_path) // This creates the mob of choice, and defines the reference as 'new_mob'
new_mob.icon_state = choice // Appoint the correct icon state to it.
new_mob.Eyes = input("Please select your eye color.") in list ("Blue","Green") // This, as you've probably figured out, sets new_mob's Eyes variable, to the selection made.
new_mob.Hair = input("Please select your hair color.") in list ("Black","Blonde") // This does the same as above, but with their Hair variable.
new_mob.name = input("Please select a name.") as text // This will prompt the user to select a name for the new mob.
new_mob.Move(locate(1,1,1)) // This will move the new_mob to the very lower left hand corner.
src.client.mob = new_mob // This sets the person who logged in's mob to new_mob, making them the mob they've just customized.
del(src) // No need for the emp

turf/grass/icon = 'grass.dmi' // Defines a grass turf.


world
mob = /mob/login_mob // This define the mob that the users are set to, when they first log in.
turf = /turf/grass // Define the default turf for the world.
maxx = 20 // No need for making a map, so this will set the world's max X and max Y.
maxy = 20
view = 5
Please put DM tags in the beginning of the code and the end of the code. so like

<dm>