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


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Dec 11, 2006 3:41 am   

[1.22] Alias auto-append option persists after #ALIAS
 
This is probably not a bug but contributed to some unexpected behaviour for me, so I'll post it just in case.

When you import a mud file, aliases get the auto-append option set. This option remains after changing the contents of the alias via the #ALIAS command.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Mon Dec 11, 2006 8:55 am   
 
I believe that is the intended behavior and it makes sense to me.

If you are long time zMUD user who imported your scripts, you expect the alias to work as expected. If you simply edit, but did explicitly turn off that option, you would still expect the option to remain.

Now if you previously the alias, and recreated it via the #ALIAS command, then that could be expected.

I'm curious though, has anyone tried to see what happens if you create an alias with "%-1" or "%params" and the auto-append option?
_________________
Asati di tempari!
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 11, 2006 7:31 pm   
 
Yes, this is normal. It's just like how using #TRIGGER to change a trigger won't change any of the existing trigger options. Or #KEY doesn't change existing macro options.

I mentioned this in the other thread, but CMUD keeps track of the largest parameter number that is actually *used* in the alias. So %-1 or %params probably doesn't effect it, but if it did, then it might just think that %1 was used.

In any case, this kind of complexity is not handled by auto-append. Auto-append is intended for a cheap and easy fix to most of the zMUD aliases that used it. More advanced programmers who are creating more advanced aliases should never use auto-append and should use %-1 or %params explicitly in the alias.

In fact, I'll say officially that the Auto-Append option is "deprecated" and is only intended for zMUD compatibily and may disappear in a future version of CMUD.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Dec 11, 2006 8:00 pm   
 
Given the fact that the auto-append option is already deprecated (as you've just said) and the fact that I have very few, if any, aliases in my *.MUD file that would need it (as I usually use %1 or whatever), and the fact that there is no programmatic way to disable the auto-append option, plus me not wanting to go through all my aliases unticking the option, maybe a command from the Tools menu to unset the auto-append option for all aliases in the selected package would be useful? Having the auto-append option enabled can give undesirable behaviour so a quick way of getting rid of it might be handy.

[Edit: I suppose an option (default enabled for *.MUD imports) on packages to allow auto-append might also work, but I seem to remember this was more work for you.]
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 11, 2006 8:10 pm   
 
Once there is a more human-readable XML export format for scripts, then it will be pretty easy to export your package and then do a global replace in the XML text file to remove it. Not something I'm worrying about for the public release, sorry.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Dec 11, 2006 8:18 pm   
 
Fair enough. I wouldn't mind doing a global replace in the XML file - I hadn't thought of that (although I'm a bit wary of losing settings and not realising it with an export / import - I guess I'll have to do some tests...)
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Dec 11, 2006 8:47 pm   
 
Unfortunately, it would be really hard to do this with the current XML format. The AutoAppend option is buried as a bit value in the Opt field, so you can't really do a global replace without screwing up the options of other settings, like triggers, that use the same Opt field but assign the bits to different options.
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