CT Bolt 23 Posted April 5, 2012 (edited) Events on Map 1.02by CT_Bolt IntroductionThis script allows to return events to the position stored in the class.This is useful when leaving the map and having the enemy stay where they were.Features Store the location of the event you want to keep its position. Restore all the positions of the events you have stored. ScreenshotsDoesn't really need any. Just grab the demo.InstallingTo install the script, open you script editor and paste this script in a new section below the Materials & above Main Process.How to UseUse 'storeEvent' in a script call for the event you want to store the location of the event you want to keep its position.Use 'setEventLocations' in a script call to restore all the positions of the events you have stored.See DEMO for more details.DemoEvents On Map (Demo).zipScript #============================================================================== # ****************************** Events On Map ****************************** #------------------------------------------------------------------------------ # Author: CT_Bolt # # Version History: # v1.00 - 04.05.2012 # v1.02 - 04.06.2012 (MapID Fix) #------------------------------------------------------------------------------ # Description: # This script allows to return events to the position stored the class. # Useful when leaving the map and having the enemy stay where they where. #------------------------------------------------------------------------------ # Compatibility: # No known issues. #------------------------------------------------------------------------------ # Instructions: # To install the script, open you script editor and paste this script in # a new section below the Materials & above Main Process. # # How to use: # Use 'storeEvent' in a script call for the event you want # to store the location of the event you want to keep its position. # # Use 'setEventLocations' in a script call to restore all the positions # of the events you have stored. # # See DEMO for more details. #============================================================================== $enemyCount = 0 $enemyOnMap = {} class Game_Interpreter alias mySetup setup unless $@ def setup(list, event_id = 0) mySetup(list, event_id) $t = $game_map.events[@event_id] end end class Enemy_On_Map attr_accessor :mapID attr_accessor :eventID attr_accessor :x attr_accessor :y def initialize @mapID = 0 @eventID = 0 @x = 0 @y = 0 end def printInfo print "ID: ", @eventID, ", X = ", @x, ", Y = ", @y, "\n" end end def storeEvent $enemyOnMap[$enemyCount] = Enemy_On_Map.new $enemyOnMap[$enemyCount].eventID = $t.id $enemyOnMap[$enemyCount].mapID = $game_map.map_id $enemyOnMap[$enemyCount].x = $t.x $enemyOnMap[$enemyCount].y = $t.y $enemyCount = $enemyCount + 1 end def setEventLocations i = 0 while i < $enemyCount if ($enemyOnMap[i].mapID == $game_map.map_id) $game_map.events[$enemyOnMap[i].eventID].moveto($enemyOnMap[i].x, $enemyOnMap[i].y) end i=i+1 end end Author's NotesEnjoy! Edited January 31, 2013 by CT Bolt Share this post Link to post Share on other sites
Patrick V 3 Posted April 5, 2012 I like it! Very practical! Share this post Link to post Share on other sites
CT Bolt 23 Posted April 5, 2012 I like it! Very practical! Thanks, hope this makes things easier for ya. Share this post Link to post Share on other sites
VegaKotes 17 Posted April 6, 2012 Neat! I like to have enemies as events rather than random battles, this should make things more interesting. Share this post Link to post Share on other sites
CT Bolt 23 Posted April 7, 2012 I have fixed a big issue, when you have events stored on multiple maps v1.00 would error. The problem is fixed in v1.02. Share this post Link to post Share on other sites
Chigoo 35 Posted January 8, 2014 (edited) oops wrong thread... anyways nice script. Edited January 8, 2014 by Chigoo Share this post Link to post Share on other sites