blucalm

Compat Snip for kai monkey char create

Mar 13th, 2013
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.46 KB | None | 0 0
  1. #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
  2. # Name Compat Snip 1 for Kai Monkey's Character Creation
  3. #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
  4. # Usage:
  5. #
  6. # Put the names of the actor's in the database inside of the hash here.
  7. # For example, if the name of actor 1 in the database is Apple and the name
  8. # of Actor 3 in the databasae is Orange, the Actor_Names hash should look like:
  9. #   Actor_Names = {
  10. #     1 => "Apple",
  11. #     3 => "John"
  12. #   }
  13. #
  14. # The when creating a unit-event for that actor use the name that is inside of
  15. # the database, so even if the actor with the name "Apple" has his name changed
  16. # to "Papaya" later on in the game, all of the unit-events for that actor should
  17. # still have the name apple.
  18. #
  19. # This is just a temp solution so I don't have to write all of the code to
  20. # completely fix the problem yet. Note - The names of the actors will appear to be
  21. # wrong during a tactical battle
  22. #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
  23.  
  24. module TBNameCompatCat
  25.     Actor_Names = {
  26.             1 => "Test Diff Name",
  27.             2 => "Actor 2's name in the database goes here"
  28.     }
  29. end
  30.  
  31. module TactBattleManager
  32.   # Make aliased pointers
  33.   class << self
  34.       alias setup_compatname_hera setup
  35.       alias exit_compatname_hera exit_tb
  36.   end
  37.   # Alias Setup
  38.   def self.setup(id = 0)
  39.     return unless SceneManager.scene_is?(Scene_Map)
  40.     $game_system.tb_swap_store_cmpt_cat_nmes # store and swap def names
  41.     setup_compatname_hera(id)
  42.   end
  43.   # Alias exit_tb
  44.   def self.exit_tb
  45.     return unless @tact_battle = true
  46.     $game_system.tb_swap_reset_cmpt_cat_nmes # reset names to what they were
  47.     exit_compatname_hera
  48.   end
  49. end
  50.  
  51. class Game_System
  52.   # Alias, Initialize
  53.   alias initialize_tb_cmpt_cat_hera initialize
  54.   def initialize
  55.     initialize_tb_cmpt_cat_hera
  56.     @tb_compat_cat_names = {}
  57.   end
  58.   # Store Names
  59.     def tb_swap_store_cmpt_cat_nmes
  60.         @tb_compat_cat_names = {}
  61.         $data_actors.each do |a|
  62.       next if !a
  63.             id = a.id
  64.             @tb_compat_cat_names[id] = a.name
  65.             $game_actors[id].name = TBNameCompatCat::Actor_Names[id]
  66.         end
  67.     end
  68.     # Reset Names
  69.     def tb_swap_reset_cmpt_cat_nmes
  70.         $data_actors.each do |a|
  71.       next if !a
  72.       id = a.id
  73.             $game_actors[id].name = @tb_compat_cat_names[id]
  74.         end
  75.     end
  76.   # Get stored name by id
  77.   def tb_get_st_cmpt_nm(id)
  78.     @tb_compat_cat_names[id]
  79.   end
  80. end # Game_System
Advertisement
Add Comment
Please, Sign In to add comment