|
hogarius Adept
Joined: 29 Jan 2003 Posts: 221 Location: islands.genesismuds.org
|
Posted: Sun May 07, 2006 7:25 pm
Simutronics' Modus Operandi Watch Window |
I play Simutronics' Modus Operandi. (MattLofton, I'm guessing you'll get to respond to this, since you've played DragonRealms. ) I'm trying to set up a Watch window, which I believe is like a Familiar window in DR or GemStone. The text that should go into the watch window is set off by a GSL e tag (Char28,G,S,e,cr,lf) at the beginning, and a GSL f tag (Char28,G,S,f,cr,lf) at the end. %gsl(f) contains the text that would be output to the Watch window in eScape or the Simu Wizard. After one or more sets of data output in this fashion, Modus outputs a GSL q tag (Char28,G,S,q,10digits,cr,lf), which is a timing code that increments by 1 each second. (Actually, the GSL q tag is sent out after most blocks of output from the game, and also is sent out every so often by itself; I believe this is to synchronize timers in the Simu Wizard.) I'm having problems because of some weird stuff in the output from Modus.
First, let me note what triggers and such I've been fiddling with.
Code: |
1. #TRIGGER {%ends(%gsl(f),~"%crlf%crlf~")} {#gag} ""
2. #TRIGGER (%ends(@WatchText,~!)) {#win Watch @WatchText;@WatchText = ""}
3. #TRIGGER {f} {#gag;WatchText = {%concat(@WatchText,%gsl(f)}} "" {gsl}
4. #TRIGGER {q} {#if (@WatchText <> "") {#win Watch quote(@WatchText);@WatchText = ""}} "" {gsl}
|
I realize that numbering them 1-4 probably isn't standard convention, but I want to be able to refer to them in the following text.
As I said, I'm using these somewhat convulted triggers to address some weirdness in the output from MO.
Such as...
Code: |
GSe
Suddenly, the booming voice of the announcer bellows forth through the overhead GSf
GSe
speakers, "Now entering the fight, weighing in at 252 lbs. and standing at a GSf
GSe
height of six feet, two inches ... please welcome GSf
GSe
T GSf
GSe
R GSf
GSe
I GSf
GSe
S GSf
GSe
T GSf
GSe
A GSf
GSe
N GSf
GSe
GSf
GSe
J GSf
GSe
O GSf
GSe
N GSf
GSe
E GSf
GSe
S GSf
GSe
!"
GSf
GSe
Suddenly, the booming voice of the announcer bellows forth through the overhead GSf
GSe
speakers, "Now entering the fight, weighing in at 136 lbs. and standing at a GSf
GSe
height of five feet, nine inches ... please welcome GSf
GSe
L GSf
GSe
O GSf
GSe
R GSf
GSe
E GSf
GSe
L GSf
GSe
I GSf
GSe
GSf
GSe
F GSf
GSe
A GSf
GSe
I GSf
GSe
R GSf
GSe
Y GSf
GSe
!"
GSf
* * Betting is now closed * *
GSq1146361140
|
Apparently this was a kludge to get the names Tristan Jones and Loreli Fairy to be output in all caps. Unfortunately, when I try to #cap it directly to my watch window, it displays one letter per line. That is why I wrote up triggers # 3 and 4, concatenating gsl(f) into the variable @WatchText and outputting @WatchText into the Watch window as appropriate. Trigger 1 is an attempt to remove a blank lines resulting from a null gsl(f). Trigger 2 adds a line feed to the Watch window at the end of a sentence that ends with an exclamation mark, if the following sentence is send in the same gsl(f) block.
The above output from the mud also includes another problem. Near the end of the text, the !" is not being captured by the trigger, and remains by itself in the main MUD window. I have a similar problem as shown below:
Code: |
GSe
The loud booming voice of the announcer rings out, "The next match will GSf
GSe
be between Loreli Fairy and Tristan Jones! Please make your bets, the fight will begin GSf
GSe
very shortly!"
GSf
* * Betting is now open * *
|
In the above output from the MUD, the { very shortly!"} line is not being picked up by the trigger, and remains in the main mud window. (The { * * Betting is now open * *} line is not tagged with GSLe and GSLf codes and are not vital to output to the Watch window.
Does anyone have any insights on how to make this work better, without the problems I've encountered? This is an annual event, and I really can't test suggestions until next year, but I'd like to see what I can do differently now while I still have this in my mind.
Thank you, all, for your help.
Hogarius. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon May 08, 2006 2:14 am |
Quote: |
1. #TRIGGER {%ends(%gsl(f),~"%crlf%crlf~")} {#gag} ""
2. #TRIGGER (%ends(@WatchText,~!)) {#win Watch @WatchText;@WatchText = ""}
3. #TRIGGER {f} {#gag;WatchText = {%concat(@WatchText,%gsl(f)}} "" {gsl}
4. #TRIGGER {q} {#if (@WatchText <> "") {#win Watch quote(@WatchText);@WatchText = ""}} "" {gsl}
|
Your problem with the lines containing ! for #2 is that none of those lines end with !. They end on either a carriage return or a double-quote. If #3 isn't capturing them, though, I'm not sure other than to say the trigger is executing faster than ZMud's internal tag capturing stuff Zugg had to add for Simutronics support (which isn't very bloody likely since the trigger is interpreted code and the internal Simutronics stuff is compiled code so it's probably some obscure issue). Are you getting any weird double-ups?
#4 also seems to be intended to use the %quote() function, but you forgot the % denoting it as a system function rather than plain text. I'm thinking that's a simple typo, though. Other than this, however, it looks perfect.
#2 doesn't seem to do anything different than #3, so I'd dump it completely. Any special testing can be done in #3 anyways, so it's no real loss.
As for improvements, you will need to incorporate an #IF check in #3 to determine what to do with each item in gsl f. I would suggest using a stringlist, and testing the length of each f tag:
#trigger {f} {#if (%len(%gsl(f)) > 2) {#noop not part of the name;#additem WatchText {%gsl(f)}} {#noop part of the name;#if (%ends(%gsl(f),"~"")) {Tempname = %concat(@Tempname,%remove("~!~"",%gsl(f)));#additem WatchText @TempName;#additem WatchText "!~""} {TempName = %concat(@TempName,%gsl(f))}}} "" {gsl}
#4 would then have to be slightly modified to deal with the stringlist, but that should be an easy task:
#TRIGGER {q} {#if (@WatchText <> "") {#window Watch {%replace(@WatchText,"|",%cr)};@WatchText = ""}} "" {gsl} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|
|
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
|
|