When does slip/state damage occur in battle?

Discussion in 'RPG Maker VX Ace' started by dinhbat3, Mar 23, 2014.

  1. dinhbat3

    dinhbat3 Veteran Veteran

    Messages:
    184
    Likes Received:
    31
    Location:
    California
    First Language:
    English
    I am currently using Yanfly's Battle Engine WITH Saba Kan's Ao no Kiseki, and have noticed an oddity about damage application and pop ups when a state that drains hp/mp is applied to an actor... The damage is displayed at the start of an actors turn, but isn't applied til the end.

    For a play by play of what I mean:

    1. Turn begins and pop up for -453hp shows

    2. Player enters the action taken by the actor

    3. Actor performs the selected action

    4. The 453hp damage is applied after action has been taken

    Is there any way to have the damage from poison or other hp/mp damaging states occur at the start of a turn when the pop up occurs?
     
    #1
  2. ShadowLurk

    ShadowLurk Tanoshii~ Veteran

    Messages:
    226
    Likes Received:
    53
    I thought I've answered it on the other forum...
     
    #2
  3. dinhbat3

    dinhbat3 Veteran Veteran

    Messages:
    184
    Likes Received:
    31
    Location:
    California
    First Language:
    English
    Ha you did! I actually thought this didn't post... Thought I had posted on the other one originally... so I retyped it over there! It is resolved. Too many tabs open =\ Sorry
     
    #3
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,606
    Likes Received:
    10,513
    First Language:
    English
    Primarily Uses:
    RMVXA
    And which other forum is that?  I'd be interested in knowing the answer to this query.
     
    #4
  5. ShadowLurk

    ShadowLurk Tanoshii~ Veteran

    Messages:
    226
    Likes Received:
    53
    Well, the quick answer is that the @status_window is just not refreshed after applying the slip damage (and regeneration too if I might add).

    To fix this, well, I just called refresh for status window after that regeneration. In Saba Kan's script, regenerations are executed on turn start, so I just add this snippet.

    class Scene_Battle < Scene_Base def start_party_command_selection unless scene_changing? refresh_status @status_window.unselect @status_window.open BattleManager.input_start top_unit = OrderManager.top_unit top_unit.battler.on_turn_start refresh_status @status_window.refresh # <- Added this line. @log_window.display_auto_affected_status(top_unit.battler) @log_window.wait_and_clear next_command end endendThe topic is here.

    refresh_status should also call @status_window.refresh, but Yanfly's script changed it so that the method did nothing.
     
    Last edited by a moderator: Mar 23, 2014
    #5
  6. kerbonklin

    kerbonklin Hiatus King Veteran

    Messages:
    1,728
    Likes Received:
    281
    First Language:
    English
    Primarily Uses:
    RMMV
    Actually all you have to do is fix the on_turn_start and on_turn_end, The script modifies those two and doesn't have what the default engine has, so you have to fill it in. (the state/buff updates, regens, turn count +1, remove state/buff)

    Make it look similar to this (in the first script btw)

    Code:
      #--------------------------------------------------------------------------  # ○ ターン開始処理  #--------------------------------------------------------------------------  def on_turn_start    regenerate_all    make_actions  end  #--------------------------------------------------------------------------  # ● ターン終了処理  #--------------------------------------------------------------------------  def on_turn_end    @result.clear    update_state_turns    update_buff_turns    remove_states_auto(2)    remove_buffs_auto    @turn_count += 1  end  #--------------------------------------------------------------------------  # ● 戦闘行動終了時の処理  #--------------------------------------------------------------------------  def on_action_end    @result.clear  end
     
    Last edited by a moderator: Mar 23, 2014
    #6
  7. ShadowLurk

    ShadowLurk Tanoshii~ Veteran

    Messages:
    226
    Likes Received:
    53
    You kinda misunderstand the problem. the slip damage IS applied, but it is not redrawn.

    The script does not refresh the Battle Scene's @status_window.
     

    It is because Yanfly overwrote refresh_status.

    The original refresh_status method is like this:
     
    def refresh_status
      @status_window.refresh
    end
     
    Yanfly overwrote it to become this.
     
    def refresh_status; return; end
     

    There is a method from Yanfly Battle Engine that lets you redraw only the current battler's status, it is redraw_current_status.

    def redraw_current_status return if @status_window.index < 0 @status_window.draw_item(@status_window.index) endSo you could also just replace the refresh_status in start_party_command_selection to redraw_current_status.
     
    #7
  8. kerbonklin

    kerbonklin Hiatus King Veteran

    Messages:
    1,728
    Likes Received:
    281
    First Language:
    English
    Primarily Uses:
    RMMV
    Well that explains why I never had that problem before.
     
    #8

Share This Page