|
slicertool Magician
Joined: 09 Oct 2003 Posts: 459 Location: USA
|
Posted: 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}} |
|
|
|
|
slicertool Magician
Joined: 09 Oct 2003 Posts: 459 Location: USA
|
Posted: 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. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: 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... ;) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: 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. |
|
|
|
slicertool Magician
Joined: 09 Oct 2003 Posts: 459 Location: USA
|
Posted: Tue Dec 05, 2006 1:03 am |
Bumping thread as a reminder.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Dec 05, 2006 7:52 pm |
Sorry, but I don't think this is going to make it into the public version.
|
|
|
|
|
|