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
Malach
Apprentice


Joined: 03 Nov 2007
Posts: 132

PostPosted: Tue Nov 06, 2007 6:58 pm   

[2.10] %ansi codes bleeding when using #say
 
This is hard to give steps to replicate, but basically my system used #say instead of #show and had a lot of %ansi codes with it. I noticed with 2.10 that those %ansi codes were bleeding way past the text they were supposed to be coloring. For example huge chunks of text would start blinking after a trigger would call an %ansi function with blink.

I did some testing and discovered that the problem was not happening with #SHOW. I was under the impression from the help files that #SAY and #SHOW were supposed to be the same thing? Anyway, I changed all my #say to #show and the problem hasn't happened since.
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Nov 06, 2007 8:45 pm   
 
Can you give me more of a specific example of one of your #SAY lines? I haven't seen this myself.

The #SHOW command automatically adds an ESC [ 0m to the end of your string, which resets the color. If you are using #SAY, then you need to explicitly add an %ansi(reset) to the end of the text to prevent the bleeding.

This is normal and is how it is supposed to work. ANSI color should always be terminated with an %ansi(reset) if you want to reset the color to normal.
Reply with quote
Malach
Apprentice


Joined: 03 Nov 2007
Posts: 132

PostPosted: Tue Nov 06, 2007 8:53 pm   
 
Okay that explains it then. It would never bleed in 1.34 or Zmud and the help files don't give an indication that %ansi(reset) needs to be used to terminate the codes. Not a bug then, just confusion. Could that be added into the %ansi help file? Or the say one? Or somewhere.

A specific example would be: #TRIGGER {^You bathe} {#say %ansi(high,red)BATHING!}

Good chance of everything after being colored red for awhile.
_________________
Intel Core2 Quad CPU @ 2.4 GHZ with Windows Vista Home Premium and 2 GB Ram
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Nov 06, 2007 8:55 pm   
 
Hmm, if it didn't do this in zMUD then maybe I need to fix this. What do other people think? Should #SAY and #ECHO also add an ansi(reset) automatically to the end?
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Tue Nov 06, 2007 9:04 pm   
 
Yes. If someone wants to change the text colour on lines after they've run their #say, they can use #sub with no problems. I've never seen #say used in that manner, always just to make some notice that they want printing to the screen look prettier.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Arde
Enchanter


Joined: 09 Sep 2007
Posts: 605

PostPosted: Tue Nov 06, 2007 9:14 pm   
 
I have many triggers with #SAY and %ansi() calls but never saw colors bleeding. Although I must say that I not had a time to test 2.10 on line and maybe this happening only in 2.10? In any way the color bleeding after the #SAY or #ECHO command is definitely not what I would expect from them. I vote for auto append of %ansi(reset).
_________________
My personal bug|wish list:
-Wrong Priority when copy-paste setting
-1 prompt trigger for Mapper, Session and General Options, not 3 different!
-#SECTION can terminate threads
-Buttons can't start threads
Reply with quote
Malach
Apprentice


Joined: 03 Nov 2007
Posts: 132

PostPosted: Tue Nov 06, 2007 9:24 pm   
 
I noticed it in an earlier 2.x version but didn't use it long enough to really test it. But in 2.10 it was happening constantly and was really quite...distracting.
_________________
Intel Core2 Quad CPU @ 2.4 GHZ with Windows Vista Home Premium and 2 GB Ram
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Wed Nov 07, 2007 2:48 am   
 
I never put %ansi into my #SAY, but I'd have expected %ansi(reset) to have been appended automatically, and certainly with #ECHO since #ECHO has it's own colour style.
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Nov 07, 2007 5:54 am   
 
OK, this is fixed now for 2.11. For both #SAY and #ECHO.
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Wed Nov 07, 2007 3:10 pm   
 
I don't know the current CMud details but #say and #show used to have different speeds. I think they still do in Zmud.

I THINK it was like this. #Show would wait for the current block of text to finish displaying; #Say would jump in and display right after the line that caused the trigger to fire.

So if you wanted to break into a block of text and display a message for each line in the block you would use #SAY.
Of course then if you wanted to use different colors for your messages you would put in %ansi colors.

Cheers for the change Zugg.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Zugg
MASTER


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

PostPosted: Wed Nov 07, 2007 5:58 pm   
 
#SHOW puts the text into the front of the incoming text buffer from the MUD. So the text from #SHOW gets processed just like incoming MUD text. In older versions (and in zMUD), the text from #SHOW was placed at the *end* of the buffer, so other queued text from the MUD might be displayed first. But this was fixed in the 2.0x versions of CMUD.

Unlike incoming MUD text, the #SHOW command also forces the output of it's line, even if incoming text is being blocked by a script that is running.

#SAY and #ECHO actually interrupt the normal MUD output display and send their text directly to the screen. This text is displayed using the Information Message color style.

In all cases, none of these commands will interrupt in the middle of a line. All output processing in CMUD is done on a line by line basis to avoid having problems with text interrupting a line and causing triggers to fail.

Anyway, even though there *are* differences in how these commands are executed, you shouldn't really see any speed differences between them anymore. #SHOW no longer waits for the current block of text to finish.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Thu Nov 08, 2007 2:36 am   
 
Seb wrote:
I never put %ansi into my #SAY, but I'd have expected %ansi(reset) to have been appended automatically, and certainly with #ECHO since #ECHO has it's own colour style.

Actually, what I really meant is that I wouldn't have expected #SAY or #ECHO to affect the colour / ansi of lines following them. That is not quite the same as an %ansi(reset). For example, if you have a line from the MUD that is bold, red, blinking, and then an #SAY and then another line of text from the MUD with no ansi codes in between from the MUD, the 2nd line from the MUD should still be bold, red and blinking, and not be reset by the #SAY or #ECHO. Ideally this would be the case even if you used ansi in your #SAY or #ECHO.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Nov 08, 2007 5:48 pm   
 
This was happening back in 2.01.

http://forums.zuggsoft.com/forums/viewtopic.php?t=28068
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Thu Nov 08, 2007 6:51 pm   
 
Oldguy,
Yep,
Yes it was, Zugg did fix part of this with the #Show command. But I don't think he was really thinking about those of us that us #say and #echo with ansi code in them;
even with your specific mention of them. Now that he has confirmed that #show and #say are nearly identical in speed we don't need to use #say ANSI anymore.

I am also seeing the added newlines you are speaking of in that post now too.
At the time of that post I hadn't been mudding in a few weeks and the newlines look to have changed slightly too. Perhaps if you post a raw #debug of what is happening in a new thread it will get looked at again.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
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