Save-Point
Testing for an Event Name - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Archives (https://www.save-point.org/forum-105.html)
+--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html)
+---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html)
+----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html)
+----- Thread: Testing for an Event Name (/thread-6765.html)



Testing for an Event Name - Near_Fantastica - 02-01-2005

This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss.
No support is given. If you are the owner of the thread, please contact administration.


Description :

This Script loads in the names of events from the map files

Script :

Code:
#==============================================================================
# **  Game_Map
#------------------------------------------------------------------------------
#   Near Fantastica
#   22/12/04
#   Add defenision of the names to Game Map Class
#==============================================================================

class Game_Map
#--------------------------------------------------------------------------
# * Refer setup to Game Map
#--------------------------------------------------------------------------
alias game_map_setup setup
#--------------------------------------------------------------------------
# * Loads Event names
#--------------------------------------------------------------------------
def setup(map_id)
   game_map_setup(map_id)
   @name = {}
   for i in @map.events.keys
     @name[i] = @map.events[i].name
   end
end
#--------------------------------------------------------------------------
# * Displays Event names
#--------------------------------------------------------------------------
def event_name(event)
   @event_id = event
   @name[@event_id]
end
end


Instructions :

To test for an event name use this call

Code:
$game_map.event_name(event_id)

event_id = the id for the event you wish the name to displayed