ID:178676
![]() Apr 18 2002, 10:19 am
|
|
How would i make it where if you step on an object youll pick it up instead of clicking a verb to get it
|
SuperGoku15 wrote:
How would i make it where if you step on an object youll pick it up instead of clicking a verb to get it One way to do that would be this: turf Lummox JR |
Kappa the Imp wrote:
> obj/blah -Kappa the Imp LOL! That will put the object in the user's contents only if the user first goes into the object's contents! Not to mention, using usr inside of Move is a bad idea. Try it this way: turf |
One way to do that would be this: turf Lummox JR so would i have to change the object to a turf or would it work as an object? |
I've been trying what you guys said but nothing seems to work can you tell me whats wrong with this it gives me no errors but you dont pick up the item
heart |
That should be the turf/Entered() proc, not the heart/Entered() proc. You might also look at http://www.deadron.com/byond/ByondBwicki.dmb?TriggeredObjs
|
SuperGoku15 wrote:
so would i have to change the object to a turf or would it work as an object? Nope, you shouldn't have to change anything. The code I put there is for the turf, not the objects you're picking up. Essentially, for every turf you step on, the turf will say "This is a mob, who wants to pick things up. So, I'm going to loop through my contents and find things (s)he can pick up." The objects themselves have no direct way of knowing that a user has stepped onto the same tile as them. When a player moves, Move() calls several procs, including Entered() for their new location (almost always a turf, but it's also used for areas). Other objects on the same turf don't have anything called, so the only way to let them know is for turf.Entered() or the mob to tell them. This is the reason that to implement a trap, you need to tell the turf there are traps there: turf Lummox JR |
SuperGoku15 wrote:
I've been trying what you guys said but nothing seems to work can you tell me whats wrong with this it gives me no errors but you dont pick up the item > heart There are a few problems here. The first: Never ever use usr inside Entered(). usr is for verbs, and you should only use it there unless you're absolutely sure you know what you're doing with it. Also, as Shadowdarke said, you need to make this turf.Entered(), not obj/heart.Entered(). And, although it probably doesn't matter in the text output, I'd close that <B> tag with a </B>. Try this instead: turf Lummox JR |
-Kappa the Imp