ID:145444
 
Code:where the snitch moves but i need to know how to finish the catch_snitch verb to where the snitch disapears from the map and into your invitory

mob
Snitch
icon = 'Quiddetch.dmi'
icon_state="snitch"
density=1
New()
. = ..()
spawn()
Wander()
proc/Wander(var/mob/You/P)
while(src)
step_rand(src)
sleep(10)
sleep(10)
spawn(5)
Wander()
verb
Catch_Snitch()
set src in usr.loc
loc = usr
world << "[usr] has cought the snitch!"


Problem description:i need the catch_snitch verb to where it make's the snitch disapear from the map and into your invitory

mob
Snitch //create the snitch and set a few properties
icon = 'Quiddetch.dmi'
icon_state="snitch"
density=1
New() //when SNitch is created
..()
spawn()
src.Wander() //Do Wander()
var/caught //has a var for the Wander() proc
proc
Wander()
while(!src.caught) //while the Snitch isn't caught, caught is null
step_rand(src) //move randomly
sleep(10) //wait a second
spawn(5)
src.Wander()

mob
You
//stuff about You
verb
Catch_Snitch(var/mob/Snitch/S in oview(1)) //You can catch a snitch within one tile
if(istype(S)) //check if S is a snitch
S.loc = usr //move the snitch to your inventory
S.caught = 1 //Snitches 'caught' variable is non-null,Wander() does nothing

In response to SJRDOZER
whats the
//stuff about you

?
In response to SJRDOZER
Or do this:
mob/Snitch
verb
Catch_Snitch()
set src in oview(1)
src.loc = usr
src.caught = 1

That way it doesn't show up all the time in the user's commands and it does the same thing.
In response to VolksBlade
VolksBlade wrote:
whats the
> //stuff about you
>

?

the mob/You as in icon, yada yada. It was stupid :P
In response to SJRDOZER
when i loged in to test out that coding this all came at the same time

Warning: type read from file (/mob/verb/drop) is not defined.
Warning: type read from file (/mob/verb/Catch_Snitch) is not defined.
runtime error: wrong type of value for list
proc name: base LoadMob (/client/proc/base_LoadMob)
source file: Implementation.dm,343
usr: ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter)
src: VolksBlade (/client)
call stack:
VolksBlade (/client): base LoadMob("Tester")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacterResult("Tester")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacterMenu(/list (/list))
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacter()
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): Login()
runtime error: Cannot execute null.base CharacterNames().
proc name: ChooseCharacter (/mob/BaseCamp/ChoosingCharacter/proc/ChooseCharacter)
source file: Implementation.dm,107
usr: ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter)
src: ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter)
call stack:
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacter()
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacterResult("Tester")
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacterMenu(/list (/list))
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): ChooseCharacter()
ChoosingCharacter (/mob/BaseCamp/ChoosingCharacter): Login()
In response to VolksBlade
UMMMMMMMMMMMMMMMMMM huh are you using a character save/load library, that looks familiar.
In response to SJRDOZER
It means your savefile was saved with those verbs, but since they no longer exist, it's creating a problem.

Delete your savefile and try again.
In response to Flame Sage
That'll help me one of these days.
In response to SJRDOZER
none of those codes are working...
In response to VolksBlade
I made similar procs like those codes using my mob and some other mob with an attack verb and they worked just fine.
In response to SJRDOZER
can you post it up so i can see them please?
In response to VolksBlade
        player
icon = 'player.dmi'
hp = 10
verb
Attack()
set src in oview(1)
src.hp -= 1
usr << "You attacked [src.name] and it now has [src.hp] hp left."

The verb is placed under the mob, in this case player. Then in the verb at the top you put in set src in (list of things that can access the verb). In this case it's oview(1) so anyone 1 tile away from the player can use Attack.
src.Attack() is called where src is the player mob, not the person who activated the verb. usr is a user.
I am a different mob who doesn't normally have Attack()