Facebook Twitter Gplus LinkedIn RSS
Home » Blog » Adding an Escape Penalty in RPG Maker VX Ace

Adding an Escape Penalty in RPG Maker VX Ace

Published on September 7th, 2013

As previously mentioned, I’ve been building an RPG using RPG Maker VX Ace and its underlining Ruby Gaming Scripting System 3 (RGSS3) framework to build “Sprawl’s Quest“.

One thing I always hate in the old school RPG was how easy it was to flee from combat to skip ahead of content. So in Sprawl’s Quest, I decided to add an XP Penalty for Escaping from battle.


As with all RPG Maker VX Ace scripts, place this in the Materials section. There shouldn’t be an compatibility issues since I am just subtracting some XP on a successful flee from battle.

 Title: Escape_Penalty
 Author: Sprawl
 Date: August 15, 2013
 ** Change log
 August 15, 2013
   - Initial Release
 ** Description
This script adds an escape penalty equal to 0.5% of the total
XP per actor.
 ** Usage
Cut and Paste in the Materials Section. If you have any other 
scripts that affect escape penalties, things may not work.
 ** Licensing 

Feel free to use for free or commercial use, but give credit 
to "zSprawl".

 ** Credits
    -Wrote the Script.
    -Replied to my post on the forums to get me motivated 
to fix this.

$imported = {} if $imported.nil?
$imported["Sprawl_Escape"] = true

module BattleManager
  def self.process_abort
    $game_party.all_members.each do |actor|
      @exp_loss = -1 * actor.exp * 0.005;
    @xp_loss_str = @exp_loss * -1
    text = "You lose " + @xp_loss_str.to_i.to_s
    text = text + " experience points for fleeing."
    $game_message.add('\.' + text)
    return true

About the Author: Sprawl

Stephen Russell is a Mobile App developer and all around IT geek that spends his days running data centers and his nights coding. This site is the go to place for all of zSprawl's work and the infamous development blog. In his free time, he enjoys tinkering with web code, playing video games, and otherwise plotting to take over the Internets.


Leave a Reply

Your email address will not be published. Required fields are marked *

© 2012 zSprawl's zApps

Fork me on GitHub