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
DDMyth
Newbie


Joined: 11 Dec 2006
Posts: 9

PostPosted: Mon Mar 31, 2008 1:49 am   

Trailing spaces in logs?
 
Hi. I just realized after logging a fight in Imperian that trailing spaces on certain lines get logged, but I can't seem to use those trailing spaces for triggers. Is there a way to change this?
If you've played any IRE game, I'm talking about illusions :>
For example, what shows up in the log is:

Code:

xxxx pricks you twice in rapid succesion with his dirk.                        |
Strange, everything doesn't quite seem so simple anymore.                      |
You feel your allergy to the sun going into temporary remission.


but I can't use those extra trailing spaces and I'd like to.

Thanks for your help!
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Mar 31, 2008 9:37 am   
 
Turn off server-side word wrapping. That'll stop the lines from wrapping at all.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
DDMyth
Newbie


Joined: 11 Dec 2006
Posts: 9

PostPosted: Mon Mar 31, 2008 3:41 pm   
 
I have no idea how to do that. Would you perchance know how?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Mar 31, 2008 4:22 pm   
 
Seriously, everyone should do this if their MUD allows it. It's CONFIG LINELENGTH or CONFIG SCREENWIDTH in IRE MUDs. Set it to 0 to turn off word-wrapping.

If you think the unwrapped text looks ugly, you can turn on client-side wrapping. In the word wrap options, turn Word Wrap on, Auto Wrap off, set the Wrap Column to 80 and the indent to 0.

The important distinction between server-side and client side word wrapping is that triggers are tested before the lines are wrapped by the client. So your three lines there aren't wrapped by the server any more and appear as a single line. Then triggers are run, and won't fire if your lines are anchored properly, and then the text is wrapped so you'd never know the difference.

Disrupting that kind of illusion should be as simple as increasing the server's line length by a single character, which'll cause the first character of the second line and the first two characters of the third line to appear at the end of the previous line, breaking the match. But turning off wrapping totally will make many multi-line tasks (like capturing channels) easier.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
DDMyth
Newbie


Joined: 11 Dec 2006
Posts: 9

PostPosted: Thu Apr 03, 2008 4:09 pm   
 
My god. I love you so much. You really are my hero.
...
Are you really human?

(This post is meant as a thank you very much, I greatly appreciate it. Keep up the good work :D )

Edit: Darn, not a valid Config option in Imperian. Thanks anyway :)
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Apr 03, 2008 5:02 pm   
 
Really? That's extremely pants; I was under the impression that all the IRE games offered it. Imperian certainly did when I played. Find out what happened to it and convince them to put it back. It's essential.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
DDMyth
Newbie


Joined: 11 Dec 2006
Posts: 9

PostPosted: Sat Apr 05, 2008 5:28 pm   
 
So, back to the original question. Would you happen to know how I could use those trailing spaces? Is there a way to make zmud stop chewing up the trailing spaces? As I said, in the log, the spaces are there, but in my mud output box, they aren't.

Thanks again :)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Apr 05, 2008 6:02 pm   
 
ZMud automatically eats leading and trailing spaces that aren't enclosed in brackets. If you are using #READ then I don't believe there's anything you can do as the offending functionality is in the parser itself and you aren't given an opportunity to interfere. If you are using %read() to send the line into a variable and then showing the variable, you might be able to do:

%concat(~",%read(stuff),~")

to preserve the spaces. No guarantees, though, as the parser might still eat the spaces.

That means your only option is to create a custom logging routine using #WRITE. The trigger pattern will preserve spaces, so you can use %trim() to hack off the offending whitespace--and when reading it back you can use %concat() to add in a single trailing space.
_________________
EDIT: I didn't like my old signature
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