|
DDMyth Newbie
Joined: 11 Dec 2006 Posts: 9
|
Posted: 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! |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Mar 31, 2008 9:37 am |
Turn off server-side word wrapping. That'll stop the lines from wrapping at all.
|
|
|
|
DDMyth Newbie
Joined: 11 Dec 2006 Posts: 9
|
Posted: Mon Mar 31, 2008 3:41 pm |
I have no idea how to do that. Would you perchance know how?
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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. |
|
|
|
DDMyth Newbie
Joined: 11 Dec 2006 Posts: 9
|
Posted: 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 :) |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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.
|
|
|
|
DDMyth Newbie
Joined: 11 Dec 2006 Posts: 9
|
Posted: 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 :) |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
|
|