ID:268027
 
Right now, I'm in the process of making a Capture the Flag game. What I need help with is when someone runs in to the flag, the person gets possesion of it instead of having to grab it with a verb. Sorta like when you bump into it.

~~SSJ4_Gohan_Majin
Look up "Bump() proc" in the help file(F1).

~Ease~
In response to Ease
This is my code:

mob
Red_Flag
icon = 'Red Flag.dmi'
density = 0
Bump(atom/Obstacle)
del('Red Flag.dmi')
overlays += 'Red Flag.dmi'


And when I runover the flag, nothing happens.

P.S. I am a horrible Coder right now!

~~SSJ4_Gohan_Majin
In response to Ease
Ok, I made it into a verb. No errors, but when Im next to the flag, the verb "Get" doesn't come up. Heres my code:

mob
Red_Flag
icon = 'Red Flag.dmi'
density = 1
verb
Get(mob/M in oview(1))
set category = "Flag"
overlays +='Red Flag.dmi'
del('Red Flag.dmi')
My only problem is that it doesn't add the overlays to the usrs icon once I pick up the flag. Code:

turf
Red_Flag
icon = 'Red Flag.dmi'
verb
Get()
set src in view(0)
set category = "Flag"
overlays +='Red Flag.dmi'
usr <<"You have the Red Flag!"
world <<"[usr] has the red flag!"
del(src)


~~SSJ4_Gohan_Majin
For occasions when you want to check and see what your mob has bumped, you want to create a new proc that goes like this:

<code>atom/proc/Bumped() return atom/movable/Bump(atom/A) A.Bumped(src)</code>

Now the Bumped() proc will be called for anything that gets bumped by something else. So if you want someone to bump the flag and move the flag to their contents, you'd do it like this:

<code>obj/flag density = 1 Bumped(mob/M) if(istype(M, /mob)) src.loc = M</code>
In response to SSJ4_Gohan_Majin
You're not specifying usr.overlays. Right now you're overlaying the flag onto itself.