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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
SalemFuchs
Newbie


Joined: 17 Dec 2006
Posts: 4
Location: Miami, FL

PostPosted: Fri Aug 28, 2009 5:37 pm   

#SUB Question
 
I'm not sure how to explain this, and this is my first time attempting to ask a question on the forums, so please be nice.

In the help file that comes with zmud, the function I need to be described is phrased like this:

Code:
#TRIGGER {(*) tells you,} {#SUB {%1:}}


The line is supposed to look like 'Alignment: Nice (+0.3%)' without this trigger, and I want it to look like 'Alignment: Nice (plus 0.3%)' or 'Alignment: Nice (plus 0.3 percent).' So I updated the code to reflect what I needed replaced/changed (and changed the command character to reflect the one I've chosen for myself), and this is what it looks like currently:

Code:
 ^TRIGGER {((+*%))} {^SUB {plus %1 percent)}} [Results: Alignment: Nice (plus percent)]


The following variations produce the same result as the first:

Code:

^TRIGGER {((+*.*%))} {^SUB {plus %1.%2 percent)}}
^TRIGGER {((+%d.%d%))} {^SUB {plus %1.%2 percent)}}
^TRIGGER {((~+%d~.%d~%))} {^SUB {plus %1.%2 percent)}}
^TRIGGER {((~+*~.*~%))} {^SUB {plus %1.%2 percent)}}

[Also all of these variations without the spaces between 'plus,' 'percent,' and the % signs/numbers.]


The problem is that it seems not to be recording the information marked by a wildcard to display it.

I'm sure this question has a very simple answer, but I've always been confused about the wildcards, so I can't think of what the problem might be.

(A note: this is part of a rather long and complicated (to me) piece meant to determine whether I should use an action to get my alignment back to neutral or use an action to raise my alignment, but I I've figured out the rest (haven't implemented it yet though). I just need this one thing to work, though technically, I don't even need this. I would just rather code one complicated thing than have ~50 extra triggers based on what the alignment percentage is and whether it's positive or negative. I don't know if this is important or not, but figured I'd mention it.)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Aug 28, 2009 10:04 pm   
 
#trigger {Alignment: +(%d)~%} {#sub {Alignment: Nice ~(plus %1 percent~)}}

%d might not match the decimal. If it doesn't, you can use a range pattern of [0-9.] to cover all numbers with or without a decimal.
_________________
EDIT: I didn't like my old signature
Reply with quote
SalemFuchs
Newbie


Joined: 17 Dec 2006
Posts: 4
Location: Miami, FL

PostPosted: Fri Aug 28, 2009 10:14 pm   
 
Ah, that did the trick perfectly! And I did end up having to use the range. Thank you very much! Smile
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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