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
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Thu Jul 16, 2020 5:52 am   

Mapper room note
 
I can manually enter text into the room note. What I am trying to achieve is an automatic populating of the note via triggers.

I have this:

Code:
#LOCAL $tempnote ""

#IF (%match(%roomnote(),"PORTAL")) {#NOOP} {
  $tempnote=%roomnote;%roomnote(,%concat($tempnote," PORTAL"));#NOOP
  }
#IF %maplocked(1) {#DOOR %lastdir; open %lastdir;#NODIR} {#STOP;recall}


What I expect to happen is:

If a room I enter has "PORTAL" in it, I cannot portal out. If it does not have "PORTAL" and I still cannot portal out (because of too many room of this kind and never got around to writing in all), then add " PORTAL" to the room note and still do nothing.

I have a similar trigger for a room that is NO RECALL and to add that to the note.

The problem is that adding the text does not work and, in fact, causes the compile to fail
Reply with quote
shalimar
GURU


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

PostPosted: Fri Jul 17, 2020 2:12 pm   
 
You have to toggle %maplocked to edit the map via script.

Code:
#IF (!%match(%roomnote,"PORTAL")) {
  $tempnote=%trim(%concat(%roomnote, " PORTAL"))
  #CALL %maplocked(0)
  #CALL %roomnote(, $tempnote)
  #CALL %maplocked(1)
  }
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sat Jul 18, 2020 7:54 am   
 
Ay-ay-ay! I never thought of that. If the map is locked I can still edit room notes, description without unlocking. Thus, I never thought of calling the unlock first. It IS kind of confusing.

I use an alias to walk to a regular room (mapper named room). It is, in effect, a 'recall' (in this case a portal) plus a walk through a few rooms.

Is there a way to prevent the rest of the walk from executing if any one part of it is a failure?

Ie., the alias 'wv' runs as:

#WALK home

So the mapper logic opts for shortest path. Which is usually:

enter (enter portal)
d
e
d

In NO RECALL or NO PORTAL rooms the first part will fail but I can usually perform the 'ded' part. Obviously I don't wan't to walk into a room full of danger.

I tried STOP but that doesn't work for 'speedwalk' only slow walks. The documentation/commands have no obvious ability to stop a speedwalk/safe walk.
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jul 18, 2020 2:54 pm   
 
I would use the room/zone scripts to toggle %portalenabled for the given portal as needed
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sat Jul 18, 2020 3:00 pm   
 
Does anyone have any control over how the mapper determines shortest path from one room to another - especially in a different zone - and what to do if a portion of it fails?

The only scriptable controls are for SLOW walking.

Going over the documentation again and again sheds no new light.

Once again, this would be a feature that could be implemented by active development on a full-price product.

As for your suggestion....how many rooms would I have to script for? For both portal and recall? That is an insane amount of work.

Also, the same can be said for FAST and SAFE walking. There is no mechanism to cease all walking activity if something occurs in the middle (Eg., door locked, MOB attack, out of moves, etc).

I would have to disable ALL portals as the mapper walking logic will use shortest path. So if one portal has already been disabled then it would choose another...then another. Then I would have to re-enable all portals once a successful walk has been completed. No, not a thing I care to undertake.
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jul 18, 2020 3:10 pm   
 
If it is every room in that zone, use the zone scripts, not the room ones.
But you will only have to do it once, then CMUD will know to walk out of this zone, then use a portal.

With FAST walking, all the commands are sent at once, there is no way to unsend a command that has already been sent to the server. That is why the safe and slow modes exist, to limit how many commands are sent at once.
You can #PAUSE slower walks and then #STEP to resume, or just #STOP them altogether.

And yes, you can control which routes are picked by editing the movement cost for rooms.
It's on the other properties tab in the room properties window.
Paths are determined by the lowest total movement cost.
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Sat Jul 18, 2020 4:21 pm   
 
I never use SPEED walk only SAFE and even that cannot be stopped once you click a room to walk to or #WALK to a room.

...and, once again, attempting to edit the room costs to figure out which rooms may be better to pass through than others?... not even an option for 35000+ rooms!

Some zones cannot be 'walked out' of, with the only option being to locate a room that may be recalled/portalled out of. I trust you can appreciate the scope of the problem.

Obviously, the only option would be to either ignore the problem (which I have been) or use SLOW walking and speed up the interval between steps via the options, which will allow for PAUSE and STOP.
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jul 18, 2020 5:28 pm   
 
You can multiple edit rooms... multi-select them by drawing a box around them when in map mode, or shift-click each room when in follow mode.
Just don't try to create any new rooms after doing so until after restarting CMUD.

I fully realize how much of a pain it is to retrofit anything for, well, anything.
_________________
Discord: Shalimarwildcat
Reply with quote
shalimar
GURU


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

PostPosted: Sat Jul 18, 2020 5:59 pm   
 
Here is a small script i use to set all the rooms in a given zone to the same movement cost (goes off of which zone you are in currently):

Code:
#ALIAS zoneSet {
  #WAIT 0 //Just to offshoot the %mapquery into a separate thread, otherwise CMUD may hang til the script finishes.
  #CALL %maplocked(0)
  #FORALL %mapquery(%concat("ZoneID=",  %zonenum)) {#CALL %roomcost(%i, %1)}
  #CALL %maplocked(1)
  }
_________________
Discord: Shalimarwildcat
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Fri Feb 26, 2021 9:10 am   
 
By the way, I managed to get around this problem quite easily. Mapper create a room and gives it a default cost of 0. I just made the portal costs 1 and voila! Now, with certain exceptions (mud-based) all works as one would expect.
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Wed Apr 21, 2021 12:49 pm   
 
Some knowledge one doesn't know because one never had a reason to look at non-relevancies.

I finally did some digging re. room things in the properties editor. I paid no mind to Userstr and Userint in the past. However, I can see a very good use for that when I see that Userstr and %roomflags are one and the same. I have been putting my room flags into the roomnote, now I see it would be more useful to have them as roomflags.

Using your codelet above, would I have to run a loop on all zones to move data from roomnote to roomflags, or do you know of a more global query?

... to take the roomnote flags and put them into roomflags.
%mapquery(do stuff) {(#CALL %roomflags(room,%roomnote(room));#CALL %roomnote(room,"") }

...and what purpose does userint (%roomint() ) serve?
Reply with quote
hpoonis2010
Adept


Joined: 18 Jun 2019
Posts: 279

PostPosted: Thu Apr 22, 2021 10:46 am   
 
I ran a loop.
Code:
#WAIT 0
#CALL %maplocked(0)

$zoneList=%dbkeys(@aardZoneTbl)
#FORALL $zoneList {
  $zoneName=@aardZoneTbl.%i.zone
  #IF (%zonenum($zoneName)="-1") {} {
    #FORALL %mapquery(%concat("zoneID=",%zonenum($zoneName))) {
      #IF (%roomnote(%j)!="") {#CALL %roomnote(%j,%roomnote(%j))}
      }
    }
  }
#CALL %maplocked(1)


I ran it again, after I checked that it worked, to remove the old note. Neat.
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