Reference Events

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This script allows you to create events using a “reference event”. The purpose is to allow you to create an event once on a map and re-use it across multiple maps.

This is useful when you have multiple copies of the same event, but you want to avoid having to change each event manually if you decide to change a command or graphic.

For example, suppose you were implementing on-screen enemies where touching an enemy event will begin a battle. If you want to have 20 of these enemies on the map that all do the same thing, rather than copy-pasting one event 20 times, you would first create one enemy event with all of the logic, and then create a second event that will treat the enemy event as the reference event. Then you would copy the second event again and again, so that if you decide to change the enemy event, you don’t have to delete all of the
enemy events and redo the copy paste process.

Download

Script: download here

Installation

In the script editor, install this script below Materisls and above Main

Usage

To designate a reference event, create a comment on the first page of an event
of the form

<reference event: event_id map_id>

Where

`event_id` is the ID of the reference event
`map_id` is the ID of the map of the reference event

If you don’t specify a map ID, it is assumed to be the current map.

When the map is loaded, the event will be replaced by the reference event (except its ID)

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

5 Responses

  1. Josh says:

    This is an awesome script!

    I have been looking at other scripts like this, but a feature I am looking for is missing.

    Is it possible to have a separate comment on different pages of the event to change which event is referenced?

    I am making a fighting game where the character ID numbers are solidly referenced by other events.

    So I need a way to use the same event to represent several characters.

    I know i could use switches to activate/deactivate characters but that would require about 300 pages…

    Once again, this is an amazing script!

    • Hime says:

      This script works by treating an event as a placeholder. During the game, it will take the appropriate event and replace it with that, meaning the original placeholder is gone.

      This means that you can’t really change to a different page of the placeholder, because the placeholder pages are gone.
      If we make it so that the placeholder pages are retained by the event, and it will determine which event to copy from, that might work. But I’m not sure how that would be implemented.

  2. Hime says:

    Script has been updated with a 5x performance improvement on map load times. The note-tag has been changed, however, so that the map ID is an optional value. If the map ID is not specified, it assumes the reference event is on the current map.

  3. Johnny says:

    Great script!
    Now I don’t have to use so many of my common events.

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax