Last active
April 29, 2017 20:02
-
-
Save Erisa/d21469cebb1b4113c648cab23b467a17 to your computer and use it in GitHub Desktop.
[RMVXA] Fixed script to copy event from a different map. All credit to original author.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================== | |
# ** Game_Event | |
#------------------------------------------------------------------------------ | |
# This class handles events. Functions include event page switching via | |
# condition determinants and running parallel process events. Used within the | |
# Game_Map class. | |
#============================================================================== | |
class Game_Event < Game_Character | |
attr_accessor :id | |
end | |
#============================================================================== | |
# ** Game_Map | |
#------------------------------------------------------------------------------ | |
# This class handles maps. It includes scrolling and passage determination | |
# functions. The instance of this class is referenced by $game_map. | |
#============================================================================== | |
class Game_Map | |
#-------------------------------------------------------------------------- | |
# ● Adds an event from another map to the current map | |
#-------------------------------------------------------------------------- | |
def add_event(mapid, eventid, x, y) | |
map = load_data(sprintf("Data/Map%03d.rvdata2", mapid)) | |
map.events.each do |i, event| | |
if event.id == eventid | |
e = Game_Event.new(@map_id, event) | |
e.moveto(x,y) | |
location = @events.length + 1 | |
@events[location] = e | |
@events[location].id = location | |
end | |
end | |
SceneManager.scene.get_spriteset.refresh_characters | |
end | |
end | |
class Scene_Map < Scene_Base | |
def get_spriteset | |
return @spriteset | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment