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
Gintonic
Beginner


Joined: 04 May 2018
Posts: 12

PostPosted: Thu Feb 17, 2022 11:51 am   

OnWalkEnd does not fire, if the #WALK is shorter than 2 rooms.
 
Hi everyone,

I have an issue with the OnWalkEnd event, that I cant figure out.
Whenever the WALK is one room, ie. 1 north or south etc. the OnWalkEnd event does not fire.

I'm not sure if this is intended or not. The help file states, OnWalkEnd runs at the end of a speedwalk.

Is there a reason 1 room #WALKS are not considered speedwalks? or what causing this issue?

Regards,

Gintonic
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Thu Feb 17, 2022 3:50 pm   
 
I am not sure you'll get a satisfactory answer from a reliable source.

In terms of code, it really makes no sense to register a move of one room as a speedwalk. It is likely that 2 steps is a minimum. I suppose you could code to get the speedwalk path and test the length. If the length=1 then do an OnEnter event, otherwise just do the onwalkend event.
Reply with quote
Gintonic
Beginner


Joined: 04 May 2018
Posts: 12

PostPosted: Thu Feb 17, 2022 11:14 pm   
 
ok, so how do you go about testing the speedwalk path. I just went trough the built in Help file, but didnt find anything relating speedwalking lenght
Reply with quote
mikeC130
Apprentice


Joined: 03 Jul 2006
Posts: 108

PostPosted: Sun Feb 20, 2022 9:29 pm   
 
You can return the path as a string rather than executing it using %walk(). If you save it as a variable, you can then manipulate and check it using normal string functions.
Reply with quote
Gintonic
Beginner


Joined: 04 May 2018
Posts: 12

PostPosted: Mon Feb 21, 2022 9:16 am   
 
yeah... i dont use path, I let the mapper do its thing. is just tell the room number and the name to attack. I went through the whole help file, i don't think hpoonis proposal is valid, can't seem, to find any function or command that evaluates speedwalk prior the walk command.

personally i think the OnWalkEnd should work every time you use the WALK command, regardless the length of the speedwalk. If I want to move just 1 room I'll use direction instead of the WALK command. but anyway,
i managed to write a half solution, but it wouldve been much easier with a working onwalkend event
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