ID:163395
Sep 1 2007, 3:18 pm
|
|
how would i make it so that if i walk over an object, i pick it up automatically? an example would be great! :)
|
In response to GhostAnime
|
|
something like
obj i think that should work |
In response to JaxxMarron
|
|
No no no. First of all, I am pretty sure you don't know how Entered() really works.
No, Enter() and the related movement proc isn't called when you take a step, they are called when you enter/exit another atom's contents. When you move, you enter the /area and /turf contents (well, really the /turf which contains /area). For /obj and /atom, you have to be added in to thier contents, like how you do with items. What I was referring for you to do is something similar to this mob.Move() Also, didn't I mention using 'usr' is not a good idea in any movement procs? |
In response to GhostAnime
|
|
so i just put in when i Enter(), it goes to src.Move()?
|
In response to Jman9901
|
|
No... read the DM REF!
For Enter() it states: When: Called when an object attempts to enter the contents list. You want to modify mob.Move(), not obj.Enter() |
In response to GhostAnime
|
|
can you give an example? im having a hard time following...
|
In response to Jman9901
|
|
See the example on Move() I showed in [link]
What you should add to it is probably locate(), to see if there's a non-dense /obj underneath you, and call the pickup verb or move it in to the mob |
In response to GhostAnime
|
|
the locate() thing probably wouldnt work because the turf you're on has a density of 0... and ill check out the Move thing also...
|
In response to Jman9901
|
|
Obviously you don't know what locate() does, look it up in the DM Reference.
|
In response to GhostAnime
|
|
alrighty then.
|
- Call ..() when you want to move ahead
- NEVER EVER use 'usr'. This is one of the worst procs to use it in.