Ricordi
Member
- Jun 3, 2021
- 140
- 400
If you mean $game_player.actor.stat['Mod_ExpandedBooba'] == 1 as a condition checker in .json palettes, then it seems not to work as intended, or I misunderstood. Therefore, I used the following semi-measure script for automatic updating of .json palettes (even though it's a workaround):Regarding the active jsons: You can add conditions to them that check if a required stat is at a certain value. Should be able to have those conditions check if the Big Booba state has been added to Lona or not and only be active IF the state has been added. Once those conditions are working correctly the json can be active all the time as it will only apply if Lona has the Big Booba state. (Check the transformations json in the game files for examples) The DESU example would also need to check if the DESU Mode mod is active too though (and any others that depend on other mods would also need to check for their respective dependency)
Code:
class Game_Actor < Game_Battler
alias_method :add_state_expanded_booba, :add_state
alias_method :remove_state_expanded_booba, :remove_state
def add_state(state_id)
add_state_expanded_booba(state_id)
check_and_apply_booba_graphics_changes(state_id)
end
def remove_state(state_id)
remove_state_expanded_booba(state_id)
check_and_apply_booba_graphics_changes(state_id)
end
def check_and_apply_booba_graphics_changes(state_id)
return unless state_id == $data_StateName["Mod_ExpandedBooba"].id
if states.include?($data_StateName["Mod_ExpandedBooba"])
load_booba_graphics_changes("ModScripts/_Mods/Lona_Booba_Graphics/PaletteChanger/")
else
load_booba_graphics_changes("ModScripts/PaletteChanger/")
end
end
private
def load_booba_graphics_changes(folder)
Dir.glob("#{folder}*.json").each do |file|
BitmapChanger.load_setting_file(file)
end
end
end