Nappa
Member
I was toying around with a script idea I had and ended up with the conclusion that a post adventure script would probably be able to do what I wanted (parse some info from each fight). Not having worked with such a script before I decided to make a simple test script to see when and how such a script triggers, but I found out it was also triggering after displaying a zone warning.
The script:
The results: After fighting a battle, it properly listed my winnings. Subsequently I moved to a high level zone where I didn't meet the stat recommendations. However, after the zone warning was loaded, the after adventure script was triggered again and printed the items a second time in the CLI. I don't think that's the intended behavior.
And since this question is related I might as well ask it here: is there a script moment that only triggers after actual combats? That's what I'm actually looking for, because if the post adventure script is also triggered after a (fightless) choice adventure, run_combat() will still hold the same value...
The script:
Code:
void main ()
{
matcher mm = create_matcher( "acquire an item: <b>(.*?)</b>", run_combat() );
if( find( mm ) ) {
print( "Found the following item(s) in your last fight:", "green" );
print( " = " + group( mm, 1 ), "green" );
while( find( mm ) ) {
print( " = " + group( mm, 1 ), "green" );
}
} else {
print( "Last fight, no item for you!","red" );
}
}
The results: After fighting a battle, it properly listed my winnings. Subsequently I moved to a high level zone where I didn't meet the stat recommendations. However, after the zone warning was loaded, the after adventure script was triggered again and printed the items a second time in the CLI. I don't think that's the intended behavior.
And since this question is related I might as well ask it here: is there a script moment that only triggers after actual combats? That's what I'm actually looking for, because if the post adventure script is also triggered after a (fightless) choice adventure, run_combat() will still hold the same value...