|
aedron Beginner
Joined: 29 Nov 2008 Posts: 20
|
Posted: Mon Dec 01, 2008 9:43 pm
Wildcards |
What kind of wildcard should I use when I need to ignore certain things in reflexes?
Eyes gleaming, Narntuk strikes at you with a long, crimson scimitar.
The pattern I've used in Zmud is:
Eyes gleaming, (%w) {strikes|hacks|swings} at you with {a|an}*.
After 'strikes/hacks/swings at you with a/an', the text afterwards can be anything, ranging from different colour weapons to even mutilated bodyparts. Is using the aterisk fine for using it as a wildcard??
Thanks! |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Dec 01, 2008 9:53 pm |
Depends on what you know about the stuff the wildcard needs to represent and how similar the line is to elsewhere in the game messaging. * is fine if you don't care or cannot distinguish the stuff you want to match from stuff you don't want to match, but it is the broadest and therefore the most dangerous wildcard to use.
Keep in mind that we probably don't play your game and likely aren't having to deal with your formatting realities, so the more specific you can get about what will appear the more complex and targeted we can make the wildcards. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
mikeC130 Apprentice
Joined: 03 Jul 2006 Posts: 110
|
Posted: Tue Dec 02, 2008 3:37 am |
Also, if you don't want to capture the trailing text for use in the script, you can leave out the * entirely, unless you need to make sure that the period is in there. Note that without an end marker ($), the period in this case is not necessarily the end of the line. Eliminating the * should speed up your script if you don't need to process the remaining text.
Mike |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Tue Dec 02, 2008 9:57 am |
It won't actually be that much slower because the wildcard is greedy, but yes, it's not needed. Just get rid of the *. entirely.
|
|
|
|
|
|