|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Tue Jul 01, 2003 4:36 am
Why is this only partially working?? |
I have a trigger, that is supposed to check for text
Phase %d: (*)
to count them, and set the Quest phases to a variable, which it does properly..
then compare the Phases (%2 in this case) to see if it starts with a * in which case it adds 1 to the completed, so it can track the quest phases not done.. which it does NOT do.. here is the trigger..
Code: |
#TRIGGER {^Phase (%d): (%*)} {Phases = %1;Phase = %2;#IF (%1 = 1) {PhasesDone = 0};#IF (@Phase =~ {{~*}*}) { #ADD PhasesDone 1};#IF (@PhasesDone = @Phases) { QuestInfo = Complete} { Questinfo = Phases @PhasesDone~/@Phases}}
|
|
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jul 01, 2003 9:17 am |
As you've probably noticed, your post is wider than one screen. This makes reading it extremely awkward. Please refrain from using
the "code" tags, they seldom add anything of value.
%* is seldom necessary, and certainly isn't in this case. Always use * unless you know why %* is a security risk, know how to guard
against its abuse, and are absolutely certain that * won't provide sufficient matching. Please DON'T suggest %* to others (that includes
not posting triggers which use it). It's only mentioned ONCE in the entire helpfile, it's intended to be obscure.
When asking about triggers, please include samples of the MUDtext they are intended to match.
I redid the whole trigger with the assumption there would be a space between : and *. If that's not true, eliminate that space from the
pattern.
#TR {Phase (%d): (*).} {#VAR Phases %1;#VAR Phase {%2};#IF (%1 = 1) {#VAR PhasesDone 0};#IF %begins( %2, "*") {#VAR PhasesDone %1;#VAR QuestInfo Complete} {#VAR QuestInfo {Phases @PhasesDone/%1}}} |
|
|
|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Tue Jul 01, 2003 2:12 pm |
I did..
Phase 1: This part of the quest ins't complete.
Phase 2: *This part of the quest IS complete.
Zex0s |
|
|
|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Tue Jul 01, 2003 2:22 pm |
Phase 1: Defeat a flesh eating gnat.
Phase 2: *Defeat a verminous rat.
Phase 3: *Visit the head park keeper.
The Trigger is showing this quest as complete..
Phases = %1
Phase = {%2}
#IF (%1 = 1) {PhasesDone = 0}
#IF %begins( @Phase, "*") {
#ADD PhasesDone 1
QuestInfo = Complete
} {QuestInfo = {Phases @PhasesDone/%1} |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Tue Jul 01, 2003 4:37 pm |
Yes, the trigger does show this quest as complete. That's because it was designed on the assumption that the phases would be completed in order. Since your samples show that's not the case, I'll redo it.
#TR {Phase (%d): (*).} {#VAR Phases %1;#VAR Phase {%2};#IF (%1 = 1) {#VAR PhasesDone 0};#IF %begins( %2, "*") {#ADD PhasesDone 1};#IF (@PhasesDone = @Phases) {#VAR QuestInfo Complete} {#VAR QuestInfo {Phases @PhasesDone/@Phases}}} |
|
|
|
zex0s Wanderer
Joined: 29 Jun 2003 Posts: 64
|
Posted: Tue Jul 01, 2003 11:37 pm |
Ah, yea.. thats the ticket.. I kinda figured that out after I realized how much you had modified my original trigger. :)
Thanks lightbulb!
Zex0s |
|
|
|
|
|