usr.class does not show up in a text string
e.g. world<<"[usr], the [usr.class] has entered [world.name]!"
Its just blank.
Second problem, mob is located at "start" turf instead of "start2" turf.
ID:148548
![]() Jan 2 2003, 8:32 pm (Edited on Jan 2 2003, 8:40 pm)
|
|
Crispy wrote:
1. Close your tags, and put <dm> and <\dm> around code you post on the forums. I edited the last post. |
Zlegend2 wrote:
usr.class does not show up in a text string Check to see where you've set usr.class. (Is it actually set anywhere?) Second problem, mob is located at "start" turf instead of "start2" turf. Then you've probably missed out the 2 and put locate("start") instead of locate("start2") or something. |
heres what i got.
in the create proc i have loc=locate(/turf/start2) in the login() i have. loc=locate(/turf/start) I need them in their places. |
its this part thats doing it i think:
switch(input("What class are you?","Class")in list("Archer","Paladin","Ranger","Wizard")) I cant put class = input. I have to have switch. |
Zlegend2 wrote:
usr.class does not show up in a text string usr isn't really a good idea to use in Login(). it's supposed to be okay in most games, but it's not what I would consider safe. src would be correct. In this case I think it's just that that's screwing you up. Assuming this is within one of the regular mob Login() procs and not the character creation login, then what's happening is a result of code like this: client.mob = new_mob Lummox JR |
i cant use it period. It causes a whole bunch of other errors. 2 other errors i cant remember. I tried it already i know that.
|
mob/proc/create()
var/name=input("What is your name?","Name")as null|text var/element=input("What is your natural element?","Element")in list("Fire","Aero","Holy","Water","Ice","Dark") var/alignment=input("What is your presence in this world?","Alignment")in list("Pure Good","Good","Neutral Good","Neutral","Neutral Evil","Evil","Pure Evil") var/mob/character switch(input("What class are you?","Class")in list("Archer","Paladin","Ranger","Wizard")) // HERE << is there a way i can define "class and still have the switch statement? if("Ranger") character= new /mob/ranger() if("Archer") character= new /mob/archer() if("Wizard") character= new /mob/wizard() if("Paladin") character= new /mob/paladin() character.name=name character.element=element character.alignment=alignment character.class=class character.race=input("What race are you of?","Race")in list("Human","Elf","Dwarf","Halfling") character.gender=input("What gender are you?","Gender")in list("male","female","neuter") loc = locate(/turf/start2) world << " <B><FONT COLOR=red><SMALL>Server: <FONT COLOR=white>[src] the [src.class] has joined [world.name]!" |
Zlegend2 wrote:
> mob/proc/create() |
i changed the src.class in the world message to character.class and left [src] alone. All i need now is to start out in the correct place when i finish the login sequence.
|
I think i see why it logs me in the place where i start at the click screen and not at the second loc spot.Maybe it repeats mob/Login(). Take a look at this coding.
----------------------------------------------------- mob/Login() loc = locate(7,7,1) usr << browse(Introduction,"window=Introduction") return..() ----------------------------------------------------- mob/proc/create() var/name=input("What is your name?","Name")as null|text var/element=input("What is your natural element?","Element")in list("Fire","Aero","Holy","Water","Ice","Dark") var/alignment=input("What is your presence in this world?","Alignment")in list("Pure Good","Good","Neutral Good","Neutral","Neutral Evil","Evil","Pure Evil") var/mob/character var/class switch(input("What class are you?","Class")in list("Archer","Paladin","Ranger","Wizard")) if("Ranger") character= new /mob/ranger() class = "Ranger" if("Archer") character= new /mob/archer() class = "Archer" if("Wizard") character= new /mob/wizard() class = "Wizard" if("Paladin") character= new /mob/paladin() class = "Paladin" character.name=name character.element=element character.alignment=alignment character.class=class character.race=input("What race are you of?","Race")in list("Human","Elf","Dwarf","Halfling") character.gender=input("What gender are you?","Gender")in list("male","female","neuter") usr.loc = locate(/turf/start2) world << " <B><FONT COLOR=red><SMALL>Server: <FONT COLOR=white>[src] the [character.class] has joined [world.name]!<dm>" |
its not that.
usr.loc = locate(/turf/start2) Thats in the create proc ------------------------------- loc = locate(7,7,1) Thats in the login proc ------------------------------- I dont think thats the case anymore. I believe the Login() is being done over again except this time with set stats. I need to figure out how to execute the login and not have Login() executed again. Login() is also probaly overriding the locate(/turf/start2) in create proc too. ------------------------------- Can someone help? The source: mob/proc/create() var/name=input("What is your name?","Name")as null|text var/element=input("What is your natural element?","Element")in list("Fire","Aero","Holy","Water","Ice","Dark") var/alignment=input("What is your presence in this world?","Alignment")in list("Pure Good","Good","Neutral Good","Neutral","Neutral Evil","Evil","Pure Evil") var/mob/character var/class switch(input("What class are you?","Class")in list("Archer","Paladin","Ranger","Wizard")) if("Ranger") character= new /mob/ranger() class = "Ranger" if("Archer") character= new /mob/archer() class = "Archer" if("Wizard") character= new /mob/wizard() class = "Wizard" if("Paladin") character= new /mob/paladin() class = "Paladin" character.name=name character.element=element character.alignment=alignment character.class=class character.race=input("What race are you of?","Race")in list("Human","Elf","Dwarf","Halfling") character.gender=input("What gender are you?","Gender")in list("male","female","neuter") usr.loc = locate(/turf/start2) world << "<FONT COLOR=red><SMALL>Server: <FONT COLOR=white>[src] the [character.element] [character.class] has joined [world.name]!" src.client.mob = character del src mob/Login() loc = locate(7,7,1) usr << browse(Introduction,"window=Introduction") ..() client/Del() del src |
2. This was already explained in another thread. This line...
<code>src.client.mob = character</code>
...is logging people out of their current mob, therefore calling mob/Logout(). DUH.
Use client/Del() instead of mob/Logout(), like I said in [link]