RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
+ [ Call Event ] + (Missing feature from RM2K)

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 86
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: [Select]
# - 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: [Select]
#============================================================
# ? [VX] ? 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 Game_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.rvdata", id_map))
      if page == 0
        # Get first page if user haven'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 = Game_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: [Select]
callev(event_id, page, map_id)

or
Code: [Select]
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.

***
Rep:
Level 86
I hate everyone except the ones I don't hate...
 :burn:
'tis is some hot stuff! A great idea, I gotta say! Is there anything like this for xp as well? (Or would you consider making it ::))
 ;8
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

**
Rep:
Level 86
Sure :)

http://rmrk.net/index.php/topic,26819.0.html
^ Here is XP version of this script. >_>a

***
Rep:
Level 86
I hate everyone except the ones I don't hate...
:burn:
'tis is some hot stuff! A great idea, I gotta say! ;8

I'll just repeat what I said before for that link... :P
I wonder how many of my-reps are there for a reason, and not just because some jackass wanted to show off in front of some other jackasses...?
Probably a lot of them - and those people sure as hell don't deserve my pity, let alone my disgust.
That's right, let's see some more -Rep'ing! BOOYEAH!!

**
Rep:
Level 86

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Looks like a very nice idea for a script. Good work worale.

**
Rep:
Level 86
Thanks MA  ;)