ID:151025
 
Early apologies for my stupidity. I'm new to this...

obj
   verb
      get()
         set src in oview(1)
         if(Move(usr))
            oview() << "[usr] gets [src]."
            usr << "You get [src]."
         else
            usr << "You can't get [src]."


Ok, why is this simple bit of code sometimes causing me problems? Specifically, Move() is returning 0 on objects that should be abled to be picked up, so all of my objects are glued to the floor. I don't have Move() redefined within the object, nor anywhere else in my code. A similar drop() routine works fine. I can set .loc by hand and it works fine, but this should work, right? What else could cause Move() to fail?
Comparing your code to my working code reveals... uh, nothing! I have no idea why you might be getting this problem. However, Move calls many functions--some that come to mind are Bump(), Enter(), Entered(), Exit(), and Exited(). So any of those could, potentially, be interfering.

        verb/get()
                set src in oview(usr, 1)
                if(Move(usr))
                        usr << "You get [src]."
                        if(!owner) owner = usr
                        return 1

objverbget()set src in oview(1)if(Move(usr))oview() << "[usr] gets [src]."usr << "You get [src]."elseusr << "You can't get [src]."


On 6/2/01 9:36 am Skysaw wrote:
Early apologies for my stupidity. I'm new to this...

 obj
    verb
       get()
          set src in oview(1)
          if(Move(usr))
             oview() << "[usr] gets [src]."
             usr << "You get [src]."
          else
             usr << "You can't get [src]."



ok i dont get this.. you have no code in here that would put the object in usr.contents is this your problem? (im not a verry good coder i just learned by reading all the posts.....
In response to Gughunter
Thanks, I did think of that, but still can't track it down.

Small addendum: My drop routine only works for items I create within the users inventory, not with items I pick up by setting .loc.

Going crazy now. I'm sure it's something stupid/simple. :-(

On 6/2/01 9:46 am Gughunter wrote:
Comparing your code to my working code reveals... uh, nothing! I have no idea why you might be getting this problem. However, Move calls many functions--some that come to mind are Bump(), Enter(), Entered(), Exit(), and Exited(). So any of those could, potentially, be interfering.
In response to Gughunter
Ok, revisited this, and found an instance of my redifining Enter(), that commenting out made my get() routine work. But I really don't see how it could have affected it. It was defined as follows:

mob
pc
Enter()
UpdateStats() //stat update when inventory changes
..()

Can anyone explain how this was interfering? I'm missing something about how things are interacting. It's a much less crucial piece of what I'm doing, but I sure am curious.

Thanks!

On 6/2/01 9:46 am Gughunter wrote:
Comparing your code to my working code reveals... uh, nothing! I have no idea why you might be getting this problem. However, Move calls many functions--some that come to mind are Bump(), Enter(), Entered(), Exit(), and Exited(). So any of those could, potentially, be interfering.

verb/get()set src in oview(usr, 1)if(Move(usr))usr << "You get [src]."if(!owner) owner = usrreturn 1

obj
verb
get()
set src in oview(1)
if(Move(usr))
oview() << "[usr] gets [src]."
usr << "You get [src]."
else
usr << "You can't get [src]."

In response to Skysaw
Try "return ..()" instead of "..()". ..() makes it run the default Enter() proc, but the value returned (1 if successful, 0 if not) doesn't actually go anywhere unless you tell it to.

On 6/2/01 10:03 am Skysaw wrote:
Ok, revisited this, and found an instance of my redifining Enter(), that commenting out made my get() routine work. But I really don't see how it could have affected it. It was defined as follows:

mob
pc
Enter()
UpdateStats() //stat update when inventory changes
..()

Can anyone explain how this was interfering? I'm missing something about how things are interacting. It's a much less crucial piece of what I'm doing, but I sure am curious.

Thanks!

On 6/2/01 9:46 am Gughunter wrote:
Comparing your code to my working code reveals... uh, nothing! I have no idea why you might be getting this problem. However, Move calls many functions--some that come to mind are Bump(), Enter(), Entered(), Exit(), and Exited(). So any of those could, potentially, be interfering.

verb/get()
set src in oview(usr, 1)
if(Move(usr))
usr << "You get [src]."
if(!owner) owner = usr
return 1

obj
verb
get()
set src in oview(1)
if(Move(usr))
oview() << "[usr] gets [src]."
usr << "You get [src]."
else
usr << "You can't get [src]."

In response to jobe
ok i dont get this.. you have no code in here that would put the object in usr.contents

Yes he does. "if(Move(usr))"
In response to LexyBitch
Keen eye, thanks! I'll give it a whirl!

On 6/2/01 11:24 am LexyBitch wrote:
Try "return ..()" instead of "..()". ..() makes it run the default Enter() proc, but the value returned (1 if successful, 0 if not) doesn't actually go anywhere unless you tell it to.

On 6/2/01 10:03 am Skysaw wrote:
Ok, revisited this, and found an instance of my redifining Enter(), that commenting out made my get() routine work. But I really don't see how it could have affected it. It was defined as follows:

mob
pc
Enter()
UpdateStats() //stat update when inventory changes
..()

Can anyone explain how this was interfering? I'm missing something about how things are interacting. It's a much less crucial piece of what I'm doing, but I sure am curious.

Thanks!

On 6/2/01 9:46 am Gughunter wrote:
Comparing your code to my working code reveals... uh, nothing! I have no idea why you might be getting this problem. However, Move calls many functions--some that come to mind are Bump(), Enter(), Entered(), Exit(), and Exited(). So any of those could, potentially, be interfering.

verb/get()
set src in oview(usr, 1)
if(Move(usr))
usr << "You get [src]."
if(!owner) owner = usr
return 1

obj
verb
get()
set src in oview(1)
if(Move(usr))
oview() << "[usr] gets [src]."
usr << "You get [src]."
else
usr << "You can't get [src]."