|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Thu Jan 29, 2009 3:50 am
%pathfrom problem. |
Here is the routine that I use to convert the output from %pathfrom to something the MUD can understand:
Code: |
<func name="buildpath" id="55">
<value>#IF (%numparam( ) = 2)
{
rawsw = %pathfrom( %1, %2)
toroom = %2
$sw = %replace( @rawsw, ".(", "")
$sw = %replace( $sw, ".", "run ")
$sw = %replace( $sw, ")", ";run ")
;;
#IF (%rightback( $sw, 4) = "run ") {$sw = %leftback( $sw, 4)}
#IF (%rightback( $sw, 1) = ";") {$sw = %leftback( $sw, 1)}
;;
#RETURN %replace( $sw, "run ;", "")
}</value>
</func>
|
I've been using this routine since 2.14, so this is the way the function (%pathfrom) has been returing its output.
This funtion (@buildpath) has stopped working (i.e not converting) because the output from %pathfrom has changed from this format:
[.(portalname)].dirstr1;.dirstr2;.------;.dirstrN
to this format:
.(dir1);.(dir2);.-----;.(dirN)
In other words, it now returns a string consisting of items that could be interpreted as either portals or open commands since those were the only items within parentheses before.
This could be the result of my changing a setting without knowing it or what it would do. So I would appreciate is someone pointed me in the right direction so that I can get the function to return the values as it once did. |
|
_________________ Sic itur ad astra. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Jan 29, 2009 6:08 pm |
Unfortunately, this is just how the output changed. It's still a valid path. In general, paths used internally to CMUD can be complicated and be in various different formats, so it's not good to rely upon the exact results.
However, the result you are seeing, and even the result in 2.x both contain things that I'm planning to fix in the Phase 2 of the mapper. For example, instead of:
.(portalname);.n;.s;.e
it should really be:
.(portalname)nse
and instead of the new v3.x syntax of:
.(n);.(s);.(e)
it should be just .nse
In other words, the paths are not getting "compressed" into the proper smallest syntax and that is on my bug list. As part of this work, I will also be adding some functions for "expanding" and "compressing" path data, and for looping across a path string (not like #LOOPMAP, but something like #LOOPDIR that will just return a single direction string). For example, I want to make it much easier to take a CMUD path and add "run" to it for the MUD. Especially since the MUD that I play uses the "run" command a lot.
But I can't promise that your script will continue to work since it really depends upon low-level details in the CMUD implementation that are not documented and are subject to change. |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Sat Jan 31, 2009 11:39 pm |
Well, I don't know what is going on, but it is now back to returning the data in the form of .ddddddddd ("d" being some direction or multiple) rather than in the .(dir1);.(dir2);---;.(dirN) format.
|
|
_________________ Sic itur ad astra. |
|
|
|
|
|
|
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
|
|