IceDragon200

[VXA]Picture Follow Character

Jul 22nd, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.86 KB | None | 0 0
  1. #-skip:
  2. # // Picture Follow Character
  3. # // By IceDragon
  4. # // Instructions:
  5. # //   picture_follow(picture_id, character_id)
  6. # //     int picture_id
  7. # //     int character_id
  8. # //      -1 - Player
  9. # //       0 - Current event
  10. # //       1 - every other event
  11. #-end:
  12. #-inject gen_class_header 'Game_Picture'
  13. class Game_Picture
  14.   attr_accessor :flw_char_id
  15.   alias flw_update update
  16.   def update
  17.     update_follow if @flw_char_id
  18.     flw_update
  19.   end
  20.   def update_follow
  21.     chara = $game_map.interpreter.get_character(@flw_char_id)
  22.     @x = chara.screen_x
  23.     @y = chara.screen_y - 16
  24.   end
  25. end
  26. #-inject gen_class_header 'Game_Interpreter'
  27. class Game_Interpreter
  28.   def picture_follow picture_id, character_id
  29.     character_id = @event_id if character_id == 0
  30.     screen.pictures[picture_id].flw_char_id = character_id
  31.   end
  32. end
  33. #-inject gen_script_footer
Advertisement
Add Comment
Please, Sign In to add comment