Aerotan2008-06-04 12:41:01
I'm attempting to set up a trigger that will fire when someone says "Target ting"
What I have is
Pattern: Target %w.
Value: x %w
With x being a preexisting alias I use to manually target things.
Name: x
Value:
target = %1
#echo %1 targeted!
Now, the problem with the thing at the moment is that if, for instance, someone says "Target Halibut."
It triggers, but the value of the target variable changes to %w instead of Halibut.
I had the trigger almost working before without the period, but, of course, it simply added the period to target, so wouldn't work to target things.
My question is: A) Is there a way to get %w to correctly function as a temporary variable, or Is there a way to get zMud to strip the period?
What I have is
Pattern: Target %w.
Value: x %w
With x being a preexisting alias I use to manually target things.
Name: x
Value:
target = %1
#echo %1 targeted!
Now, the problem with the thing at the moment is that if, for instance, someone says "Target Halibut."
It triggers, but the value of the target variable changes to %w instead of Halibut.
I had the trigger almost working before without the period, but, of course, it simply added the period to target, so wouldn't work to target things.
My question is: A) Is there a way to get %w to correctly function as a temporary variable, or Is there a way to get zMud to strip the period?
Vathael2008-06-04 12:56:52
change the x %w to x %1 in the trig
Catarin2008-06-04 13:01:28
Are you using () around your %w in the trigger pattern? I'm more familiar with cmud than zmud now but wasn't aware that anything would actually be captured without that ().
Unknown2008-06-04 13:04:00
And put parentheses around the %w in the pattern. Without parentheses it will match, but it will not capture it into the %1 variable.
Pattern: Target (%w).
Value: x %1
Note: You should use a more stringent pattern to keep this from matching erroneously. As it is now, it will match whenever "Target blah" shows up anywhere, and it could even get you into a trigger loop if you use the wrong sort of echo message.
Pattern: Target (%w).
Value: x %1
Note: You should use a more stringent pattern to keep this from matching erroneously. As it is now, it will match whenever "Target blah" shows up anywhere, and it could even get you into a trigger loop if you use the wrong sort of echo message.
Aerotan2008-06-04 14:46:49
Thanks! For now I'm just looking to do something basic, as I'd need to get at least one community into the habit of issuing commands like that the same, so something simple is good.
The only real reason I have this, to be honest, is to set targets for, for instance, Aetherspace, when there's FAR too much spam to reliably catch a given target manually.
EDIT: Ideally, I'd try to get the leader of the group to call out something not commonly used, but easy to remember, like "AIM FOR" Or something, but until I can fool coordinate the city into doing something like that, I'm using "Target As the default. I suppose, if I wanted to make it purely for aetherspace, I could change it to
Pattern: (ship) %w says, "Target (%w)."
Value: x %2
But I'd rather not limit it like that just yet.
The only real reason I have this, to be honest, is to set targets for, for instance, Aetherspace, when there's FAR too much spam to reliably catch a given target manually.
EDIT: Ideally, I'd try to get the leader of the group to call out something not commonly used, but easy to remember, like "AIM FOR
Pattern: (ship) %w says, "Target (%w)."
Value: x %2
But I'd rather not limit it like that just yet.
Unknown2008-06-04 16:10:32
QUOTE(Aerotan @ Jun 4 2008, 10:46 AM) 518026
Thanks! For now I'm just looking to do something basic, as I'd need to get at least one community into the habit of issuing commands like that the same, so something simple is good.
The only real reason I have this, to be honest, is to set targets for, for instance, Aetherspace, when there's FAR too much spam to reliably catch a given target manually.
EDIT: Ideally, I'd try to get the leader of the group to call out something not commonly used, but easy to remember, like "AIM FOR" Or something, but until I can fool coordinate the city into doing something like that, I'm using "Target As the default. I suppose, if I wanted to make it purely for aetherspace, I could change it to
Pattern: (ship) %w says, "Target (%w)."
Value: x %2
But I'd rather not limit it like that just yet.
The only real reason I have this, to be honest, is to set targets for, for instance, Aetherspace, when there's FAR too much spam to reliably catch a given target manually.
EDIT: Ideally, I'd try to get the leader of the group to call out something not commonly used, but easy to remember, like "AIM FOR
Pattern: (ship) %w says, "Target (%w)."
Value: x %2
But I'd rather not limit it like that just yet.
This is potentially problematic for a couple of reasons.
1) The ship may be out of range, and you won't target the ship or creature.
2) Your system has no way to tell if you're being told to target a ship or a creature.
Therefore, you'd need to rely on your pilot to say Target Ship (whatever).
However, you could always set it to be:
Pattern: (Ship): * says, "Target (%w)
Value: @spacetar = %1
At this point, you have a couple of choices.
You could make two aliases, requiring you to *gasp* actually work.
If you wanted to do this, you could do:
Pattern: ttc
Value: turret target creature @spacetar
Pattern: tts
Value: turret target ship @spacetar
In which case, all you'll be doing is typing ttc or tts.
Though, I'm sure there's some sort of nifty if-or pattern you could you to have it be something like you're told to target something, and then if the target is NOT a creature in a stored variable or something, you'd do tts, opposed to ttc. Or something.
Unknown2008-06-04 16:23:50
Do not do @spacetar = %1. Either use spacetar = %1 or #VAR spacetar %1. You use the @ prefix when you want to reference the contents of the variable.
Unknown2008-06-04 16:29:10
QUOTE(Zarquan @ Jun 4 2008, 12:23 PM) 518035
Do not do @spacetar = %1. Either use spacetar = %1 or #VAR spacetar %1. You use the @ prefix when you want to reference the contents of the variable.
Woops! >__<
I'm still not great at creating triggers. But I had the basic idea?
Aerotan2008-06-05 04:59:20
Actually I tend to favor spillthrough keybindings.
So, for instance, the combateer has a keybinding that looks like
Keybinding
Name: F12
Value:
tts @target
ttc @target
Alias
Name: ttc
Value: Turret Target Creature %1
Name: tts
Value: Turret Target Ship %1
in addition to all the other things.
At some point I may look into setting it up so that if there is no argument provided it uses @target, provided either by the x alias mentioned earlier or the targeting trigger.
So, for instance, the combateer has a keybinding that looks like
Keybinding
Name: F12
Value:
tts @target
ttc @target
Alias
Name: ttc
Value: Turret Target Creature %1
Name: tts
Value: Turret Target Ship %1
in addition to all the other things.
At some point I may look into setting it up so that if there is no argument provided it uses @target, provided either by the x alias mentioned earlier or the targeting trigger.