|
Alcander Wanderer
Joined: 04 Aug 2001 Posts: 79 Location: USA
|
Posted: Sun Oct 08, 2006 10:04 pm
[1.09] Variable sending to mud oddly. |
Pattern: &Name gives &Money coins to you.
Script: say Thank you @Name. Your @Money is appreciated.
Variable @Name shows: Phyre
Variable @Money shows: 1 platinum
Mud Shows: Thank you Phyre. Your 1platinum is appreciated.
Something odd or am I doing something wrong? I believe this worked in Zmud with 1 variable, but for now I use 2 variables for the number and the coin type.
Just thought i'd mention it. |
|
|
|
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Mon Oct 09, 2006 12:35 am |
As a workaround (untested), try putting "" around the space after @Money:
Script: say Thank you @Name. Your @Money" "is appreciated.
If CMUD is compressing the space, this should stop it, I think. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Oct 11, 2006 4:08 am |
I found this obscure problem...
Auto-typed variables are a bit tricky. For zMUD compatibility, a Variable can actually contain a "function". So, CMUD needs to decide how to parse and compile a variable.
In the case where @Money has the value "1 platinum", CMUD thought that this was a function since it started with a number. The auto-detection for functions was a bit stupid. If it started with a letter, it was parsed as a string, but if it started with a number it was parsed as an expression.
As an expression, the space between the 1 and platinum is absorbed (because white space is supposed to be ignored in expressions).
I improved the smarts of the function detection so that it looks for more specific function syntax. If it sees a number (or floating point) at the beginning, then it scans past that to see what token comes after it. If it doesn't see a valid expression token, then it reparses the entire thing as a string instead of an expression.
This fixed the example that you gave and doesn't seem to have any side effects on my test scripts, so I'll cross my fingers that I haven't screwed anything up with existing user-defined functions. |
|
|
|
|
|
|
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
|
|