Yanfly Victory Aftermath & Victor Materia System compatibility request

Hey there.

After combat, you don't gain AP for materias if you have the Victory Aftermath script. This is obviously a big deal, because games look much better with this script.

So what I'm requesting here is for someone to make a compatibility patch for them.

Victory Aftermath: https://yanflychannel.wordpress.com/rmvxa/battle-scripts/victory-aftermath/

Materia System: https://drive.google.com/folderview?id=0B5uvwXLAev89ZTVQRTd2T0EwQlk&usp=sharing

Thanks in advance!
I just started using these scripts also and ran into this issue. would love to see a solution for it.
This'll do the trick. Please let me know if something should be different.

Spoiler
Code:
#==============================================================================# # ◆ Karanum's Materia & Victory Aftermath Compatibility Patch# -- Last Updated: 2015.08.19# -- Requires:  * Victor Engine - Materia System#               * Yanfly Engine Ace - Victory Aftermath# #==============================================================================$imported = {} if $imported.nil?$imported["Karanum_Materia_Patch"] = true#==============================================================================# ◆ Updates# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# 2015.08.15 - Initial script release.# 2015.08.19 - Added fix for decimal materia growth rates# #==============================================================================# ◆ Introduction# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# Created by request, this script patches the compatibility issues between# Victor Sant's Materia System and Yanfly's Victory Aftermath scripts.## This compatibility patch fixes the issue where no AP would be gained if the# scripts were in the wrong order, and also adds an extra bit of info to the# aftermath screen showing how much AP has been obtained.##==============================================================================# ◆ Instructions# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# To install this script, open the script editor and paste this script into an# empty slot below Materials and above Main.# # Make sure that it is below both the Materia and the Aftermath scripts!##==============================================================================# ◆ Compatibility# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script overrides some functionality of the Materia System script.# Expansions of the Materia System script might not work as intended, though# the chance of this being an issue is very low.##==============================================================================# ◆ Terms of Use# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This script may be used freely without explicit permission by the creator.# Giving credit when using this script is preferred but not required.#==============================================================================module YEA  module VICTORY_AFTERMATH            VICTORY_AP = "+%sAP"    # Line format for the AP gain                             # (%s becomes the amount of AP in-game)                         endend#==============================================================================# >> WARNING << - Editing anything past this point may result in the script #                 crashing your game or doing unexpected things.#==============================================================================if $imported[:ve_materia_system] thenif $imported["YEA-VictoryAftermath"] then#==============================================================================# BattleManager#==============================================================================module BattleManager  class << self    alias bman_display_exp_materiapatch display_exp  end    def self.display_exp    bman_display_exp_materiapatch    return if $game_troop.ap_total == 0    $game_party.all_members.each {|actor| actor.ap += $game_troop.ap_total }  end    def self.display_ap  endend#==============================================================================# Window_VictoryEXP_Back#==============================================================================class Window_VictoryEXP_Back < Window_Selectable  alias wvictory_draw_item_materiapatch draw_item  def draw_item(index)    wvictory_draw_item_materiapatch(index)    rect = item_rect(index)    draw_ap_gain(rect)  end    def draw_ap_gain(rect)    return if $game_troop.ap_total == 0    line_num = ($imported["YEA-JPManager"] ? 5 : 4)    dw = rect.width - (rect.width - [rect.width, 96].min) / 2    dy = rect.y + line_height * line_num + 96    fmt = YEA::VICTORY_AFTERMATH::VICTORY_AP    text = sprintf(fmt, $game_troop.ap_total)    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP    change_color(power_up_color)    draw_text(rect.x, dy, dw, line_height, text, 2)  endend    end #if $imported["YEA-VictoryAftermath"]#==============================================================================# RPG::EquipItem#==============================================================================class RPG::EquipItem < RPG::BaseItem  def growth    return @growth if @growth    @growth = note =~ /<MATERIA GROWTH: ((?:\d+)(?:\.\d+)?)>/i ? $1.to_f : 1  endendend #if $imported[:ve_materia_system] 
Thank you so much, Karanum! It works perfectly!
This seems to have the same problem as another fix I tried somewhere in the Materia System thread. The end Victory Aftermath shows +2AP (I'm guessing the AP reward for an individual Slime) however the troop has 2 Slimes and I actually gain 4 AP. I also tested it by increasing the XP, it says I gain 4AP and then I actually gain 8AP.

This was regardless of the weapon growth my equipped weapon had, so I'm not even sure if Weapon Growth actually works at all. I set the growth as high as 10 with no noticable effect. Do you think you could look into that?
This seems to have the same problem as another fix I tried somewhere in the Materia System thread. The end Victory Aftermath shows +2AP (I'm guessing the AP reward for an individual Slime) however the troop has 2 Slimes and I actually gain 4 AP. I also tested it by increasing the XP, it says I gain 4AP and then I actually gain 8AP.

This was regardless of the weapon growth my equipped weapon had, so I'm not even sure if Weapon Growth actually works at all. I set the growth as high as 10 with no noticable effect. Do you think you could look into that?
I've tried several things, but every time the AP gain display was correct for me. I would suggest double-checking your tags, maybe you missed something. If that still doesn't help, check your scripts. Make sure the fix is below the Materia and Aftermath scripts. This might be a bit of a stretch, but make sure you have the Materia script installed only once, as well as no other compatibility fixes for the Materia script.

Also, weapon and armor materia growth work properly, except an issue with decimal numbers (to which I can post a fix if anyone would like it). Keep in mind that materia growth is only for that one piece of equipment, not the entire actor, so materia growth won't change the AP gain shown on the aftermath window.
I've tried several things, but every time the AP gain display was correct for me. I would suggest double-checking your tags, maybe you missed something. If that still doesn't help, check your scripts. Make sure the fix is below the Materia and Aftermath scripts. This might be a bit of a stretch, but make sure you have the Materia script installed only once, as well as no other compatibility fixes for the Materia script.

Also, weapon and armor materia growth work properly, except an issue with decimal numbers (to which I can post a fix if anyone would like it). Keep in mind that materia growth is only for that one piece of equipment, not the entire actor, so materia growth won't change the AP gain shown on the aftermath window.
Hmm I tested in a blank project with just Victors Materia and and your fix. It seems you're right, maybe it's my project and one or more scripts dealing with the Aftermath window. But the Materia growth set to 10 again didn't yield any bonus AP. A Slime that gave 15 XP, (1.5 AP) on a weapon with 10 Materia Growth. The Materia still only ended up with 3 AP after the battle was resolved. Unless I'm doing something wrong. 🙂
SithDuke, I'll send you a PM. I probably shouldn't flood this thread with troubleshooting for the Materia script, haha.

Edit: I edited the script I posted above to include the floating point number fix.
The formatting on the script got all messed up. Without seeing the original and without much scripting experience, I can't format it the way it was originally. Bummer.
Code:
#==============================================================================
#
# ◆ Karanum's Materia & Victory Aftermath Compatibility Patch
# -- Last Updated: 2015.08.19# -- Requires:  * Victor Engine - Materia System
#               * Yanfly Engine Ace - Victory Aftermath
# 
#==============================================================================
$imported = {} if $imported.nil?
$imported["Karanum_Materia_Patch"] = true
#==============================================================================
# ◆ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2015.08.15 - Initial script release.
# 2015.08.19 - Added fix for decimal materia growth rates
# 
#==============================================================================
# ◆ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Created by request, this script patches the compatibility issues between
# Victor Sant's Materia System and Yanfly's Victory Aftermath scripts.
#
# This compatibility patch fixes the issue where no AP would be gained if the
# scripts were in the wrong order, and also adds an extra bit of info to the
# aftermath screen showing how much AP has been obtained.
#
#==============================================================================
# ◆ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open the script editor and paste this script into an
# empty slot below Materials and above Main.
# 
# Make sure that it is below both the Materia and the Aftermath scripts!
#
#==============================================================================
# ◆ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script overrides some functionality of the Materia System script.
# Expansions of the Materia System script might not work as intended, though
# the chance of this being an issue is very low.
#
#==============================================================================
# ◆ Terms of Use
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script may be used freely without explicit permission by the creator.
# Giving credit when using this script is preferred but not required.
#==============================================================================
module YEA 
  module VICTORY_AFTERMATH           
    VICTORY_AP = "+%sAP"   
    # Line format for the AP gain                             
    # (%s becomes the amount of AP in-game)                         
  end
end
#==============================================================================
# >> WARNING << - Editing anything past this point may result in the script 
#                 crashing your game or doing unexpected things.
#==============================================================================
if $imported[:ve_materia_system] then
if $imported["YEA-VictoryAftermath"] then
#==============================================================================
# BattleManager
#==============================================================================
module BattleManager 
  class << self   
    alias bman_display_exp_materiapatch display_exp 
  end   
  def self.display_exp   
    bman_display_exp_materiapatch   
    return if $game_troop.ap_total == 0   
    $game_party.all_members.each {|actor| actor.ap += $game_troop.ap_total } 
  end   
  def self.display_ap 
  end
end
#==============================================================================
# Window_VictoryEXP_Back
#==============================================================================
class Window_VictoryEXP_Back < Window_Selectable 
  alias wvictory_draw_item_materiapatch draw_item 
  def draw_item(index)   
    wvictory_draw_item_materiapatch(index)   
    rect = item_rect(index)   
    draw_ap_gain(rect) 
  end   
  def draw_ap_gain(rect)   
    return if $game_troop.ap_total == 0   
    line_num = ($imported["YEA-JPManager"] ? 5 : 4)   
    dw = rect.width - (rect.width - [rect.width, 96].min) / 2   
    dy = rect.y + line_height * line_num + 96   
    fmt = YEA::VICTORY_AFTERMATH::VICTORY_AP   
    text = sprintf(fmt, $game_troop.ap_total)   
    contents.font.size = YEA::VICTORY_AFTERMATH::FONTSIZE_EXP   
    change_color(power_up_color)   
    draw_text(rect.x, dy, dw, line_height, text, 2) 
  end
end   
end #if $imported["YEA-VictoryAftermath"]
#==============================================================================
# RPG::EquipItem
#==============================================================================
class RPG::EquipItem < RPG::BaseItem 
  def growth   
    return @growth if @growth   
    @growth = note =~ /<MATERIA GROWTH: ((?:\d+)(?:\.\d+)?)>/i ? $1.to_f : 1 
  end
end
end #if $imported[:ve_materia_system]
I might have missed something. Let me know.
Wow, that worked flawlessly. Thank you so much for the clutch save!

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-victory-aftermath-victor-materia-system-compatibility-request.43458/