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
symposes
Novice


Joined: 26 Apr 2006
Posts: 38

PostPosted: Wed Feb 11, 2026 1:17 pm   

Trying to find a way to call out the value of a .path
 
I've struggled for a while and hit a brick wall.

I am trying to setup a small script that will tell me the stored path in a path.

So if the .battleground would cause cmud to move my character 2ne3s, id like a way to retrieve that path string for manipulation

I currently do this by hand, copy it and drop it in %pathexpand()

I have never been able to get slow walk to work, so instead I built a very simple stepper that uses %pop to retrieve each step of a given path. But as an experiment im trying to bridge the .path system into this stepper so I can record these stepper paths more easily.
Im not sure why the slow walk fails. So for now im not trying to fix it. I just was hoping to be able to essentially make a working script that can retrieve the path.

I saw the manual reference for paths with zs.numpath() and zs.getpath() but this all alludes me on my own. Id love a little help.

Thank you in advance.
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 875
Location: USA

PostPosted: Wed Feb 11, 2026 11:22 pm   Re: Trying to find a way to call out the value of a .path
 
symposes wrote:

I saw the manual reference for paths with zs.numpath() and zs.getpath() but this all alludes me on my own. Id love a little help.


Create an alias named testpathextraction with Language set to Lua.

zs.print(zs.getpath(zs.param(1)).value)
zs.var.valueoftestpath = zs.getpath(zs.param(1)).value

If you run it
testpathextraction testpath

then the set of directions in testpath will be echoed on the screen and copied into the CMUD variable valueoftestpath.

It seems like there should be an easy way to do this in zScript but I don't see it since you can't treat the path as a regular variable like #ECHO @testpath and the list of path functions doesn't seem to include one to get the value of the path.
https://forums.zuggsoft.com/modules/mx_kb/kb.php?mode=doc&page=3&refpage=3&a=cmud_%25pathexpand
Reply with quote
symposes
Novice


Joined: 26 Apr 2006
Posts: 38

PostPosted: Thu Feb 12, 2026 10:48 am   
 
Thank you so much! That has been the bridge I needed, thank you!
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