Port: ** TDS Battle Common Events

I'm really in need of this to solve half of my design crisis. Please help me!. It is written for VX.

I found the original script here @ (rmrk thread)

Spoiler containing the script:

Spoiler
Code:
#==============================================================================# ** TDS Battle Common Events#    ver : 1.0#------------------------------------------------------------------------------#  Description :#    This script is used to run common events before and after battle.#==============================================================================  #--------------------------------------------------------------------------  # * Constants  #--------------------------------------------------------------------------  # Common Event ID to run before a battle starts  BEFORE_BATTLE_C_EVENT_ID = 1  # Common Event ID to run after a battle ends (Win, Escape, Lose) 0 for nothing  AFTER_BATTLE_C_EVENTS_ID = [2, 0, 2]  #==============================================================================# ** Scene_Map#------------------------------------------------------------------------------#  This class performs the map screen processing.#==============================================================================class Scene_Map < Scene_Base  #--------------------------------------------------------------------------  # * Alias Listing  #--------------------------------------------------------------------------    alias tds_battle_common_events_scene_map_call_battle     call_battle    #--------------------------------------------------------------------------  # * Switch to Battle Screen  #--------------------------------------------------------------------------  def call_battle          # Run Original Method    tds_battle_common_events_scene_map_call_battle    # Call a battle common event    $game_map.interpreter.battle_common_event(BEFORE_BATTLE_C_EVENT_ID)        # Update Game Map Interpreter    $game_map.interpreter.update      endend#==============================================================================# ** Scene_Battle#------------------------------------------------------------------------------#  This class performs battle screen processing.#==============================================================================class Scene_Battle < Scene_Base  #--------------------------------------------------------------------------  # * Alias Listing  #--------------------------------------------------------------------------    alias tds_battle_common_events_scene_battle_battle_end     battle_end    #--------------------------------------------------------------------------  # * End Battle  #     result : Results (0: win, 1: escape, 2:lose)  #--------------------------------------------------------------------------  def battle_end(result)    # Run Original Method    tds_battle_common_events_scene_battle_battle_end(result)    # If After Battle Common Event ID is not 0    if AFTER_BATTLE_C_EVENTS_ID[result] != 0      # Call a battle common event      $game_map.interpreter.battle_common_event(AFTER_BATTLE_C_EVENTS_ID[result])      # Update Game Map Interpreter      $game_map.interpreter.update        end      end  end#==============================================================================# ** Game_Interpreter#------------------------------------------------------------------------------#  An interpreter for executing event commands. This class is used within the# Game_Map, Game_Troop, and Game_Event classes.#==============================================================================class Game_Interpreter  #--------------------------------------------------------------------------  # * Call Battle Common Event  #--------------------------------------------------------------------------  def battle_common_event(id)    common_event = $data_common_events[id]    if common_event != nil      @child_interpreter = Game_Interpreter.new(@depth + 1)      @child_interpreter.setup(common_event.list, @event_id)    end    return true  endend
1) You don't need a script to call a common event before a battle - in Ace, the turn 0 has nothing in it, so a battle event set to be started on turn 0 only can call your common event.


2) there are already several ways to make a common event run automatically after battle, depending on what you want to do exactly.


I suggest making that after-battle-event into a parallel process conditioned to a switch, switching itself off after a single run of all commands. then you place a command "switch ON" into the turn zero troop event. finished.


(parallel process events are stopped during battle, so the switch ON on turn zero will result in the parallel process starting directly after the battle, and since you switch it off after the commands it will not loop during map...)
You should be able to call common events on turn zero.


For after battle processing, this is an option


event_postbattle1.gif



http://himeworks.wordpress.com/2013/05/12/post-battle-events/


It supports victory and defeat event processing.


This script is low in compatibility due to the way the default battle logic is designed, so if things aren't working properly, you should read the section on compatibility on the blog post.
I checked that and worked (never tought that 0-0 turn would actually run even before the battler are drawn). So after your explanation I'm going to test Base Troop Events. I need this for changing the face graphic of my actors when they enter and leave battle (yes, they use a different one there and since I'm using Ace Battle Engine this would be a must have).

I'm not very clear about the part of the after battle parallel process, specially on the results of that when doing $btest, so I will check Tsukihime option too.

Thank you guys!
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/port-tds-battle-common-events.22259/