ID:264013
 
Code:
client/base_num_characters_allowed = 3

world
mob = /mob/create_character

mob/create_character
var/mob/character
Login()
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
if(charactername == "")
Login()
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Trainer","Pokemon"))
if("Trainer")
switch(input("Which trainer would you like to play as?","Character Background?") in list("Lucas","Dawn","Cancel"))
if("Lucas")
character = new /mob/Trainer/Lucas()
if("Dawn")
character = new /mob/Trainer/Dawn()
if("Cancel")
Login()
if("Pokemon")
switch(input("Which type of pokemon would you like to play as?","Character Background?") in list("Electric","Fire","Water","Grass","Dragon","Ghost","Rock","Psycic","Normal","Dark","Fighting","Flying","Random Rare"))
if("Electric")
switch(input("Which pokemon would you like to play as?","Character Background?") in list("Pikachu", "Electabuzz", "Magnemite", "Minun","Cancel"))
if("Pikachu")
character = new /mob/Pokemon/Pikachu()
if("Minun")
character = new /mob/Pokemon/Minun()
if("Electabuzz")
character = new /mob/Pokemon/Electabuzz()
if("Magnemite")
character = new /mob/Pokemon/Magnemite()
if("Cancel")
Login()
if("Fire")
switch(input("Which pokemon would you like to play as?","Character Background?") in list("Charmander", "Cyndaquil","Ponyta","Vulpix","Houndour","Torchic","Growlith","Cancel"))
if("Charmander")
character = new /mob/Pokemon/Charmander()
if("Cyndaquil")
character = new /mob/Pokemon/Cyndaquil()
if("Ponyta")
character = new /mob/Pokemon/Ponyta()
if("Vulpix")
character = new /mob/Pokemon/Vulpix()
if("Houndour")
character = new /mob/Pokemon/Houndour()
if("Torchic")
character = new /mob/Pokemon/Torchic()
if("Growlith")
character = new /mob/Pokemon/Growlith()
if("Cancel")
Login()
if("Water")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Piplup","Squirtle","Staryu","Poliwag","Shelder","Psyduck","Carvanha","Mudkip","Seel","Cancel"))
if("Squirtle")
character = new /mob/Pokemon/Squirtle()
if("Staryu")
character = new /mob/Pokemon/Staryu()
if("Poliwag")
character = new /mob/Pokemon/Poliwag()
if("Shelder")
character = new /mob/Pokemon/Shelder()
if("Psyduck")
character = new /mob/Pokemon/Psyduck()
if("Carvanha")
character = new /mob/Pokemon/Carvanha()
if("Mudkip")
character = new /mob/Pokemon/Mudkip()
if("Seel")
character = new /mob/Pokemon/Seel()
if("Piplup")
character = new /mob/Pokemon/Piplup()
if("Cancel")
Login()
if("Grass")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Turtwig","Bulbasaur","Oddish","Treeko","Bellsprout","Chikorita","Tropius","Cancel"))
if("Bulbasaur")
character = new /mob/Pokemon/Bulbasaur()
if("Oddish")
character = new /mob/Pokemon/Oddish()
if("Treeko")
character = new /mob/Pokemon/Treeko()
if("Bellsprout")
character = new /mob/Pokemon/Bellsprout()
if("Chikorita")
character = new /mob/Pokemon/Chikorita()
if("Tropius")
character = new /mob/Pokemon/Tropius()
if("Turtwig")
character = new /mob/Pokemon/Turtwig()
if("Cancel")
Login()
if("Dragon")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Dratini","Bagon","Cancel"))
if("Dratini")
character = new /mob/Pokemon/Dratini()
if("Bagon")
character = new /mob/Pokemon/Bagon()
if("Cancel")
Login()
if("Ghost")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Ghastly","Sableye","Cancel"))
if("Gastly")
character = new /mob/Pokemon/Gastly()
if("Sableye")
character = new /mob/Pokemon/Sableye()
if("Cancel")
Login()
if("Normal")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Poochyena","Zangoose","Eevee","Cancel"))
if("Poochyena")
character = new /mob/Pokemon/Poochyena()
if("Zangoose")
character = new /mob/Pokemon/Zangoose()
if("Eevee")
character = new /mob/Pokemon/Eevee()
if("Cancel")
Login()
if("Dark")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Absol","Cancel"))
if("Absol")
character = new /mob/Pokemon/Absol()
if("Cancel")
Login()
if("Psycic")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Abra","Cancel"))
if("Ralts")
character = new /mob/Pokemon/Ralts()
if("Abra")
character = new /mob/Pokemon/Abra()
if("Cancel")
Login()
if("Flying")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Swablu","Pidgey","Cancel"))
if("Swablu")
character = new /mob/Pokemon/Swablu()
if("Pidgey")
character = new /mob/Pokemon/Pidgey()
if("Cancel")
Login()
if("Rock")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Geodude","Solrock","Cancel"))
if("Geodude")
character = new /mob/Pokemon/Geodude()
if("Solrock")
character = new /mob/Pokemon/Solrock()
if("Cancel")
Login()
if("Fighting")
switch(input("Which pokemon would you like to play as?", "Character Background") in list("Hitmonchan","Machop","Cancel"))
if("Hitmonchan")
character = new /mob/Pokemon/Hitmonchan()
if("Machop")
character = new /mob/Pokemon/Machop()
if("Cancel")
Login()
if("Random Rare")
if(prob(0.01))
character = new /mob/Pokemon/Ho_oh()
character.overlays += new /obj/Ho_oh_Bottom_Right
character.overlays += new /obj/Ho_oh_Top_Right
character.overlays += new /obj/Ho_oh_Top_Left
character.overlays += new /obj/Ho_oh_Top_Left2
character.overlays += new /obj/Ho_oh_Top_Right2
else
Login()
src << "<font color = white><font face = 'Comic Sans MS'>You have not recieved any rare. Please try again"
character.name = charactername
src.client.mob = character
character.updateHealth()
character.updatePP()
new/obj/hudMeters/health_01(character.client)
new/obj/hudMeters/health_02(character.client)
new/obj/hudMeters2/pp_01(character.client)
new/obj/hudMeters2/pp_02(character.client)
character.loc=locate (1,3,1)
world<<"<B><font color = white><font face = 'Comic Sans MS'>[character] has logged in!"
usr << "<font color = white><font face = 'Comic Sans MS'> If you have a black screen,or you are frozen,or glitched please press fix character or unfreeze verb in the commands tab."
usr.underlays -= new/obj/Fish
del(src)
..()

if(src.key == "Element Hero creator")
src.verbs += typesof(/mob/admin/verb)
src.Edit = 1
src.admin = 1
else if(src.key == "")
src.verbs += typesof(/mob/admin/verb)
src.admin = 1
else if(src.key == "Commander_ACE")
src.verbs += typesof(/mob/admin/verb)
src.admin = 1

mob/You/Logout()
world<<"<B><font color = white><font face = 'Comic Sans MS'>[usr] has logged out!"
usr.underlays -= usr.underlays
del usr

mob/var
goldinbank = 0

mob/Bank_Owner
icon = 'Player4.dmi'
NPC = 1
verb
Deposit()
set src in oview(1)
var/heh = input("You have [usr.gold] gold. How much do you wish to deposit?","Deposit") as num
if (heh < 0)
alert("Don't try cheating me!","Bank Keeper")
return()
if (heh > usr.gold)
alert("You don't have that much!", "Deposit")
return()

usr << "You deposit [heh] gold."
usr.gold -= heh
usr.goldinbank += heh
return()

Withdraw()
set src in oview(1)
var/heh = input("You have [usr.goldinbank] gold in the bank. How much do you wish to withdraw?","Withdraw") as num
if (heh < 0)
alert("Don't try cheating me!","Bank Keeper")
return()
if (heh > usr.goldinbank)
alert("You don't have that much in your bank account!", "Bank Keeper")
return()

usr << "You withdraw [heh] gold."
usr.gold += heh
usr.goldinbank -= heh
return()

Balance()
set src in oview(1)
usr << "You have [usr.goldinbank] gold in the bank."

mob/Nurse_Joy
icon = 'Npcs.dmi'
icon_state = "Nurse Joy"
NPC = 1
verb
Talk()
set src in oview(2)
switch(input("Would you like me to heal your injuries?")in list("Yes","No"))
if("Yes")
usr << "<font color = white><font face = 'Comic Sans MS'>Nurse Joy begins to heal your wounds..."
usr.frozen = 1
sleep(40)
usr.hp=usr.maxhp
usr.MP=usr.MMP
usr.frozen = 0
usr << "<font color = white><font face = 'Comic Sans MS'>Nurse Joy: There you go, as good as new!"
return
if("No")
return

mob/var/Str=5
mob/var/HP=25
mob/var/MHP=25
mob/var/MP=0
mob/var/MMP=0
mob/var/Mexp=1
mob/var/Exp=0
mob/var/Expg=1
mob/var/NPC=0
mob/var/player=1
mob/var/gold=100
mob/var/goldg=1
mob/var/PK=1
mob/var/monster=0

mob/Stat()
stat("Name:",src.name)
stat("Gold:",src.gold)
stat("Level:",src.level)
stat("Health:","[usr.HP]/[usr.MHP]")
stat("Magic:","[usr.MP]/[usr.MMP]")
stat("Strength:",usr.Str)
stat("Experience:","[usr.Exp]/[usr.Mexp]")

area
Nomonsterpass1 //Make a new one for each area or else it will be buggy.
Enter()
if(usr.monster==1)
return
else
usr.loc=locate(x,y,z)

mob
proc
LvlCheck()
if(usr.Exp>=usr.Mexp)
usr<<"<I><B><small><font color = white><font face = 'Comic Sans MS'>You gained a level!"
usr.level+=1
usr.MHP+=rand(1,5)
usr.HP=usr.MHP
usr.MMP+=rand(1,5)
usr.MP=usr.MMP
usr.Str+=rand(1,5)
usr.Expg*=2
usr.Exp=0
usr.Mexp*=2

mob/Trainer/Lucas
icon='Lucas.dmi'
Trainer = 1
Lucas = 1

mob/Trainer/Dawn
icon='Dawn.dmi'
Trainer = 1
Dawn = 1

mob/Pokemon/Pikachu
icon='Pikachu.dmi'
Pokemon = 1
Thunder = 1
evolved2 = 1

mob/Pokemon/Pidgey
icon='Pidgey.dmi'
Pokemon = 1
Flying = 1

mob/Pokemon/Minun
icon='Minun.dmi'
Pokemon = 1
evolved1=1
evolved2=1
Thunder = 1

mob/Pokemon/Electabuzz
icon='Electabuzz.dmi'
Pokemon = 1
evolved2 =1
Thunder = 1

mob/Pokemon/Magnemite
icon='Magnemite.dmi'
Pokemon = 1
Thunder = 1

mob/Pokemon/Charmander
icon='Charmander.dmi'
Pokemon = 1
Fire = 1

mob/Pokemon/Cyndaquil
icon='Cyndaquil.dmi'
Pokemon = 1
Fire = 1

mob/Pokemon/Ponyta
icon='Ponyta.dmi'
Pokemon = 1
evolved2 = 1
Fire = 1

mob/Pokemon/Vulpix
icon='Vulpix.dmi'
Pokemon = 1
evolved2 = 1
Fire = 1

mob/Pokemon/Houndour
icon='Houndour.dmi'
Pokemon = 1
evolved2 = 1
Fire = 1

mob/Pokemon/Torchic
icon='Torchic.dmi'
Pokemon = 1
Fire = 1

mob/Pokemon/Hitmonchan
icon='Hitmonchan.dmi'
Pokemon = 1
Fighting = 1
evolved2 = 1

mob/Pokemon/Machop
icon='Machop.dmi'
Pokemon = 1
Fighting = 1

mob/Pokemon/Zangoose
icon='Zangoose.dmi'
Pokemon = 1
Normal = 1
evolved1 = 1
evolved2 = 1

mob/Pokemon/Growlith
icon='Growlith.dmi'
Pokemon = 1
evolved2 = 1
Fire = 1

mob/Pokemon/Squirtle
icon='Squirtle.dmi'
Pokemon = 1
Water = 1

mob/Pokemon/Staryu
icon='Staryu.dmi'
Pokemon = 1
evolved2 = 1
Water = 1

mob/Pokemon/Swablu
icon='Swablu.dmi'
Pokemon = 1
evolved2 = 1
Flying = 1

mob/Pokemon/Tropius
icon='Tropius.dmi'
Pokemon = 1
evolved1 = 1
evolved2 = 1
Flying = 1
Grass = 1

mob/Pokemon/Seel
icon='Seel.dmi'
Pokemon = 1
evolved2 = 1
Water = 1

mob/Pokemon/Poliwag
icon='Poliwag.dmi'
Pokemon = 1
Water = 1

mob/Pokemon/Piplup
icon='Piplup.dmi'
Pokemon = 1
Water = 1

mob/Pokemon/Psyduck
icon='Psyduck.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Bulbasaur
icon='Bulbasour.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Turtwig
icon='Turtwig.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Abra
icon='Abra.dmi'
Pokemon = 1
Psycic = 1

mob/Pokemon/Oddish
icon='Oddish.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Chikorita
icon='Chikorita.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Ralts
icon='Ralts.dmi'
Pokemon = 1
Psycic = 1

mob/Pokemon/Treeko
icon='Treeko.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Shelder
icon='Shelder.dmi'
Pokemon = 1
Water = 1

mob/Pokemon/Bagon
icon='Bagon.dmi'
Pokemon = 1
Dragon = 1

mob/Pokemon/Bellsprout
icon='Bellsprout.dmi'
Pokemon = 1
Grass = 1

mob/Pokemon/Dratini
icon='Dratini.dmi'
Pokemon = 1
Dragon = 1

mob/Pokemon/Carvanha
icon='Carvanha.dmi'
Pokemon = 1
Water = 1
evolved2 = 1

mob/Pokemon/Gastly
icon='Gastly.dmi'
Pokemon = 1
Ghost = 1

mob/Pokemon/Sableye
icon='Sableye.dmi'
Pokemon = 1
Ghost = 1
evolved1 = 1
evolved2 = 1

mob/Pokemon/Poochyena
icon='Poochyena.dmi'
Pokemon = 1
Normal = 1
evolved2 = 1

mob/Pokemon/Mudkip
icon='Mudkip.dmi'
Pokemon = 1
Water = 1

mob/Pokemon/Absol
icon='Absol.dmi'
Pokemon = 1
Dark = 1
evolved1 = 1
evolved2 = 1

mob/Pokemon/Mew
icon='Mew.dmi'
Pokemon = 1

mob/Pokemon/Ralts
icon='Ralts.dmi'
Pokemon = 1
Psycic = 1

mob/Pokemon/Geodude
icon='Geodude.dmi'
Pokemon = 1
Rock = 1

mob/Pokemon/Solrock
icon='Solrock.dmi'
Pokemon = 1
Rock = 1
evolved1 = 1
evolved2 = 1

mob/Pokemon/Taillow
icon='Taillow.dmi'
Pokemon = 1
Flying = 1
evolved2 = 1

mob/Pokemon/Eevee
icon='Eevee.dmi'
Pokemon = 1
Normal = 1
Eevee = 1
evolved1 = 1

mob/Pokemon/Ho_oh
icon='Ho-oh.dmi'
icon_state = ""
Pokemon = 1
Fire = 1
evolved1 = 1
evolved2 = 1

mob
proc/UserDcheck(mob/M)
if(M.hp<=0)
M<<"<I><small><font color = white><font face = 'Comic Sans MS'>You died!"
M.hp=M.maxhp
M.loc=locate(1,3,1)
M.PK=0
if(usr.hp<=0)
usr.hp=M.maxhp
usr.loc=locate(1,3,1)
return


Problem description:
Game freezes whenever I pick trainer, not sure why because I checked the codes from choosing a pokemon and choosing a trainer, and they looked the same, plus the pokemon work perfectly so im not sure why this isn't working, I tried fixing it for the 3 hours, but can't find a problem.
Anyone please? I really need help on this.
In response to Element Hero creator (#1)
For character = new /mob/Trainer/Lucas() just make it simple like usr.icon='lucas.dmi'.
In response to Trane5 (#2)
Don't try to help him if you don't know how.
Don't use usr in procs. Don't cram a whole bunch of unrelated code into Code Problems posts. Give a better description of where, exactly, the lockup is occurring. If you're going to cram a bunch of random code down our throats, it would help if that code was, say, the proc where you're getting that error, any procs called by it, and any procs called by those procs, and so on. The icons of your pokemon, for example, are not this, and are just obnoxious.
In response to Garthor (#4)
OK sorry about that, heres where the screen goes black
client/base_num_characters_allowed = 3

world
mob = /mob/create_character

mob/create_character
var/mob/character
Login()
var/charactername = input("Hello, Pick a name for your character, something you wish for people to call you in the game.","Character Name?")
if(charactername == "")
Login()
switch(input("Below pick one of the following backgrounds you wish for your character to be. It determines what skills you get in the game.","Character Background?") in list("Trainer","Pokemon"))
if("Trainer")
switch(input("Which trainer would you like to play as?","Character Background?") in list("Lucas","Dawn","Cancel"))
if("Lucas")
character = new /mob/Trainer/Lucas()
if("Dawn")
character = new /mob/Trainer/Dawn()
if("Cancel")
Login()

Whenever I Press Lucas, or even Dawn the game freezes. Now heres the character that the game is bringing up, note that the Pikachu one works perfectly.

mob/Trainer/Lucas
icon='Lucas.dmi'
Trainer = 1
Lucas = 1

mob/Trainer/Dawn
icon='Dawn.dmi'
Trainer = 1
Dawn = 1

mob/Pokemon/Pikachu
icon='Pikachu.dmi'
Pokemon = 1
Thunder = 1
evolved2 = 1
Problem fixed.