Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Nurodma
Beginner


Joined: 10 Oct 2005
Posts: 24

PostPosted: 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?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Tue Apr 29, 2008 2:53 am   
 
You have an unmatched bracket ) in your pattern.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Nurodma
Beginner


Joined: 10 Oct 2005
Posts: 24

PostPosted: Tue Apr 29, 2008 3:01 am   
 
Wow, I can't believe I missed that...

Thanks
Reply with quote
Corthono
Beginner


Joined: 01 May 2008
Posts: 22

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Corthono
Beginner


Joined: 01 May 2008
Posts: 22

PostPosted: 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... :(
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: 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.
Reply with quote
Corthono
Beginner


Joined: 01 May 2008
Posts: 22

PostPosted: Fri May 02, 2008 6:00 pm   
 
thanks a bunch ^_^ deleting the @'s fixed the issue :)

told ya, nub... :P
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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