Anchors
-
Ok, this is something I've been using for a while now in my scripting in some form or the other.
Scenario: You want to keep track of two locations, regardless of vnums, such that the scripting will work anywhere in the game. For instance, you want to mark the current room and a destination (predefined or chosen at random).
Well, what I would do is use what I call an Anchor. Anchors are usually wizimobs (protected with all detects and whatnot) with a UNIQUE name. Using the mm#mm format is always a good bet. Wizi is usually needed if players will ever see the mobile in any way shape or form. With a uniquely named mob, you can TARGET that mobile with a script remotely, and be guaranteed to zero in on that mobile, provided the script entity can SEE it (only considered on mobiles of course).
There are two ways to use an Anchor mobile: to mark the current location or forcing it to a remote location. Both ways will make the script work anywhere in the game.
An example of this is on the eerie green mist in Lestat. It propagates through the exits by loading an anchor mob and forcing a wizimob to roam about, which targets the anchor mobile in a goto, and proceeds with each lateral exit in the original room.
Another example is an attack used by Minobe (which is still being worked on) in which he grabs you and flings you out a random lateral exit. It uses a wizimob to move to the desired exit in which he then uses as an anchor to transfer you to and to target when he "pursues".
-
substitution code, there is a way to do anchors without the need for pesky anchor mobs.
Create a general token and have the mob give itself one. (of course! brilliant!)
Priming the token:
token adjust $i VNUM VALUE# = $[[room $i]]Using stored location:
mob goto $[[tokenvalue $i VNUM VALUE#]] -
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login