ID:178761
 
I have an object with a verb to pick it up. After it is picked up a timer begins to time the amount of time it takes the player to take this object from point a to point b. I have this all working, however, I need to be able to remove the object from the players sight after it is picked up. If I use the del() proc it halts the timer and nulls out all references to the object. Does anyone know of a way of accomplishing this? Also the Pick Up verb in the code below bis left in the comands panel after it's clicked. If you click it again it removes the verb this casues problems with the code as it allows the player to pick up 2 rocks and starts 2 timers.

I stripped the code down to this and I still get the same result.


Pick_Up()
set src in view(1)
del(src)

Leaves the verb even tho the src is deleted.


Here is the code I have been playing with:

/obj
blue_rock
icon = 'blue_rock.dmi'
verb
Pick_Up()
set src in view(1) //Must be close
usr << "Take this to the blue square"
usr.has_rock = 1 //Player has a rock
usr.dest = locate(3,16,1) //Rock Dest
//del(src)
//src.invisibility = 101 //Make Invis
StartTimer() //Time how long it takes


Shwn wrote:
I have an object with a verb to pick it up. After it is picked up a timer begins to time the amount of time it takes the player to take this object from point a to point b. I have this all working, however, I need to be able to remove the object from the players sight after it is picked up. If I use the del() proc it halts the timer and nulls out all references to the object. Does anyone know of a way of accomplishing this? Also the Pick Up verb in the code below bis left in the comands panel after it's clicked. If you click it again it removes the verb this casues problems with the code as it allows the player to pick up 2 rocks and starts 2 timers.

I stripped the code down to this and I still get the same result.

<snip>
Pick_Up()
set src in view(1)
del(src)
</snip>
Leaves the verb even tho the src is deleted.


Here is the code I have been playing with:

/obj
blue_rock
icon = 'blue_rock.dmi'
verb
Pick_Up()
set src in view(1) //Must be close
usr << "Take this to the blue square"
usr.has_rock = 1 //Player has a rock
usr.dest = locate(3,16,1) //Rock Dest
//del(src)
//src.invisibility = 101 //Make Invis
StartTimer() //Time how long it takes

Usually get verbs will place the object in within usr.contents. Is there a reason you wish to avoid this? It would solve your problems.

change del(src) to Move(usr)
I suggest you just move the rock into the usr's contents, just by adding a simple <code><nobr>src.Move(usr)</nobr></ code>, then just delete it after you are done with it.

-Rcet