I'm using a modified version of Zilal's ZBT3 text mud as a foundation for movement in my game. Using that, I need some help setting event triggers such as a message being displayed when moving into an area.
I also don't know how to flag an area so certain verbs (specific to the area) become available when you enter. So any help with that would be greatly appreciated.
ID:270621
![]() Jul 9 2006, 11:32 am
|
|
![]() Jul 9 2006, 11:48 am
|
|
Android Data wrote:
> area More like: area |
You've been around more than long enough to know about usr abuse. Why would you include it in a post that's supposed to help somebody?
Entered() and Exited() take arguments (two and one, respectively). The first argument is always the atom that entered/exited. Therefore, you should be using the argument and not usr. Don't post code help unless you're actually being helpful. Providing bad code is worse than providing no help at all. Lummox JR |
I have a problem with that code. I tried using the Move() proc when Entered() is used but I get an error saying the Move() proc is undefined.
I know this must be because I am trying to call the proc under an area but I don't know what to do with it. |
Jon88 wrote:
More like: I was under the impression that usr would be set if a mob were using Entered(). Plus, it was 12 AM when I posted that, and I was doing other things at the time. |
(The real code has everything indented under area.)
area I'm trying to make it so that when the player enters "alargesetofwoodengates", they are asked a question and if answered yes, the Move() proc will take them to "ashortarchway" without having the player move there in the traditional way (moving there by their own action). I don't want the players to be able to leave once they enter the gates. The problem occurs when I get this error: basemobility.dm:184:error:Move:undefined proc I think I am getting this error because the Move() proc probably shouldn't be called under area. |
Android Data wrote:
Jon88 wrote: No. It may be set in Move() (the jury's still out), but it is not at all reliable. usr has no business being in any of the movement procs. Plus, it was 12 AM when I posted that, and I was doing other things at the time. When in doubt, don't. Better not to post at all than to post code help with usr abuse. Lummox JR |
In your alert() calls you need to make sure the message is sent to M, not to usr (which is the default for alert()). You also need to make sure M.client is valid before doing so.
Of course, it's far better not to use an alert() for this case at all, since a simple var can keep track of whether the player is new to that area or not. Lummox JR |