Grade Victory Screen

Only Hime's post battle events has that (the line with the comment is what I added in Neon Black's script, as per Hime's instructions, to make the post battle event happen).

This is what it looks like in Hime's script:

hime victory.png
Well depending on where you have your scripts. One will overwrite the other so if that is below the grade script then the grade script will not work.
If you move it below will it work (and add in that one line)
Ruby:
  ## Overwritten for the new victory screen.
  def process_victory
    return if @victory; @victory = true
    $game_system.battle_end_me.play if CP::VICTORY::USE_ME && !skip?
    RPG::BGM.fade(500) unless skip? || CP::VICTORY::USE_ME
    20.times do; Graphics.update; end
    SceneManager.scene.close_status_window
    Audio.return_audio if $imported["CP_CROSSFADE"]
    play_battle_end_me unless skip?  ## Skip the bgm change again.
    @phase = :victory
    SceneManager.scene.show_victory_windows
    exp = gain_exp
    process_post_victory_event # --- added in
    gold = gain_gold
    gain_drop_items
    turns = $game_troop.turn_count
    dlt = Grade.score_items[:damage].dealt
    rcv = Grade.score_items[:damage].recieved
    SceneManager.scene.update_scores(dlt, rcv, turns)
    SceneManager.scene.update_window_rates(exp, gold, Grade.rate[4])
    SceneManager.scene.exp_window_update(exp)
    return true
  end
That seems to be working! But I am very confused about why. You inserted the process_post_victory_event line in process_victory, while I put it in the victory_end part of NB's script (to match Hime's instructions - it's removed now). Is that all that was needed? There isn't even any post victory event in the battle I had problems with... Well, whatever did it, I hope it will last. Thank you very much :LZScat:


(Just a note, I always had NB's script below Hime's)
I put it in the victory_end part
The image you shared showed it to be in the process_victory method. So I figured that's where it needed to be.

The proplem is basically that both scripts are overwriting the method so if all the 'unique' processes for one script is skipped, then it will likely cause problems. The simple answer is to add in those 'unique' method calls, whatever they would be.
Since the method calls are now 'called' then one of the scripts is not doing what it was meant to do and sometimes that can cause the script to hang, as you found, because part of the script is waiting for another part to do something but since it was skipped, it never finishes.
I have another problem. I noticed it happen a couple of times before the change we made, but didn't think much of it, since it wasn't game-breaking. However, today after it happened, it exited the game (but this does not happen every time), so I thought I'll try to ask here for help again.

Now this is happening in a project without Hime's script, and no other scripts deal with end of battle, so it has to be something in this one.

So when the last enemy dies, and there is still someone who should be taking action, they do so below the victory screen. For example, one actor attacks and the other is supposed to heal. The attack kills the enemy, victory screen comes up, but the other actor still heals. So the battle behaves as if it wasn't over. Usually it doesn't matter, button is pressed, victory screen goes away, scene changes. But sometimes button press does nothing and if pressed more times, the game window just closes.

I don't know enough about battle processing and where/how actions are stopped after enemies are dead, so I'm not able to find on my own where the problem could be. Any ideas?
Try changing a little in the victory grade script.
If this doesn't work I will need to work with your project with all the scripts so I can find the issue.
Victory Grade line 720 def update
change the line after super
if BattleManager.in_turn? && !BattleManager.victory_phase?
then comment out BattleManager.judge_win_loss unless BattleManager.victory_phase?
Got it after testing your situation
The victory process is called a total of three times (printing text on screen to test)
but at the first point the phase is still :turn
I added in a few lines and it was fixed.
Basically changing the phase when the enemy is all dead and clearing actions. Not sure if that part is needed, but couldn't hurt.
Here is the modified process_victory method
Ruby:
  ## Overwritten for the new victory screen.
  def process_victory
    if $game_troop.all_dead?
      @phase = :victory
    end
    if BattleManager.victory_phase? || $game_troop.all_dead?
      $game_party.battle_members.each do |actor|
        actor.clear_actions
      end
    end
    return if @victory; @victory = true
    $game_system.battle_end_me.play if CP::VICTORY::USE_ME && !skip?
    RPG::BGM.fade(500) unless skip? || CP::VICTORY::USE_ME
    20.times do; Graphics.update; end
    SceneManager.scene.close_status_window
    Audio.return_audio if $imported["CP_CROSSFADE"]
    play_battle_end_me unless skip?  ## Skip the bgm change again.
    @phase = :victory
    SceneManager.scene.show_victory_windows
    exp = gain_exp
    gold = gain_gold
    gain_drop_items
    turns = $game_troop.turn_count
    dlt = Grade.score_items[:damage].dealt
    rcv = Grade.score_items[:damage].recieved
    SceneManager.scene.update_scores(dlt, rcv, turns)
    SceneManager.scene.update_window_rates(exp, gold, Grade.rate[4])
    SceneManager.scene.exp_window_update(exp)
    return true
  end
OK, I'm officially building a shrine to Roninator2 and will bring offerings every day. It works! Thank you so much.

Original thread: https://forums.rpgmakerweb.com/threads/grade-victory-screen.3439/