ID:262340
 
Code:
obj/choose/good
icon = 'blank.dmi'
name = "Good"
layer = MOB_LAYER+55
density = 1
Click()
usr.alignment = "Good"
usr << "Your Alignment is now: <u>Good</u>."
obj/choose/submit
icon = 'blank.dmi'
name = "Submit"
layer = MOB_LAYER+55
density = 1
Click()
var/mob/new_mob
if(usr.alignment == null)
usr << "Choose an alignment first!"
else
if(usr.prerace == "Saiya-jin")
new_mob = new /mob/characters/saiyajin()
new_mob.icon = usr.preicon
new_mob.move = 1
new_mob.alignment = usr.alignment
new_mob.focused = 0
new_mob.powerlevel = 5
new_mob.maxpowerlevel = 5
new_mob.strength = 1
new_mob.dead = 0
new_mob.rage = 0
new_mob.faceicon = 'default.dmi'
new_mob.gonessj = 0
new_mob.stamina = 100
new_mob.maxstamina = 100
new_mob.zenni = 3000
new_mob.will = 0
new_mob.honor = 0
new_mob.gonessj = 0
new_mob.state = "Normal"
new_mob.purity = 0
new_mob.kitech = "None"
new_mob.auratech = "None"
new_mob.kitechlearn = 0
new_mob.bangtechlearn=0
new_mob.auratechlearn = 0
new_mob.kaioken = 0
new_mob.maxstamina = 100
new_mob.mother = "Unknown"
new_mob.father = "Unknown"
new_mob.focustechlearn = 0
new_mob.kicolor = "None"
new_mob.focus = "None"
new_mob.moon = 1
new_mob.flightlearn = 0
new_mob.race = "Saiya-jin"
new_mob.overlays += /obj/tail
new_mob.title = ""
new_mob.talk = 1
new_mob.oicon = new_mob.icon
new_mob.npp = 0
switch(input("Do you want a face icon?", "Face Icon",text) in list("Yes","No"))
if("Yes")
var/class = input("What kind of face icon?","Icon Choose") in list("Icon","Preset Icon","Cancel")
switch(class)
if("Icon")
var/econ = input("Pick icon:","Icon") as icon
new_mob.faceicon = econ
if("Preset Icon")
switch(input("What icon do you want to use?", "Icon Choose") in list ("Goku","Gohan","Vegeta","Trunks","Goten","Kami","Dende","Turles","Vegeta2","Frieza"))
if("Goku")
new_mob.faceicon = 'goku.bmp'
if("Vegeta")
new_mob.faceicon = 'vegeta.bmp'
if("Gohan")
new_mob.faceicon = 'gohan.bmp'
if("Trunks")
new_mob.faceicon = 'trunks.bmp'
if("Dende")
new_mob.faceicon = 'dende.bmp'
if("Goten")
new_mob.faceicon = 'goten.bmp'
if("Kami")
new_mob.faceicon = 'kame.bmp'
if("Raditz")
new_mob.faceicon = 'raditz.bmp'
if("Turles")
new_mob.faceicon = 'turles.bmp'
if("Vegeta2")
new_mob.faceicon = 'vegeta2.bmp'
if("Frieza")
new_mob.faceicon = 'icer.bmp'
var/icon/I = new('hair_goku.dmi')
I.Blend(usr.rgb)
new_mob.overlays += I
new_mob.name = usr.prename
usr.client.mob = new_mob
usr.verbs += /mob/verb/save_me
usr.verbs += /mob/verb/AFK
usr.loc=locate(77,77,1)


Problem description:
i have theese to obj on a third screen the good just sets the usr alignment, while the submit sets takes all of the usrs pre stats and makes a new_mob then new_mob becomes the users mob. the thing is theese to objs don't seems to show up I put them on the map and run it but when i scroll over where they should be the name doesn't show up and when i click nothing happens.
usr is the old mob, not the new one. At the end of the proc you're modifying usr when you should be modifying the new mob instead.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
usr is the old mob, not the new one. At the end of the proc you're modifying usr when you should be modifying the new mob instead.

Lummox JR

This is not the problem you see that has worked while the new_mob stuff was in in the another obj. but even the obj good which just sets the usr's alignment to good to be transfered to the new_mob which then becomes the usr's mob does not show up and doesn't not respond to clicking in play. Can Someone Please Help?
In response to GOTENKS SS5
GOTENKS SS5 wrote:
Lummox JR wrote:
usr is the old mob, not the new one. At the end of the proc you're modifying usr when you should be modifying the new mob instead.

This is not the problem you see that has worked while the new_mob stuff was in in the another obj. but even the obj good which just sets the usr's alignment to good to be transfered to the new_mob which then becomes the usr's mob does not show up and doesn't not respond to clicking in play. Can Someone Please Help?

Okay, one more time; usr is the old mob, not the new one. Your entire problem is right here in this quote:

...new_mob which then becomes the usr's mob...

This means you don't know what usr really is. It's a mob, not a client, so "the usr's mob" is nonsense. In fact "the usr" is nonsense too; what you really mean is "a player".

usr does not mean "the mob currently belonging to the client who ran this verb". If the client changes mobs, usr does not change. The only way you can change usr to a new mob is to change it manually, or to have it become null if the mob gets deleted. Otherwise, it keeps whatever value it had when the verb started, and will continue to have that same value throughout any procs called by that verb unless you 1) change the value, or 2) end up deleting the mob so that usr becomes null.

Lummox JR
In response to Lummox JR
Lummox JR, i kinda understand what you mean but the thing is that the code in the submit obj worked when i had it in a hait obj. the character was made i could walk around hoopla, But That Is Not The Point. The Problem is that when you scroll over and object in the game if a name has been assigned it will display the name in the bar above the command line in the dream seeker. But the Good and submit objects don't display a name let alone do anything. they also have black icons, and they go over an .png they just act as the button. Meaning that they aren't showing up in play ay all! i need a way to make them show up in play not working on the new_mob code.
In response to GOTENKS SS5
Hey GOTENKS,

I'm not sure why your objects aren't showing up from reading your code, but let me suggest a different approach from placing these objects in your map file manually. You can code it so that these objects will appear as client.screen objects as follows:
obj/good
icon='blank.dmi'
icon_state="good"
screen_loc="1,3" //sets the screen location for the obj
Click()
//your code here
Once you have your objects set like this with the added variable screen_loc, you can add it to client screen using a function such as this:

mob/proc/NewCharSetUpScreen()
client.screen+=new/obj/good //this will add the good
//alignment obj to the
//users screen at
//x=1 y=3.
You can do all your character setup objects like this and they are sure to show up.