![](templates/Classic/images/spacer.gif) |
rhombur Beginner
Joined: 13 Oct 2005 Posts: 24 Location: Illinois
|
Posted: Sat Feb 05, 2011 2:29 am
getting multiples of a variable in a single line |
i'm slowly starting to use CMUD, and am trying to rebuild some of my counts and triggers from zmud.
i've been working with a trigger that previously worked in zmud without flaw that captured multiple variables from a single line, sometimes the same variable.
the example here is:
Code: |
A pinch of sulfur, and a pinch of sulfur flare brightly and vanish!
|
before, in zmud i had a trigger that looked like this:
Code: |
#trigger {pinch of sulfur*flare brightly and vanish} {#add @sulfur - 1}
|
logically i don't know why this worked, but it did. so i'm trying to figure out how to make this line work in cmud without having to build like 90 or more capture triggers for individual spell cast strings. any help?
[/code] |
|
_________________ Niax Rhasu |
|
|
![](templates/Classic/images/spacer.gif) |
chamenas Wizard
![](images/avatars/602076375506b9fe557f91.gif)
Joined: 26 Mar 2008 Posts: 1547
|
Posted: Sat Feb 05, 2011 3:46 am |
You're saying that you captured sulfur no matter how many times it appeared in the string and added each time for it? That's definitely doable, though not necessarily like that.
|
|
|
![](templates/Classic/images/spacer.gif) |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Feb 05, 2011 6:51 pm |
I don't see how you could have done anything like that in Zmud with that code.
One problem with your code is that there is a space between the negative sign and the 1. I assume you are trying to subtract a sulfur from a number listing your supply. You also should not have the @ in front of the variable name. That command should be: "#add sulfur -1". The #ADD command is actually considered obsolete now, but is retained for backwards compatibility.
Another problem is that the ability to repeat a trigger within a line was added to Cmud in version 2.x I don't think that option was available in Zmud, so I don't see how it could have worked.
In Cmud, you could do:
Code: |
#trigger {pinch of sulfur*flare brightly and vanish} {sulfur = @sulfur - 1} |
and set the Repeat Within Line option in the Package editor. That option was not available under Zmud, so I'm not sure how this could have worked in Zmud. Or there are several other ways you could do it in Cmud instead. |
|
|
![](templates/Classic/images/spacer.gif) |
Ralph1971 Wanderer
Joined: 01 Mar 2008 Posts: 64
|
Posted: Fri Feb 18, 2011 9:05 pm |
in this example, what is the difference between repeat and reparse?
|
|
_________________ Win7-home - Cmud 3.33a
WinXP-pro - Zmud 7.21 |
|
|
![](templates/Classic/images/spacer.gif) |
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Sat Feb 19, 2011 2:12 am |
I'm not sure what you mean by reparse--there's no such option. Repeat Within Line means that the trigger will fire as many times as the pattern matches in the line.
|
|
|
![](templates/Classic/images/spacer.gif) |
charneus Wizard
![](images/avatars/51564989746d852114da6d.jpg)
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Feb 19, 2011 3:02 pm |
Reparse was the old 'Repeat within line' option.
|
|
|
![](templates/Classic/images/spacer.gif) |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sat Feb 19, 2011 9:59 pm |
Reparse is a trigger state type. ZMud had no other Reparse or old 'Repeat within line' option.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
![](templates/Classic/images/spacer.gif) |
charneus Wizard
![](images/avatars/51564989746d852114da6d.jpg)
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sun Feb 20, 2011 7:29 pm |
That's right... for some reason, I thought otherwise. Guess it's been a while since I've used ZMud...
|
|
|
![](templates/Classic/images/spacer.gif) |
|
|