Button to end battle

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
This is a very simple script. To explain, that is. When the player pushes a certain button (let's say R), the turn ends immediately and the party attempts to flee from the battle.
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
If you read this and think it's too complicated, I'd appreciate details on why. Thank you in advance.
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
Bump bump oh yeah bump it all up baby.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I think the issue is why is it needed? The escape button that is there by default does this already. So why is that not enough? What is this doing that the escape button isn't? Maybe clarify that, as that may help gather interest in someone taking this request.
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
Well, I've run multiple times into an issue in my game.

In this game, you don't destroy 200 hordes of meaningless enemies every half hour. Instead, you take a very careful approach to every single battle, try different things to see what works best, and eventually defeat. You will die multiple times against each enemy, but this is not defeat, it's part of the process of winning. Accordingly, dying has no consequence other than restarting the fight. Accordingly, too, if the player realises what he's doing isn't going to work, I let him escape with no consequences.

Some enemies will inflict sleep on the player party every turn. Every time they wake up, they will be attacked by the enemy again and fall asleep. This means that once the enemy attacks, the player will be unable to do anything. In other words, they've lost the battle. This is done to teach the player that some enemies must be dealt with instantly or they will screw you up for good.

The problem is, if there are no damaging enemies on the battle, the player won't die or win. They'll be stuck in an endless loop of falling asleep until the enemies run out of Mana. And as fun as that is to watch, it would be really nice to let them escape once they are in that position. I've tried eventing this through multiple ways, but nothing seems to work. So if someone can help, I would be extremely grateful.
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
Once you pump you can't stop.
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
If you read this and think it's too complicated, I'd appreciate details on why. Thank you in advance.
Reminder.
 

TakeHomeTheCup

Veteran
Veteran
Joined
Oct 15, 2013
Messages
244
Reaction score
460
First Language
English
Primarily Uses
So the player presses a button and the party attempts to flee? Not successfully flee automatically?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Idk if you still need this desperately, but here you go
Code:
#==============================================================================
# TheoAllen - Force Abort Battle
# Version : -
#------------------------------------------------------------------------------
# You press a button, you escaped on next turn
#==============================================================================

Abort_Input = :F6

class Scene_Battle
 
  alias theo_abort_battle_start start
  def start
    theo_abort_battle_start
    @aborting = false
  end
 
  alias theo_abort_battle_start_party start_party_command_selection
  def start_party_command_selection
    if @aborting
      BattleManager.process_abort
      return
    end
    theo_abort_battle_start_party
  end
 
  alias theo_abort_battle_update_wait update_for_wait
  def update_for_wait
    @aborting = true if Input.trigger?(Abort_Input)
    theo_abort_battle_update_wait
  end
 
end
 

xdan

Veteran
Veteran
Joined
Aug 21, 2016
Messages
158
Reaction score
59
First Language
Spanish
Primarily Uses
So the player presses a button and the party attempts to flee? Not successfully flee automatically?
All attempts to flee are successfull in my game, so it's the same thing. Whatever's easier to do.

Idk if you still need this desperately, but here you go
Code:
#==============================================================================
# TheoAllen - Force Abort Battle
# Version : -
#------------------------------------------------------------------------------
# You press a button, you escaped on next turn
#==============================================================================

Abort_Input = :F6

class Scene_Battle
 
  alias theo_abort_battle_start start
  def start
    theo_abort_battle_start
    @aborting = false
  end
 
  alias theo_abort_battle_start_party start_party_command_selection
  def start_party_command_selection
    if @aborting
      BattleManager.process_abort
      return
    end
    theo_abort_battle_start_party
  end
 
  alias theo_abort_battle_update_wait update_for_wait
  def update_for_wait
    @aborting = true if Input.trigger?(Abort_Input)
    theo_abort_battle_update_wait
  end
 
end
It worked perfectly! Thank you so much.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top