ID:1131338
 
(See the best response by Jemai1.)
Code:
Pokemonswitcher()
set hidden=1
switch(alert("Wich type of pokemon do you wana choose?",name,"1st Gen","2nd Gen"))
if("1st Gen")
switch(input("Wich pokemon do you wana choose?","Switch Pokemon")in usr.Firstlist)
for(var/mob/monster/FirstGen/P in src.Firstlist)
if(P.Used == 1)
P.Used = 0
P.Experiance = Experiance
world << "test save"
P.MaxExperiance = MaxExperiance
P.MaxHealth = MaxHealth
P.Image = Image
P.Element = Element
P.Character = Character
P.icon_state = icon_state
P.MaxAttackPoints = MaxAttackPoints
for(var/mob/monster/FirstGen/P in src.Firstlist)
usr.attack = P.attack
usr.defence = P.defence
usr.spattack = P.spattack
usr.spdefence = P.spdefence
usr.Trait = P.Trait
usr.icon = P.icon
usr.Element = P.Element
usr.Health = P.Health
usr.MaxHealth = P.MaxHealth
usr.icon_state = P.icon_state
usr.Experiance = src.Experiance
usr.MaxExperiance = src.MaxExperiance
usr.AttackPoints = P.AttackPoints
usr.MaxAttackPoints = P.MaxAttackPoints
winset(src,"game_frame.hero","image=\"[P.Image]\"")
interface()
world << "test - load"


Problem description:
For some reason, i cannot Add. or load any pokemons. and i tried many ways. can't figure it out.
Best response
The syntax for switch is the following:
switch(variable)
if(constant_value)
// do stuff
if(another_constant_value) // optional
// do stuff
else // optional
// do stuff


Therefore, the code below is not valid
switch(input("Wich pokemon do you wana choose?","Switch Pokemon")in usr.Firstlist)
for(var/mob/monster/FirstGen/P in src.Firstlist)


What you want might be
// I'm assuming that Firstlist is a list containing /mob/monster/FirstGen instances
var/mob/monster/FirstGen/P = input("Which pokemon do you want to choose?","Switch Pokemon") as null|anything in Firstlist
if(!P) return // no selection
// do stuff with P