ID:176351
 
Ok, I am using Super16's login library as reference.

I made a proc to randomly choose the player's name instead of them being able to choose one. It seems the selected name is not being sent; For example: It'll say your name is your key instead of the randomly chosen one. Below is the proc and the section of the login that the proc is called:

proc
Create()
var/mob/player = new()
alert("Time for you initiation bub.","The Godfather says:")
if(alert("First, we gonna have to hook you up with a hot street alias, any suggestions?","The Godfather says:","I gotta suggestion","Its up to you")=="Its up to you")
Alias()
alert("Ya damn right its up to me, thats how everything is 'round here. So i'll call you [usr.name].","The Godfather says:")
else
Alias()
alert("It doesn't matter what you have! I run thing 'round here. So i'm gonna call you [usr.name].","The Godfather says:")
if(alert("Got a problem?","The Godfather says:","Yeah!","No")=="No")
alert("I thought so...","The Godfather says:")
else
alert("Well get over it!","The Godfather says:")
if(alert(src,"So what you want outta life?","The Godfather says:","Cash money and honies!","I never asked for life, it wanted me.")=="Cash money and honies!")
alert("So you a bit of a hustler, eh.","The Godfather says:")
player.icon='Player.dmi'
player.icon_state="Hustler"
else
alert("So your some kinda thug, eh.","The Godfather says:")
player.icon='Player.dmi'
player.icon_state="Thug"
..()


proc/Alias()
var/name=rand(1,5)
if(name==1)
usr.Alias="Jack the Ripper"
if(name==2)
usr.Alias="Inspectah Deck"
if(name==3)
usr.Alias="Mugsy"
if(name==4)
usr.Alias="Swifety Mc'Vay"
if(name==5)
usr.Alias="Tiny"
//They were more names but I deleted them to save space

mob/var
Alias=""


~Cable
You still get all of the alerts right? just your key shows up instead.
In response to Jnco904
Yes, any when I finally get into the game, my name is switched to "mob".


~Cable
In response to Cable
Do you have any other Login procs in your game? If you do and you need them make sure it says:

mob/player/Login()

or:

mob
player
Login()

If that doesn't help please post the link to the library.

*edit
On second thought, maybe you need to change:

mob/Alias()
var/name=rand(1,5)
if(name==1)
usr.Alias="Jack the Ripper"
if(name==2)
usr.Alias="Inspectah Deck"
if(name==3)
usr.Alias="Mugsy"
if(name==4)
usr.Alias="Swifety Mc'Vay"
if(name==5)
usr.Alias="Tiny"
//They were more names but I deleted them to save space

mob/var
Alias=""

to

mob/player/Alias()
var/name=rand(1,5)
if(name==1)
usr.Alias="Jack the Ripper"
if(name==2)
usr.Alias="Inspectah Deck"
if(name==3)
usr.Alias="Mugsy"
if(name==4)
usr.Alias="Swifety Mc'Vay"
if(name==5)
usr.Alias="Tiny"
//They were more names but I deleted them to save space

mob/player/var
Alias=""

Because it doesn't seem to find the proc, so maybe it has to be in the same directory.
In response to Jnco904
Tried that, it still doesn't work. Do you have AIM or something so I can show you the entire login?

~Cable
Ok, you need to make that their name is their Alias in the Alias proc.

usr.name = usr.Alias

And what jnco904 said is wrong, if the proc is not being called because you have more than one proc, all you do is put ..() at the end of it (or begining if you want it called before the current Login(),) to call one of the other Login() procs, and if that Login() proc has a ..() at the end of it, it will call a different one as well.
In response to Kunark
hehe I should have seen that. Sorry I'm new to this too.
In response to Kunark
Still, not working.

~Cable
What exactly happens? Any errors? The problem might be that you're using usr in a proc. You can always world << src and world << usr to check the values of these.

A neat tip for the nameing system:
var/namelist = list("Name A","Name B","Name C")
var/randname = rand(1,namelist.len)
usr.Alias = namelist[randname]


And that way all you should have to do is add names to the list, instead of making new if() statements and changing rand()s max value. Just a side thought. I wouldn't try something like that until I got the Login code working though.

-<font color="#33ff33">Nova</font>
In response to Jnco904
No that shouldn't be the problem. A proc such as mob/proc/TheProc() is callable by a mob/player/dog/white/cute.

If it couldn't find a proc, it'd return errors.

-<font color="#33ff33">Nova</font>