Greetings again. I'll continue bothering you with simple questions, if you don't mind.
Say, I need to make a trigger firing on the line:
You attack a (ghost|ghast|spectre).
and sending the matching wildcard to the script procedure, like this:
So you'll see 'You attack a ghost!'. The trigger:
won't work, as it passes ghost as a variable name, not as a string:
Anything I'm missing?
EDIT: Forgot to add: Send to: World and working with world.GetTriggerWildcard isn't it. It must send to Script.
Say, I need to make a trigger firing on the line:
You attack a (ghost|ghast|spectre).
and sending the matching wildcard to the script procedure, like this:
def on_attack(target):
world.Note('You attack a %s!' % target)
So you'll see 'You attack a ghost!'. The trigger:
<trigger
enabled="y"
match="^You attack a (ghost|ghast|spectre)\.$"
regexp="y"
send_to="12"
sequence="100"
>
<send>on_attack(%1)</send>
</trigger>
won't work, as it passes ghost as a variable name, not as a string:
Traceback (most recent call last):
File "<Script Block 64>", line 1, in <module>
on_attack(ghost)
NameError: name 'ghost' is not defined
Anything I'm missing?
EDIT: Forgot to add: Send to: World and working with world.GetTriggerWildcard isn't it. It must send to Script.