ID:148730
 
Im trying to shorten the way i need to create my pokemon in battles. I cant seem to get this to work.
var/pokemon = list("Bulbasuar" = new/mob/poke/bulbasuar)

proc/BattleStart(mob/M)
var/pokem
pokem = pick(pokemon)
new/pokem(src.loc)//ill change the src.loc soon
M << "[pokem]"//testing purposes

How would i create a new/pokem picked from a list at the srcs loc?
Replace this:

<code>var/pokemon = list("Bulbasuar" = new/mob/poke/bulbasuar)</code>

With this:

<code>var/pokemon = list("Bulbasuar" = /mob/poke/bulbasuar)</code>
In response to Crispy
Changed it but now i get a runtime error.
runtime error: Cannot create objects of type null.
proc name: BattleStart (/proc/BattleStart)
usr: the guy (/mob/guy)
src: null
call stack:
BattleStart(the guy (/mob/guy))
the guy (/mob/guy): startbattle()
var/mob/pokem = pick(pokemons)
new pokem(src.loc)

Try that.