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
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon May 24, 2010 9:50 pm   

[3.17-previous versions?]Bug: 'Smart command line' isn't being so 'smart.'
 
In Aardwolf, @ is the symbol for color codes. For instance, doing:

@RColors @Gare @Bfun!

would result in:

Colors are fun!

Properly set, they have one space between each word. I have the color syntax correctly marked under Color syntax, however, what winds up happening is this:

Colors..are..fun! (the . represents a space since colors don't show up in code and quote doesn't retain spacing).

The problem is resolved if you do it in this manner, albeit an awkward one:

@RColors@G are@B fun!

My suspicion is that CMUD sees @ on the command line and attempts to evaluate a variable, THEN checks to see the color syntax. Since the variable returns null, it adds a space. This was tested by opening up an untitled session, changing color syntax foreground syntax to @F, then typing on the command line:

#SAY {@RColors @Gare @Bfun!}

which resulted in three spaces (one for each non-existent variable) and then the !.

Maybe this can be resolved by having CMUD check variables last in order of operations?

Charneus
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Mon May 24, 2010 10:00 pm   
 
finding a %null variable should not be inserting spaces... you could always use #SENDRAW to force it to the game unmolested
_________________
Discord: Shalimarwildcat
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Mon May 24, 2010 10:36 pm   
 
That's a big inconvenience, having to do #SENDRAW each time I want to send colors.

And it's not a %null variable, it's rather that the variable doesn't exist, so it adds the space. Upon further testing, this happens whether color syntax is enabled or not, so apparently the code in CMUD is saying 'Oh, this variable doesn't exist, so we'll replace it with a space instead.'

Now, granted, I could also escape the entire line with `, but that's also an inconvenience to remember to start each line with a ` to do color codes.

Not complaining, but I just don't think that variables should be checked first just because it has @ in front of it. Not sure there's a workaround except to not have non-existent variables return spaces.

Charneus
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4692
Location: Pensacola, FL, USA

PostPosted: Tue May 25, 2010 3:42 am   
 
Non existant is functionally the same as a %null variable... just semantics there.
(unless the space is not put there when there is a variable of that name that has no value, I didn't check)

You could also toggle off the command line parsing.

Not to mention you could always change the default char for variables to something other than @.

Yes.. none of these solutions is convieniant. That can't always be helped.
_________________
Discord: Shalimarwildcat
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Tue May 25, 2010 4:43 am   
 
Workarounds or not, this is, in my eyes, still a bug. I wasn't quite looking for solutions because I'm well aware of the things I could to to make it work properly. I'm looking to get a bug fixed because I'm not the only CMUD user this affects, and it's not feasible to tell people 'Oh, you must do it this way even though it's less convenient!'

*shrug*

By the way, currently on Aardwolf, there are 35 CMUD users. :P

Charneus
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue May 25, 2010 2:52 pm   
 
If it were trying to treat that syntax as null variables or nonexistent, it would be inserting a null, which is nothing. Not a space. Test it by putting some other non-existent variable in your script. So the problem is _not_ what you hypothesize. It is not related to variable syntax.

I haven't figured out how to properly set the color syntax, so I haven't been able to reproduce the problem. But if the problem is as you describe, it is most likely in the color syntax code, not in the variable syntax code.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue May 25, 2010 6:47 pm   
 
test command:
Code:
tell tutal @mtest @rof @gcolor

result from debugger message a:
Code:
tell tutal @mtest  @rof  @gcolor


can't get any closer than that since the debugger doesn't get more detailed. I noticed that this problem doesn't affect the first use of the @letter syntax, however, and doesn't trigger the problem if you end the line with one.
_________________
EDIT: I didn't like my old signature
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed May 26, 2010 8:33 pm   
 
Rahab wrote:
If it were trying to treat that syntax as null variables or nonexistent, it would be inserting a null, which is nothing. Not a space. Test it by putting some other non-existent variable in your script. So the problem is _not_ what you hypothesize. It is not related to variable syntax.

I haven't figured out how to properly set the color syntax, so I haven't been able to reproduce the problem. But if the problem is as you describe, it is most likely in the color syntax code, not in the variable syntax code.


I'm going to stick with my original hypothesis, with no disrespect to you. Why am I so certain it's not color syntax?



Notice the difference? Notice the command lines? It is indeed inputting a space when a non-existent variable is used, even without color syntax enabled.

As MattLofton pointed out, the Script Debugger doesn't even help out in this case...

Charneus

Edit: Of course, as soon as I say that, I decide to try another test that invalidates my theory to some degree:

#SAY {This|@is|a|@test|to|@show|that|@variables|that|@don't|exist|@are|replaced|@with|spaces}

returns:
Code:
This||a||to||that||that|'t|exist||replaced||spaces


No spaces where the non-existent variables are to be... so not sure what it could be anymore... Still is quite odd.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed May 26, 2010 8:41 pm   
 
Um, Charneus, take another look at the difference between those two #SAY lines:
Quote:
#SAY {This @is a ...}
#SAY {This a ...}

Notice that the "@is" has a space before it _and_ a space after it. So, "@is" is being replaced by nothing at all, and the spaces before and after it are being printed, just as you told it to do.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Wed May 26, 2010 8:43 pm   
 
Haha... dang it... sleep deprivation for the win! Now I do feel silly. :P

So maybe it /is/ related to color syntax... hmmm. Gonna test that out even more.

Charneus

Edit: Disabled color syntax, problem still exists. It sends two spaces instead of one... *sigh*
Reply with quote
Zugg
MASTER


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

PostPosted: Wed May 26, 2010 10:17 pm   
 
MattLofton had the ultimate test line posted above that verifies the bug and confirms it doesn't have anything to do with the color syntax. I've added it to the bug list. I'm as perplexed by it as anyone.
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