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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Apr 07, 2008 1:58 pm   

[2.22] Ansi Trigger dependent on Cmud line wrapping.
 
The line I'm triggering on is:

You are surrounded by utter darkness, and can see nothing. The smell of minerals and dirt fills your nostrils.

If my screen is wide enough to get the whole line, then it converts to this when I copy and paste it into the trigger:

%e[31mYou are surrounded by utter darkness, and can see nothing. The smell of minerals and dirt fills your nostrils.%e[0m$

However, if the screen isn't wide enough and it wraps I get codes in the middle such as this:

%e[31mYou are surrounded by utter darkness, and can see nothing. The smell %e[0m%e[31mof minerals and dirt fills your nostrils.%e[0m$

With non-ansi triggers the line wrapping isn't an issue. I just put in the whole line and it matches regardless of the wrapping done by Cmud. However with the ansi triggers I'd have to know what my screen width is to add in the mid-line escape codes seen in the wrapped example.

Is this how this is supposed to work? It seems odd that I'd have to include codes for the line wrapping in an ansi trigger.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Apr 07, 2008 3:30 pm   
 
Possibly the best way to deal with it is to turn off server-side line wrapping, if possible, and let cmud do the wrapping instead. But there could be mud design features that require server-side line wrapping. Have you tried it?
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon Apr 07, 2008 3:56 pm   
 
If it's a server-side wrapping issue, then, yes, that would help. I think ReedN is saying that it's a CMUD wrapping issue, though.
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Mon Apr 07, 2008 10:26 pm   
 
Perhaps I wasn't clear. Server side doesn't do any wrapping. This was totally dependent on how wide I made Cmud's screen. In the one case I made the screen very wide. In the second case I made the screen narrow to get some wrapping (from Cmud, not the server).
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue Apr 08, 2008 2:04 am   
 
That's what I thought, yup. If I'm not mistaken, Zugg said that he basically uses his own ANSI (or style) codes in the output window to render the text, so you'll get them at the end/beginning of each line like that to ensure proper rendering. The codes that the server used might be lost when the text gets rendered, which would make it impossible to do the ANSI trigger pattern paste the correct way. Only Zugg knows for sure...
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Apr 23, 2008 7:29 pm   
 
Added to bug list
Reply with quote
atpeace
Novice


Joined: 26 Jan 2009
Posts: 32

PostPosted: Mon Jan 26, 2009 12:57 pm   
 
This was a bug in zmud last version. Now I am porting to cmud I guess my workaround will work for you for the time being

#IF (%regex( @sRoomAll, "\e[37m.+") > 0) {
;RoomDescription SingleLine Only with no objects
#NOOP %regex( @sRoomAll, "(\e[37m.+$)", @sRoomDesc)
;RoomDescription SingleLine Only
#NOOP %regex( @sRoomAll, "(\e[37m.+?\e)", @sRoomDesc)
;RoomDescription Multiline to fullstop
#NOOP %regex( @sRoomAll, "(\e[37m.+\e[37m.+?\e)", @sRoomDesc)
sRoomDesc = %stripansi( @sRoomDesc)
}

The above is for Achaea room descriptions when you have configured server side no line wrap. In ZMud it appeared that the ansi codes for Zmuds own formatting were being applied prior to the data being passed to the trigger.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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