 |
Kaputchnik Beginner
Joined: 06 Jan 2002 Posts: 28 Location: Sweden
|
Posted: Sun Jan 06, 2002 3:40 am
Text trigger and #sub |
This is my problem I want to create a trigger that adds a percentage number after I see a npc/pc condition, since there are several conditions for different levels of full health.
The output is:
He is in excellent condition.
I want the trigger to add a 100% after excellent condition, but the trigger I've created doesn't seem to work properly.
This is what I got:
trigger :{He|She|It} is (%w*)
command:
#if {"%1"=~"in excellent condition."} {#sub {"%1"} {{"%1"} "100%"}}
If I get this one correct I can surely finish the others by myself.
Regards,
Kaputchnik |
|
|
 |
Troubadour GURU
Joined: 14 Oct 2000 Posts: 556 Location: USA
|
Posted: Sun Jan 06, 2002 4:43 am |
#SUBSTITUTE can be a real pain in the butt.
This is a version I got working:
Pattern: ({He|She|It}) is (*)
Notice that it captures the pronoun as well as the object phrase.
Action: #IF ("%2" = "in excellent condition.") {#SUB {%1 is in excellent condition. 100%}}
Troubadour  |
|
|
 |
|
|