Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Calling Events when Failing to Run

This is for XP.

Is there any way I can edit the scripts to make it so that a Common Event is called every time the party fails from escaping a battle?  Where in the scripts would this be and what would I have to edit?

OR, is this something I can easily do with events?  I tried putting it under "Don't Run" in the troop commands with all 3 spans, but that didn't do anything.
 
I wanted to make it use variables.  For example, 10% of the time you'll just see a text box that says "You tried, but you fell and smashed your face on a rock!" Then another 10% of the time it will show a picture, play a sound and wait frames.
 
Okay this is fairly simple, make your common event. Goto the database and goto the troop tab, goto where you would usually input events and set the trigger to if switch(say 255) is on and the span to entire battle, then put a call to the common event in the event dialog. Next, go into the script editor and near the bottom of the update_phase2_escape method you should see (lin 115 in default)
Code:
if success
      # Play escape SE
      $game_system.se_play($data_system.escape_se)
      # Return to BGM before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
    # If escape is failure
    else
      # Clear all party member actions
      $game_party.clear_actions
      # Start main phase
      start_phase4
    end
add      $game_switches 
 
Thank you so much!  It worked!

You forgot to mention it was in Scene_Battle 2, but that's okay, I found it right away.

Also, it only worked once per battle at first, but I fixed that by changing the span to Moment, and having the event turn its switch off after it ran.

Just clearing that up for anyone who stumbles upon this thread and wants this.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top