Advertisement
Fomar0153

Fomar0153 - Copy Events

Jan 12th, 2012
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.18 KB | None | 0 0
  1. =begin
  2. Copy Event Script
  3. by Fomar0153
  4. Version 1.0
  5. ----------------------
  6. Notes
  7. ----------------------
  8. Allows you to copy events.
  9. ----------------------
  10. Instructions
  11. ----------------------
  12. In a script command use:
  13. $game_map.add_event(mapid, eventid, x, y)
  14. to add a new event.
  15. mapid and eventid refer to map and event you're copying
  16. x and y refer to the location you wish to copy it to
  17. ----------------------
  18. Known bugs
  19. ----------------------
  20. None
  21. =end
  22. class Game_Map
  23.   #--------------------------------------------------------------------------
  24.   # ● Adds an event from another map to the current map
  25.   #--------------------------------------------------------------------------
  26.   def add_event(mapid, eventid, x, y)
  27.         map = load_data(sprintf("Data/Map%03d.rvdata2", mapid))
  28.         map.events.each do |i, event|
  29.           if event.id == eventid
  30.                 e = Game_Event.new(@map_id, event)
  31.                 e.moveto(x,y)
  32.                 @events[@events.length + 1] = e
  33.           end
  34.         end
  35.         SceneManager.scene.get_spriteset.refresh_characters
  36.   end
  37. end
  38.  
  39. class Scene_Map < Scene_Base
  40.   def get_spriteset
  41.         return @spriteset
  42.   end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement