ID:148858
 
I wrote this code for a login code in my new RPG, but it will not work. For some reason, I get no errors, yet when I try it the player does not have an icon. Here is the code:

mob
Login()
alert("Welcome to Legendary Saviour [usr]. This shall be a large RPG with many quests and things to do, with an original storyline you shall follow, and in time become the Legendary Saviour!","Legendary Saviour")
usr.name=input("What would you like your name to be?","[key]")
switch(input("Below pick one of the following classes you wish for your character to be. It determines what skills you get in the game.","Character Class?") in list("Mage","Fighter"))
if ("Mage")
src = new /mob/characters/mage()
usr.loc = locate(1,2,1)
else if ("Fighter")
src = new /mob/characters/fighter()
usr.loc = locate(1,2,1)
..()

mob/var
class
hp
mp
strength
gold

mob/characters/mage
icon = 'players.dmi'
icon_state = "mage"
class = "Mage"

mob/characters/fighter
icon = 'players.dmi'
icon_state = "fighter"
class = "Mage"
Adamb55 wrote:
src = new /mob/characters/mage()
usr.loc = locate(1,2,1)


src = new /mob/characters/fighter()

Shouldnt the src = be src.client =?
-DogMan
In response to Dog Man
Shouldnt the src = be src.client =?
-DogMan

Well I tried that yet still no icon shows up for either class.






-Adam
In response to Adamb55
mob/characters/mage
icon = 'players.dmi'
icon_state = "mage"
class = "Mage"

mob/characters/fighter
icon = 'players.dmi'
icon_state = "fighter"
class = "Mage"

you have mage as the fighters class, try putting class as fighter...
In response to Nick231
Nick231 wrote:
mob/characters/mage
icon = 'players.dmi'
icon_state = "mage"
class = "Mage"

mob/characters/fighter
icon = 'players.dmi'
icon_state = "fighter"
class = "Mage"

you have mage as the fighters class, try putting class as fighter...
Thats nothing to do with the icons though -.- thanks for the help but this is really slowing my progress down so I seriously need a way to fix it. (Sorry if this is taken as being rude)






-Adam
In response to Adamb55
I dont know Im havin a lil trouble with my Login() because It wont go thru the login process and it shows no icon
In response to Charlesisdapimp
simple solution....

Change src = new /mob/yaddayaddayadda to....

src.client.mob = new /mob/yaddayaddayadda

:)

--Griz--
In response to Griswald
yo ad, this this:

Login()
alert("Welcome to Legendary Saviour [usr]. This shall be a large RPG with many quests and things to do, with an original storyline you shall follow, and in time become the Legendary Saviour!","Legendary Saviour")
usr.name=input("What would you like your name to be?","[key]")
switch(input("Below pick one of the following classes you wish for your character to be. It determines what skills you get in the game.","Character Class?") in list("Mage","Fighter"))
if ("Mage")
src = new /mob/characters/mage()
usr.loc = locate(1,2,1)
else if ("Fighter")
src = new /mob/characters/fighter()
usr.loc = locate(1,2,1)
..()

Notice the indentation. It might be that.

Another reason might be:

src:key = new /mob/characters/mage()

OR just don't use this bit at all and change all of the variables eg. icon, manually. SO:

Login()
alert("Welcome to Legendary Saviour [usr]. This shall be a large RPG with many quests and things to do, with an original storyline you shall follow, and in time become the Legendary Saviour!","Legendary Saviour")
usr.name=input("What would you like your name to be?","[key]")
switch(input("Below pick one of the following classes you wish for your character to be. It determines what skills you get in the game.","Character Class?") in list("Mage","Fighter"))
if ("Mage")
icon = 'mage.dmi' [edited from ==]
etc...



Adamb55 wrote:
I wrote this code for a login code in my new RPG, but it will not work. For some reason, I get no errors, yet when I try it the player does not have an icon. Here is the code:

mob
Login()
//your login alert here
var/mob_name=input("What would you like your name to be?","[key]")
var/mob/init_mob //or whatever you wanna name it
switch(input("Below pick one of the following classes you wish for your character to be. It determines what skills you get in the game.","Character Class?") in list("Mage","Fighter"))
if ("Mage")
init_mob = new /mob/characters/mage()
if ("Fighter")
init_mob = new /mob/characters/fighter()
init_mob.name = mob_name //names the mob
init_mob.loc = locate(1,2,1)
src.client.mob = init_mob
del(src)


mob/var
class
hp
mp
strength
gold

mob/characters/mage
icon = 'players.dmi'
icon_state = "mage"
class = "Mage"

mob/characters/fighter
icon = 'players.dmi'
icon_state = "fighter"
class = "Fighter"
In response to Soori-99
Somebody delete those useless posts.