ID:264856
 
Code:
mob
pokemon
density= 1
icon = 'pokemons.dmi'
icon_state = "Charmander"
playertype = "Pokemon"
obj
Pokeball
name = "Pokeball"
icon = 'items.dmi'
icon_state = "pokeball"
density = 1

Bump(var/mob/M in oview(8))
if(M.playertype == "Pokemon")
oview(8) << "<b>[usr] has caught [M]!"
del(src)
if(istype(M,/mob))
del(src)
if(istype(M,/turf))
del(src)
if(istype(M,/obj))
del(src)

mob
verb
Throw_Pokeball()
if(usr.ballcount <= 0)
usr << "<b>Your out of pokeballs!"
else
var/C = new/obj/Pokeball
oview(8) << "<b>[usr]: Go Pokeball!"
C:loc = locate(usr.x,usr.y,usr.z)
C:owner = usr
usr.ballcount -= 1
C:dir = usr.dir
walk(C,dir)


Problem description: Well right now im just trying to make my catching system as simple as possible at the moment and when I throw the pokeball at charmander it wont say [usr]: Go Pokeball! or catch the charmander it will just hit the charmander and delete itself

The pokeball deleting itself is due to the fact your telling it to... 4 times... Go figure.

            if(M.playertype == "Pokemon")
oview(8) << "<b>[usr] has caught [M]!"
del(src)
if(istype(M,/mob))
del(src)
if(istype(M,/turf))
del(src)
if(istype(M,/obj))
del(src)


As for the [usr] thing. Change the line :

oview(8) << "<b>[usr]: Go Pokeball!"


to

view(8) << "<b>[usr]: Go Pokeball!"
There is certainly a lot you're doing wrong here.

One thing of note is that you should not be using : at all in the Throw_Pokeball verb. To get around this you should be doing var/obj/pokeball/C = new. Also instead of doing C:loc = locate(usr.x,usr.y,usr.z) you could just do C.loc = usr.loc.
In response to LordAndrew
OK I did what both of you said and it reconizes the Charmander as a Pokemon but it won't say [usr] has caught [M] now and I changed the verbs like you said and I got these errors

Catching System.dm:36:error: C.loc: undefined type: C.loc
Catching System.dm:37:error: C.owner: undefined type: C.owner
Catching System.dm:39:error: C.dir: undefined type: C.dir
Catching System.dm:40:error: C: undefined type: C
Catching System.dm:34:error: C: unknown variable type
Since no one really helped you.. here:

http://www.byond.com/ members/?command=reference&path=atom%2Fmovable%2Fproc%2FBump #comment_1

Bump(var/mob/M in oview(8)) // this is wrong

// I think creating a Bumped() proc would be simpler.

mob/pokemon/Bumped(atom/movable/M)
if(M is a pokeball) // if the thing that bumped into you is a pokeball...
catch me...
In response to Ruben7
I got it working (sort of) but im have pokemon as people so what should i do
In response to Mr. Chex
Hmm.. what?
In response to Ruben7
Nevermind I have everything working find now, I don't need help anymore. Thank You everyone!