|
vortis Novice
Joined: 15 Jul 2010 Posts: 39 Location: USA
|
Posted: Thu May 07, 2015 4:38 am
SOLVED: Should be easy, help with a simple trigger |
So, I have an issue trying to make a trigger to sort on a bad, average, or good item that my character crafts. Here is the MUD output:
You finish sawing, leaving you with a crude short pine plank.
There are a LOT of possible variations on this line specific to the quality (crude), type (short), wood (pine) and end item (plank)
I can make a few triggers to capture each possible output or categories of outputs like one to capture all the bad quality items and add a simple 'trash item' action,
You finish sawing, leaving you with {a|an} {malformed|crude} {short|long|curved} {pine|oak|maple} plank.
and another one to capture all the good quality items,
You finish sawing, leaving you with {a|an} {exceptional|masterful} %1 {pine|oak|} plank.
but my issue is an average item won't even have crude/malformed/exceptional/masterful and will just be:
You finish sawing, leaving you with a short pine plank.
so how do I capture on that to find out if it is average?
I tried this:
You finish sawing, leaving you with {a|an} %1 {pine|oak|} plank.
but anything with a modifier also gets captured inside the %1.
Help? :/ |
|
Last edited by vortis on Thu May 07, 2015 10:46 pm; edited 1 time in total |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Thu May 07, 2015 12:35 pm |
Quote: |
I tried this:
You finish sawing, leaving you with {a|an} %1 {pine|oak|} plank.
but anything with a modifier also gets captured inside the %1. |
Wouldn't you just want "You finish sawing, leaving you with {a|an} {pine|oak|} plank." if there's no word in between? You don't need a capture if you're not expecting anything there.
Alternatively, a better solution would probably be to just use a single trigger, capture the quality, type, wood and end item, then do whatever processing needs to be done based on the values in the capture (#if (%1 ="exceptional" or %1 = "masterful") {do something}, etc etc). |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu May 07, 2015 12:45 pm |
Code: |
#TRIGGER {You finish sawing, leaving you with {a|an} ({malformed|crude|exceptional|masterful|})* plank.} {#IF (%1="") {#SHOW Average}} |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
vortis Novice
Joined: 15 Jul 2010 Posts: 39 Location: USA
|
Posted: Thu May 07, 2015 10:45 pm |
#TRIGGER {You finish sawing, leaving you with {a|an} ({malformed|crude|exceptional|masterful|})* plank.} {#IF (%1="") {#SHOW Average}}
Works Great, Thanks! |
|
|
|
|
|
|
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
|
|