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
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Sun Nov 12, 2006 10:47 am   

[1.15] Old zMud #PICK squabble won't compile in CMUD
 
Here is the #PICK Syntax it is having trouble with. zMud always squabbled over it and said it wasn't valid syntax, but it always executed correctly. CMUD just plain won't compile it.

The following is all contained in the alias 'const' (also, throwing everything into a local variable as a string and tossing it to #PICK doesn't work either, so it is most likely the #input it doesn't like).

Code:
#PICK {p:What item do you want to create?} {o:1}
 {Health Scanner:#input {construct health scanner}}
 {Power Converter:#input {construct power converter}}
 {Light Amplification Goggles:#input {construct light amplification goggles}}
 {UV Goggles:#input {construct UV goggles}}
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Sun Nov 12, 2006 12:31 pm   
 
If I put quotes around the #input like:

Code:
#PICK {p:What item do you want to create?} {o:1}
 {Health Scanner:"#input construct health scanner"}
 {Power Converter:"#input construct power converter"}
 {Light Amplification Goggles:"#input construct light amplification goggles"}
 {UV Goggles:"#input construct UV goggles"}


It will compile, but it sends the quoted part as a string to the mud instead of populating my command line with the syntax.
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Nov 13, 2006 8:14 pm   
 
There is a bug in CMUD handling the "wierd" syntax of the #PICK command. It thinks that the labels are window references. This is what happens when zMUD does something wierd like this. I need to figure out a way to handle the #PICK syntax in a more standard way, or else I'll need to kludge the parser to handle this. But it's on the list.
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Tue Nov 14, 2006 9:08 am   
 
Could #PICK work with similar syntax to #SWITCH?
So you would be required to specify the caption and number of values you could select at the start, then continue in new #SWITCH syntax style

Code:
#PICK {p:Select an action:} {o:1} {kill:kill @mob} {kick:kick @mob} {*stun:stun @mob}


Would become
Code:
#PICK ("Select an action:", 1)
   (Kill) {kill @mob}
   (Kick) {kick @mob}
   (*Stun) {stun @mob}


I know you don't much care for changing existing syntax, but it'd bring it into line with an existing command.
_________________
CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;)
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Nov 14, 2006 8:23 pm   
 
The problem is that the button captions are optional. So it doesn't have a specific rigid syntax like #SWITCH does.

Also, remember that () are used to evaluate expressions in the parser. They are not used for arguments to commands...only functions.

I don't mind the "kill:kill @mob" syntax too much, except that it conflicts with the windowname:command syntax and prevents you from using that in #PICK, which is annoying. But I really hate the "p:Select an action" syntax.

I think it probably needs to be changed to use string lists rather than the : syntax that conflicts with the windowname: syntax. So maybe something like this:
Code:
#PICK {Select an action:||single} {kill|kill @mob} {kick|kick @mob} {stun|stun @mob|checked}

In other words, the syntax is "Caption|Command|Options". In the first case, the Command part is empty, so this is used as the main caption for the window. The "single" option tells it to only allow a single choice. The "checked" options marks the ones checked by default.

Still not sure I really like it, but at least it doesn't conflict with the existing parser syntax. Although it does mean that the arguments would need to be parsed as strings instead of commands, which could mess up the syntax checking of the commands (since "kill|kill @mob" isn't a valid command syntax).

Still thinking.
Reply with quote
slicertool
Magician


Joined: 09 Oct 2003
Posts: 459
Location: USA

PostPosted: Tue Dec 05, 2006 1:03 am   
 
Bumping thread as a reminder.
_________________
Ichthus on SWmud: http://www.swmud.org/
Reply with quote
Zugg
MASTER


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

PostPosted: Tue Dec 05, 2006 7:52 pm   
 
Sorry, but I don't think this is going to make it into the public version.
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