Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Sparkle
Beginner


Joined: 09 Aug 2003
Posts: 12
Location: United Kingdom

PostPosted: Mon Sep 01, 2003 12:45 am   

Vijilante's Achaea script
 
Yep, still trying to get some map settings for Achaea that actually work, i've read every post there is on it but there is no actuall solutions that work.
I've tried this script:

#CLASS {FixDescription}
#VAR Weather {} {}
#VAR Name {} {}
#VAR Description {} {}
#VAR OutLine {} {}
#VAR Exits {} {}
#TRIGGER {^%e[1;34m(*).*$} {Name=%concat("%1",".");Description="";Exits=""} "" {color}
#COND {^%e[1;37m(*). %e[0;37m(*)$} {Weather=%concat("%1",".");Description=%stripansi("%2");#T+ DescChanger;#T+ DescChanger2} {within|param=1|color}
#TRIGGER "DescChanger2" {%e[1;31m(*)$} {Exits=%stripansi("%1")} "" {color|disable}
#TRIGGER "DescChanger" {*} {#SUB {%ansi(white)@Weather}} "" {disable}
#COND {^(*)$} {#IF (%trigger(DescChanger2)) {Description=%trim(%concat(@Description," ",%line));#IF (%pos(@Exits,@Description)) {Description=%trim(%remove(@Exits,@Description));#T- DescChanger2}} { Exits=%trim(%concat(@Exits," ",%line))};#IF (@Description) {OutLine=%trim(%left(@Description,80));#IF ((%len(@OutLine)=80)&(%rightback(@Outline,1)!=" ")) { OutLine=%leftback(@OutLine,%eval(%len(%word(@OutLine, %numwords(@OutLine)))+1))};Description=%trim(%remove(@OutLine,@Description));OutLine=%concat(%char(27),"[0;37m",@OutLine)};#IF (%ends(@Exits,".")) {OutLine=%concat(@OutLine,%cr,%char(27),"[1;31m",@Exits);Exits=""};#SUB {@OutLine};#IF ((@Description="")&(@Exits="")) {#STATE DescChanger 0;#T- DescChanger}} {looplines|param=99|disable}
#CLASS 0

And it didnt seem to make any difference what-so-ever, should it put everything on new lines or something?

Does the fact that i have CONFIG COLOR'ed all my colors to my prefferences make a difference?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue Sep 02, 2003 1:35 pm   
 
Changing the colors will most definitely affect how this script works (or doesn't work). It relies entirely on ANSI color codes to parse the room information. What's more is the colors in this script aren't even the default colors (which is what I use, and this script didn't work for me at all until I changed a few color codes). This script had a few other problems for me and so I've gone back to my own personal mapping script again. I've got the room name and exits just fine, except for a few strange room names, but I haven't had much success with the descriptions yet.

I had submitted a rather lengthy post with my current script and asked for assistance, but still have received no replies. Feel free to look at my script and modify it to do anything you like. I'm still hoping to get someone to help with the room descriptions. Anyone?

http://www.zuggsoft.com/forum/topic.asp?TOPIC_ID=12842
Reply with quote
billaben
Wanderer


Joined: 02 Sep 2005
Posts: 60

PostPosted: Sat Sep 03, 2005 1:53 am   
 
Still arguing with trying to clean up ansi out of your paragraph?

I don't have any firm solutions (yet) but I have noticed that %stripansi will trigger on commas. That's right. commas. It finds a comma in your string and it calls it ansi, kills the comma and everything past the comma..

Naturally, this is a pain in the butt. =( I'm looking at alternate functions that might work, but it's starting to look like I'm going to have to basically scratch build a function to parse text correctly. Yuck.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Sep 04, 2005 4:22 pm   
 
I can see how that old one really doesn't work. I went ahead and created a character over on Achaea and took a good look at it. The script I came up just attempts to pretty up the room texts and make it readable for both humans and zMud. I think the way they have everything mashed together is absolutely horibble to read. In fact before using the script I can't even be sure I am in the right room for certain fixed location mobs. Just too much clutter.

Code:
#CLASS {PrettierRoom}
#VAR SpecialMoves {portals|ql}
#VAR PCap {} {}
#VAR PrettyCaptured {} {}
#VAR FailedMoves {There is no exit in that direction.|You must regain balance first.|There's water ahead of you.}
#VAR PrettyFinal {0} {0}
#ONINPUT {^{%t|@SpecialMoves}$} {PrettyCaptured="";#T+ PrettyCapture} "" {notrig}
#REGEX "PrettyCapture" {^(?PCap:.*)} {#IF (@PrettyFinal) {#GAG;PrettyCaptured=%concat(@PrettyCaptured,@PCap);PrettyCaptured=%replace(@PrettyCaptured,".",%concat(".",%crlf));PrettyCaptured=%replace(@PrettyCaptured,%concat(%crlf," "),%crlf);#T- PrettyCapture;#SHOWPROMPT {@PrettyCaptured};PrettyFinal=0} {#IF ((%match(%line,"You see {a single exit|exits} leading"))|(%ismember(%line,@FailedMoves))) {PrettyFinal=1;#GAG;PrettyCaptured=%concat(@PrettyCaptured,@PCap)} {#GAG;#IF (@PrettyCaptured="") {PrettyCaptured=%concat(@PCap,%crlf)} {PrettyCaptured=%concat(@PrettyCaptured,@PCap)}}}} "" {looppat|param=99|prompt|color|disable}
#CLASS 0


Any how all this script does is gag everything once you send a direction or something you have configured into SpecialMoves until 1 line after the exit line. Then breaks it up by the periods, and spits it back out. Much more readable for me, zMud triggers, and the automapper (although I am not going to test that, you can always grab my complete mapper override script from the Finished forum and mod it yourself). I have tested it with both brief and verbose and it smooths the output nicely. I set my screen width to max, but the script pretty much takes care of it anyway. There are some errant spaces at the start of lines that I just can't think of a way to eliminate, but doing triggers with patterns of ^{ |}text really isn't that bothersome. It doesn't format the first room seen on connecting. Modifying your Autolog triggers is up to you. I hope this helps everyone that plays at Achaea.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Seyen
Beginner


Joined: 31 Aug 2005
Posts: 15

PostPosted: Tue Sep 06, 2005 4:41 pm   
 
Ok then.. I started trying to get the mapper to work properly on differentiating descriptions from room contents. For now, I'm trying, to base this on ANSI, as I don't see other solutions for this problem. (except if you'd dictate a huge number of possible object and their descriptions, etc.)

So.

Code:
#TRIGGER "RoomDesc_Capture" {%e[33m} {RoomDesc=%concat( %line, " ");#TEMP {%e[33m(*)". "%e[1;36m(*)} {#STATE RoomDesc_Capture 0} "" {color}} "Mapping" {color|disable}
#COND {(*) {^%e[1;36m(*)}} {RoomDesc=%concat( @RoomDesc, %1, " ")} {looplines|param=20|disable}


Now, how this is supposed to work. The trigger should kick in when the colour of the description(no other things beside the roomdesc have this color) appears. It does trigger, no problem. It then automatically stores the first line(yes, there is the case when the first line contains more than the description, but let's not go into that yet. Easily remedied anyway)
Then it setups a TEMP to end the trigger prematurely when it comes across the color of descripion followed by text with a different color, used for objects. At this point I need to capture %1 and %2, which doesn't happen, perhaps because of my lack of knowledge of syntaxis(wrong pattern), so that I can %concat the @RoomDesc with the rest of the description, cutting off the %2, which I don't need.
Then there's state 1. It needs to capture anything but a line containing the color used for object descriptions, not room descriptions, and append all of the stuff to @RoomDesc. This it doesn't do, since it seems to capture the last line INCLUDING the part of the line which is object description.

Now.

Northern fringes of Ithmia forest.
You stand now on the very edge of the mighty Ithmia forest, dark tangled and impenetrable, and the
largest of all the ancient forests of Achaea. Looking into the distance you are able to perceive its
dark shape ahead lofty trees standing in their countless thousands like a massed army. You can see
but a little way into this impenetrable tangle of trees and thickets of bushes, while behind you a
wide gently undulating plain stretches away as far as the eye can see. Gentle breezes carry a musty
smell to your nose from the forest, a slightly unpleasant decaying smell, and from within its dense
tangle you hear the occasional screech of a bird.
A large beehive hangs down from the trees above. A
mighty earth golem stands guard here. A hanging birdhouse sways gently in the breeze.

You see exits leading east, south, and southwest.

Now, what happens is that I get the @RoomDesc to contain all the olive-cloured text along with the line with both the olive coloured text AND the cyan coloured text.

Help?
Reply with quote
Seyen
Beginner


Joined: 31 Aug 2005
Posts: 15

PostPosted: Wed Sep 07, 2005 4:20 pm   
 
Bump.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Sep 07, 2005 9:21 pm   
 
Bump, bump, I am not supporting the old script. I will support the newer script I wrote. As I say it doesn't specifically do mapper things, but it make everything readable for both humans and zMud. Which means the mapper should be much happier. In either case, from what I have seen the changes Achaea made themselves to split the exit line off was really all that was required to make the mapper happy. This means you should have no problem mapping, with information in the help on Configuring the Mapper.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Seyen
Beginner


Joined: 31 Aug 2005
Posts: 15

PostPosted: Thu Sep 08, 2005 2:29 pm   
 
No-no, I don't want to just map it, it maps fine curretnly, albeit, it uses more info for the decription than I want it to. Which is what I'm trying to fix here. Just poke me in the direction of a sollution to the pattern matching problem. I'll try another idea in a minute, but still, help would be appreciated. And I'll go dig up the mapper-override script.

PS
The script you provided doesn't work as is. What id does is gag _everything_. Permanently.. Prolly something to do with me changing Achaea(in the MUD) settings.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Sep 08, 2005 11:19 pm   
 
I actually went and created a character on Ahaea, just because so many people had problems there. The script I came up with works solidly. It does gag everything, and then redisplays it. I have noted some problems with the %t wild card that was used in my script originally, and changed that to instead specify a list of the direction words that should actually be used. Beyond that I use it with no changes and actually play a little there.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Daagar
Magician


Joined: 25 Oct 2000
Posts: 461
Location: USA

PostPosted: Sun Sep 11, 2005 7:01 pm   
 
Thanks to Vigilante's and Larkin's inpspiration, I went ahead and got the mapper up and going as well. My code is a bit messy yet, but I'll describe loosely what I did:

I didn't care for the way Vigilante split lines via a period. While that makes the code a lot nicer, it does funky things with screen layout (I'm just picky). So I used some of the ideas to instead parse by blocks of ANSI instead of by sentence. I begin by parsing on the Room Name. Then, I capture everything up to the exit line. I then split this block of text up by ANSI color into a string list. I walk through the string list, and pull out things like weather, players, and things by ANSI color, then clean up the big block of text so I'm left with just the long room description.

If this sounds messy, well... it is. I'm sure it isn't great for speed either. But it works great, and the mapper (thus far) appears happy. I can see why Achaea is one of the big challenges in the mapping world... their output is MESSY. In a single room description, they repeat a room color up to 10 times (the same color!). They put in random linebreaks as well, which is nuts since the screenwidth is a configurable property. So I strip all that junk out as well. Now I can set my screenwidth to 250 in Achaea, and let zmud take care of the line wrapping. Each "section" (weather, desc, players, things) starts on a new line and is much more visually pleasing.
Reply with quote
Seyen
Beginner


Joined: 31 Aug 2005
Posts: 15

PostPosted: Tue Sep 13, 2005 6:46 pm   
 
Could you post it up, please? I have made my own script, and what it basically does, it parse the text between name and exits in three triggers. One for desc, one for objects, one for players. But I so far have had no luck making it appear more tidy on the screen(though I can store it in a tidy manner in the variables, for redisplayal).
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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