ID:148548
 
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.
1. Close your tags, and put <dm> and <\dm> around code you post on the forums.

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]
In response to Crispy
Crispy wrote:
1. Close your tags, and put <dm> and <\dm> around code you post on the forums.

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]

I edited the last post.
In response to Zlegend2
That's better. :-)
Zlegend2 wrote:
usr.class does not show up in a text string

e.g. world<<"[usr], the [usr.class] has entered [world.name]!"
Its just blank.

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.
In response to Crispy
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.
In response to Crispy
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

e.g. world<<"[usr], the [usr.class] has entered [world.name]!"
Its just blank.

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
del(src)
Before the character-creation temporary mob is deleted, Logout() is called for it and Login() for the new mob. usr is probably the same as the character-creation mob that's about to be deleted, but the class var was set for the brand new mob, not the old one. When Login() is called automatically by switching mobs, the value of usr you already had--the temporary mob--is passed along to it.

Lummox JR
In response to Zlegend2
Did you try var/class = input(blah blah blah?
In response to Jotdaniel
cant.

switch statement

switch(input=("Blah blah")in list("Choices,"Choices"))
In response to Zlegend2
I meant, if you dont use the switch cant you just use the var?
In response to Jotdaniel
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.
In response to Zlegend2
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]!"
src.client.mob = character
del src
In response to Zlegend2
Zlegend2 wrote:
> 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 //SET VAR FOR CLASS
> 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()
class = "Ranger" // DEFINE CLASS
> 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 //LEAVE THIS THE SAME
> 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 << "<dm><B><FONT COLOR=red><SMALL>Server: <FONT COLOR=white>[src] the [src.class] has joined [world.name]!"
> src.client.mob = character
> del src<dm>
In response to Jotdaniel
jot. please type your message in the message section instead of just repeating what i said .
In response to Zlegend2
I didnt. go look for the changes i made. I added comments after them.
In response to Jotdaniel
still nothing
In response to Jotdaniel
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>"
src.client.mob = character
del src
return..()
--------------------------------------------------------
after i t says "[src the [character.class] has joined [world.name!" I think it repeats Login()
In response to Crispy
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
Page: 1 2