Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Call Event XP
#1
Call Event
Version 1.0
by Woratana
Release Date: 05/05/2008


Introduction
It's a little snippet that will add thing like event command 'Call
Event' in RM2K.

If you haven't use RM2K before, 'Call Event' use to run event commands
in other event.
Basically, it's similar to 'Call Common Event', just change from common
event to event in map.

I also added option to use call event with event from other map. :)


Features
Version 1.0
Code:
# - Same as 'Call Event' in RM2K
# - You can also use 'Call Event' with event from other map
Screenshots
No need... :lol:


Script
Place it above main
Code:
#============================================================
# ? [XP] ? Call Event ?
# * Missing features from RM2K
#------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released Date: 04/05/2008
#------------------------------------------------------------
=begin

+[How to use: Version 2]+
=========================================================================
>> Call event from other map by call script:

callev(event id, page you want, map ID)
------------------------------------------------------------------------
e.g. callev(5,2,1)
^ to call event commands list from 'page 2' of 'event ID 5' in Map ID '1'
------------------------------------------------------------------------
>> Call event in current map by call script:

callev(event id, page you want)
------------------------------------------------------------------------
>> If you want to call event in current page that it's running,
set 'page you want' to 0
------------------------------------------------------------------------
*Note: You CANNOT call erased event!
========================================================================
=end
#------------------------------------------------------------

# Make variable 'event' readable from outside
class Game_Event; attr_reader :event; end
class Interpreter
  def callev(evid = 0,page = 0, id_map = $game_map.map_id)
    return if evid == 0
    if id_map != $game_map.map_id
      # Load new map data if event is not from current map
      dest_map = load_data(sprintf("Data/Map%03d.rxdata", id_map))
      if page == 0
        # Get first page if user didn't set page
        inter_event = dest_map.events[evid].pages[0]
      else
        inter_event = dest_map.events[evid].pages[page - 1]
      end
    else
      # Use $game_map if event is in current map
      if page == 0
        inter_event = $game_map.events[evid]
      else
        inter_event = $game_map.events[evid].event.pages[page - 1]
      end
    end
    # Add new child_interpreter to run commands
    @child_interpreter = Interpreter.new(@depth + 1)
    # Add commands from target event
    @child_interpreter.setup(inter_event.list, @event_id)
  end
end


Instruction
Use 'Call Event' by call script:
Code:
callev(event_id, page, map_id)
or
Code:
callev(event_id,page)
for event in current map

If you want to call current page from that event (in case that event
have many pages depends on condition...)
just change use 0 for page


Author's Notes
Free for use in your non-commercial work if credit included. If your
project is commercial, please contact me.

Please do not redistribute this script without permission. If you want
to post it on any forum, please link to this topic.
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Event Spawner Fixes DerVVulfman 8 15,272 01-02-2018, 05:48 AM
Last Post: DerVVulfman
   Event Location Saver 1.1 ixfuru 0 4,030 12-07-2016, 11:36 PM
Last Post: ixfuru
   SDK DVV Add-On: Event Comment Supplemental DerVVulfman 5 10,568 09-25-2016, 09:20 PM
Last Post: DerVVulfman
   DoubleX RMMV Popularized ATB Event DoubleX 2 5,149 02-20-2016, 04:52 AM
Last Post: DoubleX
   Event Comment Conditionals ixfuru 3 5,917 08-05-2015, 02:31 AM
Last Post: JayRay
   ELSA (Event Layering Script Advance) JayRay 0 5,365 02-25-2015, 04:15 AM
Last Post: JayRay
   Permanent Event Erase DerVVulfman 2 5,515 04-09-2013, 03:53 AM
Last Post: DerVVulfman
   Event Transparency DerVVulfman 6 10,512 03-09-2013, 06:00 AM
Last Post: DerVVulfman
   The Event Extenders Grimimi 2 5,995 09-01-2012, 05:54 AM
Last Post: Grimimi
   Call Map Event DerVVulfman 0 4,772 12-06-2011, 04:42 AM
Last Post: DerVVulfman



Users browsing this thread: