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
rhombur
Beginner


Joined: 13 Oct 2005
Posts: 24
Location: Illinois

PostPosted: 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
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: 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.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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.
Reply with quote
Ralph1971
Wanderer


Joined: 01 Mar 2008
Posts: 64

PostPosted: 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
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

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


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Sat Feb 19, 2011 3:02 pm   
 
Reparse was the old 'Repeat within line' option.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: 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...
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