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


Joined: 12 Mar 2012
Posts: 23

PostPosted: Sun Mar 18, 2012 11:59 am   

Automapper - guards
 
Hi!
To clear up what I mean about guards:
I have a map, and one of them is containing guards. I've added a script to that room, so every time I step into that room, the script executes.
The script is the following:
#pause

I assume that every time, I enter the room, any currently ongoing speedwalking stops, but that isn't the case. It keeps sending all the remaining directions.
Also tried #stop (however that would be incorrect, because I want to confirm entering to guard's room), but that doesn't work either.
Example, in case my description isn't clear.
R = Room
G = Guardroom
S = Start room
O = Goal room

S-R-R-R-G-R-R-O


I send walk to O command, but it doesn't stop at G.



Using: Cmud 3.34
Map mode: follow
Walk mode: Fast
Reply with quote
hadar
Apprentice


Joined: 30 Aug 2009
Posts: 198
Location: my apt, in california

PostPosted: Sun Mar 18, 2012 5:31 pm   
 
while in Fast walk mode all commands that are sent to the mapper are ignored so it ignored #stop, #pause what have you, try in slow or safe mode
_________________
if you build it they will come, assuming that they have not already come to build it
Aardwolf Bootcamp
My youtube channel
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Sun Mar 18, 2012 8:01 pm   
 
hadar wrote:
while in Fast walk mode all commands that are sent to the mapper are ignored so it ignored #stop, #pause what have you, try in slow or safe mode

It doesn't seem to work in SAFE mode either, and for me slow walk is not an option. It is just way too... slow.

Is there any way to achieve what I want to do? I tried to add #OK to all direction, and use SLOW walk, but no luck (it stepped only once). Maybe if I could disable the name and description match.
Reply with quote
shalimar
GURU


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

PostPosted: Sun Mar 18, 2012 9:01 pm   
 
you could just the mapper delay manually under configuration settings, under speedwalking.
_________________
Discord: Shalimarwildcat
Reply with quote
Palek
Wanderer


Joined: 28 Sep 2005
Posts: 55

PostPosted: Tue Mar 20, 2012 6:31 am   
 
Is there a line of text given in the guard room everytime? If so a #NODIR trigger should work in safe mode. Something similar to:

#TRIGGER {guardroomtext} {#NODIR}
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Wed Mar 21, 2012 11:51 pm   
 
Palek wrote:
Is there a line of text given in the guard room everytime? If so a #NODIR trigger should work in safe mode. Something similar to:

#TRIGGER {guardroomtext} {#NODIR}

I am going to try out safe mode walk without room verifying (hopefully it won't be slow). I am hoping that mode will reach to at least one of #stop #pause #stop #nodir.
Reply with quote
Palek
Wanderer


Joined: 28 Sep 2005
Posts: 55

PostPosted: Thu Mar 22, 2012 9:02 pm   
 
You should not need #STOP or #PAUSE, #NODIR tells the mapper that you did not move to the next room.
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Thu Mar 22, 2012 9:22 pm   
 
For starters, I believe #STOP and #PAUSE are only for Slow walking. If you want to stop completely you need to clear the entire speedwalking command queue as such:

Code:
#TRIGGER {something_from_guard_room_here} {#NODIR 1}


The 1 flag, as described by the help, will clear all of the remaining moves so you truly STOP.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Thu Mar 22, 2012 9:40 pm   
 
Tarken Aurelius wrote:
For starters, I believe #STOP and #PAUSE are only for Slow walking. If you want to stop completely you need to clear the entire speedwalking command queue as such:

Code:
#TRIGGER {something_from_guard_room_here} {#NODIR 1}


The 1 flag, as described by the help, will clear all of the remaining moves so you truly STOP.

Thank you, Cpt. Kitten.

Update: Alright, it may work, but a room config (descr lengh, line position of exits) varies too much on my mud to use safe/slow mode, and it doesn't seem to work with fast.
Reply with quote
Tarken Aurelius
Apprentice


Joined: 23 Oct 2008
Posts: 120
Location: Cincinnati, Ohio

PostPosted: Sat Mar 24, 2012 2:27 pm   
 
Well, can we (I) see some examples of these rooms? There hasn't been much that I've found that you can't do with a little elbow grease.
_________________
Tarken Aurelius, quality triggers since 2004! Trigger consulting since 2008! Content Developer at BatMUD (www.bat.org)
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Sat Mar 24, 2012 6:54 pm   
 
Tarken Aurelius wrote:
Well, can we (I) see some examples of these rooms? There hasn't been much that I've found that you can't do with a little elbow grease.

I think the only possible solution would be to make a lot of configs, for each type of room/zome, and load them with room script up-on entering. But that is a tiny bit too much work, for what profit it would net.
I think I am going to try an another approach.
(Like save the path queue into a list, go trough each item, check if the room has guards, if it does, delete the rest of the queue, then actually send the commands.
I am no exactly sure how to do it, if it is even possible, but once I finished rewriting all my current scripts (have some other thread/variable vanishing issue), I will look into this.)
(somewhat off-topic: When I resume a thread, why do I have to resume it twice? It goes: suspended->stopped->running)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Mar 26, 2012 1:07 am   
 
If you gave us examples of the rooms, we may be able to help more.
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Mon Mar 26, 2012 11:15 am   
 
Rahab wrote:
If you gave us examples of the rooms, we may be able to help more.

They rooms may be one of these types:

Name
Asciii art line 0-15 lines
smells
sounds
exits
mobs
prompt

Name
ascii art line 0-15 lines
description
smells
sounds
exits
mobs
prompt

name
ascii art+description
smells
sounds
exits
mobs
prompt

name
description
smells
sounds
exits
mobs
prompt

Blind
smell
sound
prompt

Descriptions can contain multiple (1-3 paragraphs)
Mobs may or may not exist

There may be more versions, but I think this should show the general types. A zone can contain multiple type of room.
So yeah, mapper has a hard time to match it in safe or slow mode. (Also, mapping is hard due to the same reason. If I map something without reconfiguring it every time the room type changes, datas may not get saved, and in the future it cannot confirm the movement)

I think the best solution would be what I described in my previous post.
Load the path in a list, and check each vnum. If the vnum is among the predefined guard rooms, the rest of the path is deleted, and the character walks only to the guard room. Once I/trigger confirmed there isn't a guard, I could resend the command, and move to the target room/next guard room.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Mar 26, 2012 12:25 pm   
 
Give us actual examples from the mud text, enclosed within [quote]...[/quote] markers.
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Mon Mar 26, 2012 4:21 pm   
 
Quote:
Raknoor Varos Fotere
Regen Piac ter volt a neve, am eleg hamar kivivta maganak a vezeto poziciot a fovaros tobbi terehez kepest. Tudni illik, amint Raknoor magusai ide rajzoltak a hexagrammat szinte atjarohazza valtozott. Aztan szep sorban jottek az ujabbnal ujabb talalmanyok, mint a csillagora, mely egy nagy sziklaba van belehelyezve, kozvetlenul a varos terkepe felett. Egy erdekes mintazatu satorban lehet elolvasni a hireket. Egy gyonyoru marvany szobor tovabb szepiti a mar eleve magaval ragado latvanyt, melyet a ter nyujt. A ter minden szegleteben talalsz egy ustot. A ter kozepen egy mesterien kidolgozott szokokut all, melynek vize a kozhiedelemmel ellentetben nem ajandekoz orok eletet az embernek. Az itt idozo gyogyito pap varja a kivansagaidat.
Kellemes virag illatot sodor magaval a szel.
Egy hatalmas varos nyuzsgo eletenek zajait hallod.

Sok kijaratot latsz: kelet, husvet, delkelet, delnyugat, sator, del, eszakkelet, raktar, eszaknyugat, eszak, buli, karacsony, tema, nyugat es pkszoba.


Code:
Tuzkarom lakosztalya
::::::::::::___/    . .:.:.:.:. .:\     /:. .:.:.:.:. ,    \___::::::::::::
:::::::::::/ ...-._  `..:.:. . .:.:`- -':.:. . .:.:.,'  _.-.   \:::::::::::
::::::::::/ ...:.:.`-._`-._..-''_...---..._``-.._.-'_.-'.:.:.   \::::::::::
::::::___/ .:.:. . .:_.`' _..-''|  |  |  | ``-.._ `.._:. . .:.:. \___::::::
:::::/ ..:.:. . . ,-'_.-''|  |__|  |  |__|  |  | ``-._`-. . . .:.:.  \:::::
::::/  .:. . . .,'_.'  |  |  |  |__|  |  |  |  |  |  |`._`.. . . .:.  \::::
:::/ :.:. . . ,','  |  |__|  |  |__'__'__'  |  |__|  |  |`.`. . . .:.: \:::
::/ `.:.:. .,',' |  |  |  | _.-''_________``-._|  |  |  |  `._.     _.' \::
:/-._  `._./ /|__|  |  |  ,'_.-''  .|     ``-._`. |  |__|  ,' '`:..'  _.-\:
/.:.:`-.._' / |  |  |   ,','     .  |   .      `.`.  |  | /'  '   \.-':..\
 :.:. . ./ /  |  |  | ,','   ..     | .   .      `.`.|  |/ '  '  ' \. .::
:.:. . ./ /|  |  |__|/ /            |          .   \ \  :  '  '  '  \. ..:
.:. . ./ / |  |  |  / /  .     .    | .    .        \ \ :  '  '  '   \. :.
:. . .: :  |  |  | / /            . |                \ ;'  '  '  '  ' \..:
.:. . | |  |__|  |: :_______    .   |   .  .    .     : '  '  '  '  '  ||:.
:. . .| |  |  |  || |       `----_  |         .       |\'__',-._.'  '  ||.:
.:.:. | |  |  |__|| |---....____  ``|````-       .    | ,---\/--/   '  ||:.
------| |  |  |  |: :  ..       ```--..._ `--__       |''  '  '  '  '  ||--
_...--. |__|  |  | \ \    ..   .   .     `-._  `_    /: '  '  '  '  '  ||._
:.:. .| |  |  |  |  \ \    .  . .    . .     `._ `_ / /:'  '  '  '  ' //..:
.:. . | |  |  |  |__|\ \  .  .        .  .  . . `. / / :'  '  '  '  '//. :.
:. . .| |  |__|  |  | `.`.      .  .    .        ,','|__\  '  '  '  //. ..:
.:. . | |  |  |  |  |  |`.`-._               _,-','  |  |\ '  '  ' //| . :.
:. . .; `__'__'__'__'__'__`-._`-.._______..-'_.-'_'__'__'_\'  '   //_:. ..:
.:.:,'  ----------------------------------------------------`._',;'`. `.::.
:.,' ,' /   /   /   /   /   ,-------------------.   \   \   \   \   \ `.`.:
,' ,'  /   /   /   /   /   //                   \   \   \   \   \   \ `..:

Egyetlen kijaratot latsz: del.

Code:
Darkmoon kapuja
Elerkeztel Darkmoon kapuja ala. Ha
kimereszkedsz a varoson kivulre, vigyazz magadra, mert
a kapun kivul mar mas vilag var, veszelyes es
kiszamithatatlan. Aki megis atlepi a varos hatarat, es
visszater, azt nagy megbecsules ovezi. Talan ezert megeri elhagyni a
varost, de mindenkinek valasztania kell, vagy kockara
teszi az eletet, es a hirnevet valasztja, vagy inkabb a dicstelen, de biztos
eletet. Most rajtad van a sor, donts! Toled balra
egy tabla all.
 
Ketto kijaratot latsz: del es ki.


Code:
Az Eszaki Torony Bejarata
Raknoor hires piheno helyisegenek egyik bejarata. Ez az egyik torony, mely a
piheno szobaba vezet. Ha kedved ugy tartja, nyugodtan menj be, ingyen
pihenhetsz. Sot, az igazat megvallva ez az egyetlen hely, ahol alhatsz, mert
a varos torvenyei ezt diktaljak. Csont feher falaitol elut a korom fekete
ajto, mely a bejaratkent szolgal.
 
Ot kijaratot latsz: kelet, del, eszak, be es nyugat.


Code:
A Varosfal Deli Resze
Raknoort vedelmezo varfal deli reszen vagy. A varosorok szinte
kifogyhatatlan energiaval jaratjak a gyilokjarot, s pasztazzak a horizontot.
A korahoz kepest, majdnem bevehetetlenne teszi Raknoort ez a varosfal.
Mindenhol zaszlok jelzik, hogy ez itt melyik varos. Egy letra vezet le az
utcara.
 
Ketto kijaratot latsz: kelet es nyugat.


Name: First row
X kijaratot latsz = directions line

after that there may be some mob (multiline), items (single line) and after that there is the prompt.

Slow and even safe walk has issues to detect if the movement was succesfull. Changing the profile settings for each room is also out of question, that is why I think my solution would be the best, if it is possible.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Mar 26, 2012 5:22 pm   
 
It looks to me like it should be possible to create a configuration, possibly with #TAG commands, which will correctly map this mud and detect movement correctly. All of these formats start with Room Name, followed by other stuff, followed by an easily identifiable exits line. That is plenty for Cmud to work with.

Are the sounds and smells in a particular room constant, or do they change? Do the room descriptions change? If all of these are constant in a particular room, then you can treat the entire text between Room Name and Exits as the Description. If they are not constant, then don't try to record the description at all.

I would try using the first room above (Raknoor Varos Fotere) as your autoconfigure room (in other words, step into that room when autoconfiguring). That should get most of the parameters right. You will want multi-line exits, multi-line description, exit line identified by "kijaratot latsz:". I _think_ room name should be line 0, description line 1, and exits line 2 (I think this really means a _minimum_ of line 2 if multi-line description is set).

If you can't get this to work, then it is definitely possible to do it with #TAG. It may be a bit more complicated, but not too hard. I would need to know three things: Are the description, smells, and sounds in a room constant? Do you actually need to have the room description in the map for some other purpose of your own? Does the list of exits always end in a period?
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Mon Mar 26, 2012 11:57 pm   
 
Hm... I thought I sent a reply, but looks like it got lost in the void.
I am going to keep it short this time then.

Slow walk: Not an option, my mud gags everything except prompt after 5 rooms moved within a given time.
safe walk: for some reason, I had issues with it confirming movement on prompt. (see reason above)
fast walk: I fancy this one. It is fast, only problem I have with it is it doesn't stop at guards, but if the idea I already described in my previous posts works, then that would be the best.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Mar 27, 2012 1:37 pm   
 
You should be able to get Slow walk or Safe walk to work. You can set a delay between movement steps to avoid the gag response from the mud.

Your idea for Fast walk is theoretically possible, but complex and awkward. In addition, it will only work with pre-defined paths. It will _not_ work if you click on a room on the map to move to it. It might also have problems if you have special commands stuck in the path list. I think the script will be almost as much work work as getting Safe or Slow walk to work which is why I've been focusing on helping with those, but if you really want to try it, go ahead. The steps would be something like:

Make a list of guard rooms, perhaps named @stoprooms.
Get your path.
Get your curent room number.
If necessary, convert the path to a stringlist with @pathexpand. [edit]this should be %pathexpand[/edit]
Loop through the stringlist with %FORALL; each step will be in %i.
Append %i to a new pathlist with %additem
Use %roomlink to figure out what room that step %i takes you to.
Compare the new room number to @stoprooms.
Continue loop or break out of it.
Convert the new pathlist with %pathcompress.
Execute the new path.


Last edited by Rahab on Tue Mar 27, 2012 6:29 pm; edited 1 time in total
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Tue Mar 27, 2012 1:48 pm   
 
Rahab wrote:
You should be able to get Slow walk or Safe walk to work. You can set a delay between movement steps to avoid the gag response from the mud.

Yes, I know, with delays, I could do that, but then the time it would take to reach my destination would be too much, it would destroy the point of what I am working towards.

I will finish soon an another big script project I am working on, so I have time to dig deeper into this matter.
Spent last 3 days rewriting all my mud script with higher standards, help system, etc.
Reply with quote
shalimar
GURU


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

PostPosted: Tue Mar 27, 2012 8:12 pm   
 
try making two smaller paths that start/stop at the guards instead of trying to pause one huge one?
_________________
Discord: Shalimarwildcat
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Tue Mar 27, 2012 10:59 pm   
 
shalimar wrote:
try making two smaller paths that start/stop at the guards instead of trying to pause one huge one?

I prefer the one huge one, as these paths aren't pre-defined, they are made by speedwalk algorithm. This way I don't have to remember the room for the guard which is in the way to the mob I want to go.
I finally finished with the scripts I "had" to do, I am going to dig into this now, if I find something, I can post here, if interested.
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Wed Mar 28, 2012 1:05 am   
 
Well, it took shorter time, than I thought it would. What it does:
Gets the path from A to B
converts 1 char directions into 2 char mud directions
goes trough this list, and creates an another list that contains the linked rooms in order.
Once it finds a room number that is among a pre-defined guard room list, it checks, if that guard is protecting the next room. If it is, then the loop breaks, and does not copy the remaining of the path.
the $roomnext variable in this case still contains the guard's room number, so I walk to that room. If I send the alias once more, it walks from guard room to final destination, or to the next guard room.

EXACLTY what I wanted. Fast, efficient.

Thanks for trying to help with the matter everyone. I finally got time to make this alias, and the previous few days I've spent reading the help file of Cmud made creating this one very easy.
Oh, here is the code. (I hope I translated everything neccesary to understand the script)

Code:

$goalroom=...other source...
    $path=%pathexpand(%pathfrom(%roomvnum,$goalroom))
//This part replaces 1 char directions
    $utvonal2 = ""
    #forall $utvonal {#switch (%i="ü") {#additem $utvonal2 "e"} (%i="ó") {#additem $utvonal2 "ek"} (%i="ú") {#additem $utvonal2 "k"} (%i="u") {#additem $utvonal2 "dk"} (%i="á") {#additem $utvonal2 "d"} (%i="é") {#additem $utvonal2 "dn"} (%i="p") {#additem $utvonal2 "ny"} (%i="ö") {#additem $utvonal2 "en"} (%i="z") {#additem $utvonal2 "fel"} (%i="h") {#additem $utvonal2 "le"} (%i="l") {#additem $utvonal2 "ki"} (%i="b") {#additem $utvonal2 "be"} {#additem $utvonal2 %i}}
    $utvonal=$utvonal2
//that part ends
    $roompath =""
    $roomprev =%roomvnum()
    $roomnext = ""
    $counter = 0
    #forall ($utvonal)
    {
      $counter = ($counter+1)
      $roomnext = %roomlink($roomprev,%i)
      //#send %i  //Tried to send the direction the moment it is confirmed, however it seemed to be slower overall than #walk final confirmed room.
      #additem $roompath $roomnext
      #if (!%iskey(@guardrooms,$roomnext)) {
        $roomprev = $roomnext
      } {
        #if (%ismember(%roomlink($roomnext,%item($pathl,$counter+1)),@guardrooms.$roomnext)) {
          #break
        }
      }
    }
  #if ($roomnext!=0 && $roomnext!="") {
    #walk $roomnext
  }


Update: So far noticed only one issue: When I have a special direction mapped to a normal direction, %roomlink(,"special direction") doesn't return the linked room. If that special direction is mapped to west, then it is returned only if I do %roomlink(,"west").
The problem is I cannot figure out how to access the mapper database properly to retreive the needed information. It is from the Exits table I think, and the room id, and direction crearly identifies the row, however I cannot acces the Name attribute of that room. For that matter, I cannot even figure out how to query from the exits database.


Last edited by skrot on Wed Mar 28, 2012 2:34 am; edited 1 time in total
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Mar 28, 2012 2:07 am   
 
You might want to check out the #LMAP command Wink.
Reply with quote
skrot
Beginner


Joined: 12 Mar 2012
Posts: 23

PostPosted: Wed Mar 28, 2012 2:36 am   
 
Daern wrote:
You might want to check out the #LMAP command Wink.

Heh, will do, but it is 4:35 AM here, and I am tired for now, so I am off to sleep. Goodnight.
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