|
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Sat Jun 26, 2010 11:39 pm
3.20 multistate triggers |
It seems only the first state of the multistate trigger is ever checked when using within lines at least.. unless my understanding of multistate triggers is incorrect...
Take this 2 state trigger:
Code: |
#CLASS 0
#REGEX slain {^You have slain (.+?)\, retrieving the corpse\.$} {#beep} "" {regex}
#COND {^A (tiny|small|large) pile of sovereigns spills from the corpse\.$} {#echo pickup gold} {Within|Param=2|regex}
#COND {^A (chipped|jagged|smooth) iconic shard appears and clatters to the ground\.$} {#echo pickup shard} {Within|Param=2|regex}
|
My understanding is that once the first main trigger matches, each state is checked sequentially against each of the following lines that appear, and that it will check each state unconditionally of whether one of the other states match...
also side note, this may be deprecated usage or a bug
#TRIG slain {^You have slain (.+?)\, retrieving the corpse\.$} {#beep} "" {regex}
does not set regex property.... as it is in help file...., works fine though in #COND of course
try the two commands, separately, to test it
Code: |
#show You have slain Zugg, retrieving the corpse.%{crlf}A tiny pile of sovereigns spills
#show You have slain Zugg, retrieving the corpse.%{crlf}A chipped iconic shard appears and clatters to the ground.
|
the first cond matches but not the second , if you switch their positions in the editor so shard is the first state, then the shard state works but not the sovereigns |
|
|
|
GeneralStonewall Magician
Joined: 02 Feb 2004 Posts: 364 Location: USA
|
Posted: Sat Jun 26, 2010 11:50 pm |
You misunderstand how multistate triggers work. Trigger states fire sequentially, not in parallel with each other. There are actually 3 states in your trigger: 0, 1, and 2. First state 0 must fire, then 1, and then 2. Unless you use #state or #set, there's no way to go straight from 0 to 2.
Basically, what you need here are two separate triggers:
Code: |
#REGEX slain {^You have slain (.+?)\, retrieving the corpse\.$} {#beep} "" {regex}
#COND {^A (tiny|small|large) pile of sovereigns spills from the corpse\.$} {#echo pickup gold} {Within|Param=2|regex}
#REGEX slain {^You have slain (.+?)\, retrieving the corpse\.$} {#beep} "" {regex}
#COND {^A (chipped|jagged|smooth) iconic shard appears and clatters to the ground\.$} {#echo pickup shard} {Within|Param=2|regex} |
|
|
|
|
dbosst Apprentice
Joined: 15 Jun 2010 Posts: 121
|
Posted: Sun Jun 27, 2010 12:02 am |
I see, thank you for clearing that up.
So, Zugg ignore this bug |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|