Run an Event after a Random Encounter Battle is Won

Hello again everyone!

I was wondering if it's possible to use the eventing process to run an event after a random encounter battle is won.

Basically I'd like it to work like this:

Battle with Slime is encountered.

After battle ends, a point based extra loot roll (which I've begun programming) runs.

If I recall correctly, autorun events don't run again after a battle. So I've been stumped on how I might accomplish this, and the forums don't have much on this as far as I've searched.

Any help with this?

Thanks!
Make a parallel process common event conditioned on a switch "after battle".


Inside the event, do whatever you want to happen after battle and as the last command, switch OFF the switch "after battle".


In any troop that needs the event, make a troop event turn ON the switch "after battle" at turn zero.
Make a parallel process common event conditioned on a switch "after battle".

Inside the event, do whatever you want to happen after battle and as the last command, switch OFF the switch "after battle".

In any troop that needs the event, make a troop event turn ON the switch "after battle" at turn zero.
Will this run the event regardless of outcome, though?
yes - but if you lost a random battle, it'll be game over automatically.


The only problem might be differing between winning and escaping.
yes - but if you lost a random battle, it'll be game over automatically.

The only problem might be differing between winning and escaping.
i should be able to bypass that though. Is there possibly a script I could use in a script call to detect at the start of any given turn that the escape command is selected?
I believe you are looking for something like this?

http://forums.rpgmakerweb.com/index.php?/topic/44537-tutorial-%E5%A7%ABhime%E2%80%99s-end-phase-trigger-script/
Does this script allow for an event to be run if the player specifically escapes? In order to prevent cheaters from loot farming by running away I need to have an event deplete the points variables to nothing.
I am sure it does.
Alright thanks, I'll check it out
Actually, I am not too sure why you are too too worried about player escaping. 

I am guessing that you are worried about people escaping fights when they run into something like a slime + a bat troop? (killing the slime and then escaping the bat)

Hime's script will definitely allow the execution of troop event even after the last monster is killed, so all you really need to do is to have an event page that checks if the monster's HP is at 0% or below. Then award the player with the appropriate reward (quest kill credit or quest drop) and you don't have to worry about anything else.

Below is what I did in a troop event for a monster that is part of 2 different quests.

161yzat.jpg


For the top conditional branch:
If the Hydra dies while the kill quest is active, +1 to the quest item count (I should have used a different variable just in case the player has multiple quests running at the same time)

if quest item count variable is equals to 3, then mark the quest objective as complete (my quest requires players to slay 3 hydras) 

Don't worry about "Script: complete_objective(2,0)". I am using modern algebra's script to handle quests.

For the bottom condition branch

If the Hydra dies while player has the item drop quest active, I used a variable called the RNG drop to generate a number between 1 and 5.

If the value generated by RNG drop variable is equal to 5, then display the message "You found a ____" and update the quest item count variable.

I always reset the counter whenever the player hand in the quest.
My method works a bit differently.

When battling any enemy troop, the player starts out with a certain number of Time Points. These points are meant to be reduced by a certain amount every turn, unless the battle is meant to be a wave battle.

This way, the quicker you defeat a battle of single wave enemies, the higher your score is.

You also earn points from killing enemies and extra points for your remaining HP after the battle.

My reason for needing this escape script is I need something to cancel out the points. If I dont, players who simply escape at the start of a random encounter will recieve an unhindered time bonus and a full HP bonus. 

I've got all the points set up of course, but this could cause cheaters to get good loot after every battle without actually acing a battle.

Also, I'm a bit confused about how to properly do this. I see that the script checks for the abort, but how do I create a conditional branch for that abort that will set a variable to zero or switch off a switch?
Just double checked, unfortunately hime's script does not deal with player escaping since the escape processing prevents the battle scene from updating events. Sorry.
Does anything else possibly have this effect? I may be able to work around it if not
I can't think of a good evented solution, but if you want something to run when victory occurs you can use this script, which runs events depending on whether you win or lose.
I am not sure how your program your troop event, but I found a solution... I hope LOL


Page 1: At the start of battle (condition = turn 0), set the variable "time points" to 50000 (50000 is just an example)
Page 2: Deduct 500 points from the variable "time points" at the end of each turn
Page 3: If the monster's HP is at 0% or less, then check for the following conditions:

  • If points >= 40000, give player epic loot, else if
  • If points >= 30000, give player not-so-epic loot, else if
  • If points >= 20000, give player the consolation prize
You can do something similar with player's HP too..

Seems to be working fine with Hime's End phase battle. That way if the player actually escape from battle, the condition on Page 3 will not be fulfilled and the player cant cheat the system to get epic loot. Refer to the image below:

xmn2hx.jpg


Edit: Aesthetic reasons
This could work very well! I'll get back to you with the results
Make a parallel process common event conditioned on a switch "after battle".


Inside the event, do whatever you want to happen after battle and as the last command, switch OFF the switch "after battle".


In any troop that needs the event, make a troop event turn ON the switch "after battle" at turn zero.
I have a similar situation as DomTSVG, but how do you make an event fire after a certain turn? There isn't an overt way to do this.
but how do you make an event fire after a certain turn?
if the event should run after battle, that doesn't matter.
and if the event should run during battle, your situation is very different from the OP problem.
better make a new topic describing in detail what you want instead of hijacking and necroposting
Necro-post notice: @Broliant112

Your question is not related to the OP's. Please make your own thread.

Original thread: https://forums.rpgmakerweb.com/threads/run-an-event-after-a-random-encounter-battle-is-won.44539/