Gameover 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 replace the default gameover scene with an event. This gives you more control over how the gameover scene should process.

A gameover event is a common event and is assigned to different objects. There are several different scopes of gameover events.

  • Troop gameover events. These occur when you gameover during battle. Each troop can have its own gameover event.
  • Map gameover events. These occur when you gameover on the map. Each map can have its own gameover event.
  • System gameover events. If this is set, it will run instead of the above



Script: download here


Place this below Materials and above Main.


To create a troop gameover event, create a comment of the form

<gameover event: event_id>

To create a map gameover event, in the map’s notebox, tag it with

<gameover event: event_id>

To set a system gameover event, make the script call


Where the event_id is the ID of the common event that will run as the gameover event. If the system event is 0, then either the troop or map events will run. If you want to force the default gameover screen, set the ID to -1

Note that you need to press the C button again after the event finishes to go back to the title screen (if your event does not handle this)

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...

15 Responses

  1. gameoverpros says:

    Pretty! This was a really wonderful article.
    Thanks for providing this info.

  2. Charstray says:

    Hi, I downloaded your script and tested it.. It worked, but I want to ask a question.

    Let's say I want to make the character teleports back to village instead of returning to title screen, how to do that? I'm still very new with custom script so I'm confused..

    • Hime says:

      This script was not intended to allow you to go back to the map. It simply replaces the way the game over screen is handled and then returns to the title map afterwards.

      You'll need another script that will provide that functionality.

  3. Warped Realities says:

    Okay. It somewhat works. In that it now works during battle. But it now doesn’t work if I trigger a gameover from an event on a map and in fact causes the entire game to crash because it’s trying to read line 57 of game_troop when I trigger a gameover.

    So for record. If I add a game over line to an event it now causes the world to explode so long as this script is in place.

  4. Warped Realities says:

    This script doesn't work properly for me. It works for map based game over events, but troop based ones do not in fact work. And I've verified this by making a vanilla project where this script is the only custom content.

    Pictures below:

    • Hime says:

      It works for me. Did you save your game?

      • Warped Realities says:

        No saves are involved in my testing procedure. I have a 5×5 square of grass set to have snake encounters and that's it. I start the game, walk around, encounter the bad guys, die, fail to get the message. Only way i get the message is if I add it to the notes for the map (Which is not useful for my purposes). Adding it as a comment on the event for the troop, doesn't work. And no for the hell of it I tried saving the game, quitting to title, then loading the save and having the encounter and that didn't help either.

        • Hime says:

          Upload your project on dropbox or mediafire. I am not having an issue with the comment in a troop, losing to it in battle, and having the custom game over sequence.

          When I said “save” I meant saving your project. Some people like to testplay their troops directly via the troop editor and then wonder why none of the scripts work.

  5. Agger says:

    I can’t get this to work would anyone mind sending a demo of this?

  6. WCouillard says:

    Can this script transfer the player from a battle to a specific map to run a gameover event from there (bypassing normal gameover)?

    • Hime says:

      No, as this script doesn’t run in the map. It is basically the default game over, except it runs a common event. I have intentions to write a script that does use a “game over” map, but I’m still thinking about how to specify which game over map to go to (in case you have several depending on the situation)

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](

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

Here is some inline `code`.

For more help see