Skip to content

Instantly share code, notes, and snippets.

@Erisa
Last active April 29, 2017 20:02
Show Gist options
  • Save Erisa/d21469cebb1b4113c648cab23b467a17 to your computer and use it in GitHub Desktop.
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.
#==============================================================================
# ** 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