|
Nurodma Beginner
Joined: 10 Oct 2005 Posts: 24
|
Posted: Tue Apr 29, 2008 2:23 am
Fires, but won't compile. |
#TRIGGER {^(%w) tells you 'stuff you want told here)'$} {temp1=%1;#IF (%ismember( @temp1, @characters)) {tell %1 yes} {tell %1 no}}
#VAR characters {char1|char2|char3|etc}
I copied it right out of my zmud script, I've been trying to make it work on CMUDwith no success, can anyone help me out? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Apr 29, 2008 2:53 am |
You have an unmatched bracket ) in your pattern.
|
|
|
|
Nurodma Beginner
Joined: 10 Oct 2005 Posts: 24
|
Posted: Tue Apr 29, 2008 3:01 am |
Wow, I can't believe I missed that...
Thanks |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 02, 2008 2:08 pm |
ok, I have a total of 3 triggers that have the "fires, but doesn't compile" error...
Code: |
ERROR: Trigger "^ Health (%s): (%n)/(%n)" fired but did not compile
ERROR: Trigger "^ Mana(%s): (%n)/(%n)" fired but did not compile
ERROR: Trigger "H:(%d) M:(%d) E:(%d) W:(%d) ~<([eb-])~>" fired but did not compile |
these all worked fine under zmud... had cmud convert all my stuffs, and for these three (when peeking into the settings), under the compiled code tab, it tells me the %1 or %2 is an illegal token... I have no clue whatsoever how to fix this, and because this is borked, my entire system borked :(
and yes, I'm a complete coding nub...
EDIT: thought I should mention where each of these works... the first two take my current and maxhealth/maxmana out of my score information (on Imperian), the third grabs my health and mana as shown in my prompt |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 02, 2008 2:28 pm |
"fires but did not compile" can mean either the pattern or the script isn't compiling. If the error's reported on the script tab, we'll need to see the script and pattern; if it's on the pattern tab, just the pattern should do.
So yeah, post the scripts. |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 02, 2008 5:25 pm |
silly me... script, coming up (from the XML tab of that package editor you get when you click "settings")
the script for getting health/mana from prompt
Code: |
<trigger priority="2240" id="25">
<pattern>^ Health (%s): (%n)/(%n)</pattern>
<value>@health = %2;@maxhealth = %3</value>
</trigger> |
getting health/mana from score:
Code: |
<trigger priority="2240" id="25">
<pattern>^ Health (%s): (%n)/(%n)</pattern>
<value>@health = %2;@maxhealth = %3</value>
</trigger> |
now, under the compiled code tab, this shows (number varies depending on which one I'm looking at)
Code: |
Error compiling script:
illegal token: = %1 |
there's probably a simple solution for this, but as said before, I'm a coding nub... :( |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Fri May 02, 2008 5:42 pm |
Use either #VAR health %2 or health = %2, but do not use @health = %2. The @ in front of the variable name tells CMUD to dereference it, meaning that it gives the value of the variable in an expression. So, if health was previously set to 2000, let's say, you'd essentially be saying 2000 = %2.
Also, you don't need the parentheses around %s unless you want to capture the spaces into %1, but then you'd have to reference %1 and %2 instead of %2 and %3, of course. You could also use %d in place of %n, assuming the numbers do not have commas in them, which they typically don't in IRE MUDs. |
|
|
|
Corthono Beginner
Joined: 01 May 2008 Posts: 22
|
Posted: Fri May 02, 2008 6:00 pm |
thanks a bunch ^_^ deleting the @'s fixed the issue :)
told ya, nub... :P |
|
|
|
|
|