Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
pawnmower
Beginner


Joined: 16 Apr 2016
Posts: 12

PostPosted: Thu Oct 15, 2020 12:26 am   

Speedwalking with the #teleport command
 
So, I am not the greatest at this..I apologize if this has been covered elsewhere. I have looked and looked and unable to find an answer.

I've been mapping a mud, and using the #teleport command (via triggers) to correct my map location to a certain room number like:

Code:
<trigger priority="25" id="23">
  <pattern>You are at the intersection between Old Road and Silver Street.  The$</pattern>
  <value>#tel 710</value>
</trigger>


The problem I am running into is that if I run past a room and my trigger fires , the #tel trigger fires last... and then sets me back so it ends up making me not in the right room on my map. If I speedwalk to a room that I have a #teleport trigger set up for and stop in that room, then it works great. But if I run PAST the room the #teleport trigger fires at the end, and even though I am past the room it sets me back to that room.

I have all of these #teleport triggers in a class I call "map location triggers".

Here is what the class looks like:

Code:
<class name="map triggers" id="6">
  <trigger priority="70" id="7">
    <pattern>Welcome to the End of the Line player lounge.  It consists of a spacious</pattern>
    <value>#tel 682</value>
  </trigger>
  <trigger priority="1" id="8">
    <pattern>This is the center of Eternal City, the city of infinity.  All around you</pattern>
    <value>#tel 598
</value>
  </trigger>
  <trigger priority="170" id="17">
    <pattern>^stay at the Bed &amp; Breakfast Inn.  The only outstanding feature of the room</pattern>
    <value>#tel 604</value>
  </trigger>
  <trigger priority="25" id="23">
    <pattern>You are at the intersection between Old Road and Silver Street.  The$</pattern>
    <value>#tel 710</value>
  </trigger>
  <trigger priority="240" id="24">
    <pattern>^through interdimensional gates in a terrifying maelstrom of hooves and</pattern>
    <value>#tel 1331</value>
  </trigger>
  <trigger priority="300" id="30">
    <pattern>You are standing in the center of Dyrathea, a small, elven town.</pattern>
    <value>#tel 1331</value>
  </trigger>
  <trigger priority="330" id="33">
    <pattern>You stand before the altar of the Temple of the Ages.  Sitting high atop$</pattern>
    <value>#tel 1241</value>
  </trigger>
  <trigger priority="380" id="38">
    <pattern>You are at the intersection of Zoom street and La La lane. This</pattern>
    <value>#tel 1865</value>
  </trigger>
  <trigger priority="410" id="45">
    <pattern>To the east you see some vegetation!$</pattern>
    <value>#tel 2198</value>
  </trigger>
  <trigger priority="390" id="46">
    <pattern>Here there is the fair Hamlet of Yxuxacta, which$</pattern>
    <value>#tel 2088</value>
  </trigger>
  <trigger priority="420" id="47">
    <pattern>the desert floor on a shimmering gossamer thread.$</pattern>
    <value>#tel 2212</value>
  </trigger>
  <trigger priority="400" id="48">
    <pattern>To the north you can see some ruins.$</pattern>
    <value>#tel 2182</value>
  </trigger>
  <trigger priority="440" id="50">
    <pattern>^Far to the south you see some mountains.</pattern>
    <value>#tel 2179</value>
  </trigger>
  <trigger priority="430" id="51">
    <pattern>^At the foot of the Mountains of Madness</pattern>
    <value>#tel 2197</value>
  </trigger>
</class>



So, my questions:

1) is there a way to turn off a class of triggers while speedwalking only?
2) is there some other way to have the #teleport trigger NOT fire during speedwalking by using a command within the script?
3) is there a better command than #teleport that I should use?

I love speedwalking with double clicks, I just dont want certain triggers to fire while speedwalking whereas other triggers I do not care if they fire afterwards...its JUST my "map location triggers" I dont want firing during speedwalks.


Thank you very much and apologies for the noob question!
Reply with quote
pawnmower
Beginner


Joined: 16 Apr 2016
Posts: 12

PostPosted: Thu Oct 15, 2020 2:01 am   
 
Just a thought -- but would using the #event OnRoomWalk command work to be able to ignore the class somehow?
Also, #event OnRoomWalk seems to fire for any movement, not just speedwalking as the documentation suggests...or am I doing something wrong? Or is OnRoomWalk broken?


Also, Is there a Speedwalking START event?I definitely feel like since there is an OnWalkEnd there should be an OnWalkStart ...

Anyhow, thanks again for any guidance.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4272
Location: Pensacola, FL, USA

PostPosted: Thu Oct 15, 2020 12:09 pm   
 
onRoomWalk goes off whenever a movement command is entered.
Even going only one room is still a walk, just not a significant one.

No walk start event, unfortunately.

If you put the map into slow or safe mode, you are less likely to lose your position on the map, the trigger should only fire when you are in the right room.

The #FIND command tells CMUD to look at the room and try to update the "You are here" dot based on the description.
Assuming that works for you, there is no need for the #TELEPORT command unless you are actually teleporting.

If you make your own speedwalker based off a destination variable, you can have stuff not fire while @destination has a value
_________________
Discord: Shalimar#3679
Reply with quote
pawnmower
Beginner


Joined: 16 Apr 2016
Posts: 12

PostPosted: Thu Oct 15, 2020 2:37 pm   
 
Shalimar,

Thank you for your comments! I appreciate the time you take to respond to everyone and I have been reading your posts all night trying to learn a few things! You are amazing!


shalimar wrote:
onRoomWalk goes off whenever a movement command is entered.
Even going only one room is still a walk, just not a significant one.


That to me seems like a bug / not working as intended..for a couple reasons:

1) The documentation specifically says OnRoomWalk is for speedwalking:

https://i.imgur.com/zsPSCb3.png

2) OnRoomEnter and OnRoomWalk seem pretty redundant...it just seems like OnRoomEnter should be for manually entering rooms via commands like N , S , E , W etc...and OnRoomWalk should be for speedwalking as the manual suggests.

3) OnWalkEnd doesn't fire after you arrive from normally moving around. OnWalkEnd ONLY fires at the end of a speedwalk...so it just makes sense that OnRoomWalk should only fire during a speedwalk.




shalimar wrote:

No walk start event, unfortunately.


Yeah, that is unfortunate. Even if OnRoomWalk was working properly (firing every time you speedwalked into a room) it would still be nice and logical to have an OnWalkStart since there is an OnWalkEnd. Bummer.

shalimar wrote:

If you put the map into slow or safe mode, you are less likely to lose your position on the map, the trigger should only fire when you are in the right room.


I'll play around with this some more, but so far I haven't had much luck with getting <#tel 1234> to fire fast enough in those other modes, for some reason. More testing required on my part.

shalimar wrote:

The #FIND command tells CMUD to look at the room and try to update the "You are here" dot based on the description.
Assuming that works for you, there is no need for the #TELEPORT command unless you are actually teleporting.


In my eyes, #FIND is inferior (if you already know your location and have already seen the room description....) as it requires "looking" which is an additional interaction with the MUD. #TEL should be a cleaner / faster way of moving the dot. Its definietly a nice feature when you don't know where you are...and you need to look...but if you know where you are a #tel to move the dot seems better to me.

shalimar wrote:

If you make your own speedwalker based off a destination variable, you can have stuff not fire while @destination has a value


I will have to play around with this! Again, thank you for your comments and fast response. You have given me a direction to go in. Much appreciated.[/img]
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4272
Location: Pensacola, FL, USA

PostPosted: Thu Oct 15, 2020 2:57 pm   
 
onRoomWalk fires when you enter a movement command, before you move
onRoomEnter fires when you arrive in a new room, after you move
So they are not the same, though its a matter of milliseconds most of the time.

Yes, find issues a look command, as it needs current information on which to base its query off of.
Not an unrealistic requirement given there are often multiple ways in which a given character can be bombarded with room descriptions without travelling.
You can also move the dot with the #LOCATION command (as well as add more dots.)

Here is some of the code I use with the @destination variable:

#IF (@destination) {
$path=%pathexpand(%pathfrom(, @destination))
#EXEC %pop($path)
}
_________________
Discord: Shalimar#3679
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net