Scene Interpreter

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

scene_Interpreter1

This script allows you to execute common events in the current scene. For example, by default, if you use an item that executes a common event from the item menu, the menu will close and you will be taken to the map scene where the event will be executed.

With the scene interpreter, you can execute the common events right in the menu scene.

Furthermore, the scene interpreter allows you to create all sorts of complex behaviour such as switching between scenes or executing custom logic without having to do any scripting yourself. Previously, any of these mechanics would need to be scripted. Now, all you need is a common event to handle all of it.

Download

Script: download here

Addons

Patches

  • Patch for Yanfly’s Ace Menu Engine

Installation

Place this below Materials and above Main. You should place this above other custom scripts

Usage

If you would like a common event to run in the current scene, create a comment in the common event command list with this string

<run scene: current>

scene_Interpreter2

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

57 Responses

  1. waynee95 says:

    Any plans porting this to MV?

  2. kevin eontrainer says:

    Hime, please make a compatibility patch with your Splash Screen Map script.. Thanks

  3. SweetMeltyLove says:

    On a brand new project, I just made the potion item call a common event, and in that event all I have is the script calling <run scene: current> getting this error when I use the potion:

    ---------------------------
    Project2
    ---------------------------
    Script 'Game_Interpreter' line 1414: SyntaxError occurred.

    unexpected '<'
    <run scene: current>
    ---------------------------
    OK
    ---------------------------

    The scene interpreter is right above Main

  4. WH says:

    How would I make the game change scene to map mid-event? I have items that affect the map after a choice but I’m not entirely sure how to do so.

    • Hime says:

      You can use the script call
      SceneManager.call(Scene_Map)
      To go to the map.
      Using “call” allows you to “return” to the previous scene (assuming the previous scene is not necessarily known beforehand)

      You can return to the previous scene using
      SceneManager.return

  5. Resinate says:

    i dont know if ur still updating, but when i applied a common event to change chars actor/face image
    it doesnt work on equip until i back out of the equip menu then it shows correctly. is there a way to make it refresh or update on equip?

    • Resinate says:

      common event on an equip to change chars actor/face image***

    • Hime says:

      The problem here is that the windows are not updated.
      When you exit and open the scene again, it redraws the face.

      I am not sure what would be a good way to refresh the current windows. See if someone on the forums can give a recommendation.

  6. Disponi says:

    I seem to be running into a bit of a bug: whenever I call a common event through the menu but not using the scene interpreter, and then call a common event with the scene interpreter, I get a game crash. Any idea how to fix it?

    • Hime says:

      How are you calling the event through the menu?

      • Disponi says:

        Through items. I even tested it out in a clean project. One item calls a common event with the scene interpreter, the other does not. Both work the way they should by themselves, but if you use the item that calls a common event WITHOUT the scene interpreter, and then use the item that calls a common even WITH the interpreter, the game crashes.

  7. Tedj says:

    can I play common event on battle with this….? thanks..!

  8. John says:

    This script doesn’t seem to be compatible with your Effect: Common Event script. When I use a skill form the menu that has a common event effect, the menu closes and the common event runs on the map scene as it normally would.

  9. Hikomarukun says:

    Thank you for this script, and sorry to necro – but I might have found an incompatibility (?). I added the scene interpreter to my game, but got this error:

    Script ‘Scene Interpreter’ line 104: NameError occurred.
    undefined method ‘run’ for the class ‘Module’

    Any ideas?

    Thanks again!

  10. Ninkoro says:

    Hi,
    your script use to work for me, but I recently updated it and now I get
    “undefined method ‘run_scene’ for nil:NilClass” for line 182…
    Could you take a look at it?

    • Ninkoro says:

      Sorry, line 217

    • Hime says:

      I created a common event that runs in the current scene and simply displays are a message. I then used an item that called the common event, and it worked. Can you provide more information on the issue?

  11. Ash says:

    Nice script , tsuki,……………
    anyway can I use this on battle, so that I can play movie on my skill via common event,…….?

  12. Trace says:

    hey tsukihime . . .
    i have a question . . .
    i create a custom menu command that access common event

    def create_party_window
    @party_window.set_handler(:common_event_9, method(:command_common_event_9))
    end

    def command_common_event_9
    $game_temp.reserve_common_event(9)
    SceneManager.goto(Scene_Map) if $game_temp.common_event_reserved?
    end

    and i don’t get the message in the common event 9 running in the menu
    any help ?

  13. Sixth says:

    Ahoy!
    I just wanted to check up on this script, as it is useful.
    But the last time I checked it, it created serious memory leaks endlessly, which is not something I would like to do in a game for sure.
    I debugged it with Mithran’s GOBJ scripter’s tool, and it kept reporting hell of a lot memory leaks after each scene changes.
    Is this fixed yet, or not? Thanks for the answer in advance!

    • Hime says:

      I missed this message completely. When I looked at the fix, it’s pretty obvious there’s a memory leak.

      I will see if there is a better way around the issue, since anyone that’s creating their own message windows for their scenes would have this problem.

      For now, your fix will handle the default scenes.

  14. KanaX says:

    Is there a way to execute the common event when you press the B button to enter the menu? I have made my own menu and I want the rest of the events to stop updating when It’s active.

    • Hime says:

      You will need to modify the menu-calling logic in the map scene to call the common event rather than opening the menu.

      • KanaX says:

        Ok, I completely disabled the command menu and left only the bitmap. The thing is that now when I try to use script calls like “SceneManager.call(Scene_Load)” etc etc they both operate and often the event is over the new command. Is there a way to fix this?

  15. RJ says:

    This is what I got:
    <run scene: current>
    Show Choices:
    [ Option 1]
    (some stuff, heal HP, etc.)
    [Option 2]
    Show Picture […]
    End

    I suppose this is a bug: the Show Picture command seems to not work at all?
    Or maybe show picture was never intended to work with another scene active, anyways.

    Hope that gets fixed if it can.

  16. this is brilliant. I have weapons that change a character’s class, but the events handling the class changes were not being called until the ENTIRE main menu was left. this script fixes that problem, making the class changes immediate! thanks 🙂

  17. Justin M says:

    Is there a way to refresh the screen after you perform the common event? Because as it stands, I convert an item into a new one with your awesome script but you can’t see the new item until after you perform the action again, or change menus / screens.

  18. Mark McKeich says:

    Well that’s odd, the disposed window error is gone but now the common event command still takes you to the map, instead of running it in the menu scene.

    • Hime says:

      I’m not sure how to set up the menu script but looking at the common event menu commands, it explicitly makes calls to return to the map, which should explain why it’s going back to the map.

  19. Mark McKeich says:

    I’m having an issue with this script.

    I’m trying to create a really simple in-menu crafting system through a common event. The common event is activated using Yanfly’s Ace Menu script, whereby selecting said command in the main menu will run a common event. Anyway, I’m testing this out, and when said common event is run (and this event has the tag), I get a disposed window error.

  20. RogueDeus says:

    Do you prefer that I post issues on the blog like this? Or should I tell you some other way?

    I am completing my script compilation testing, to make sure they do not clash with each other at this moment, and am about to begin creating the content, so I may run into several more in the long process.

    I am beginning to think I am cluttering up your blog with bug/issue reports. :p

    I look forward to the update to your Scene Interpreter.

  21. RogueDeus says:

    Anomaly found. 🙂

    I am not sure if the interpreter is clashing with Yanfly Battle System, or if its a genuine bug, but when I change equipment (using Yanfly Command Equip) and your ‘Equip Events’ script fires off a text msg, I exit the equip menu at that moment, before the text msg completes, and re-enter the combat scene, the text msg ends up completing in the combat scene and the battle menu never shows up. Just a battle scene with no options, or way to exit. (Game Breaking)

    If its a compatibility issue I will understand if you don’t tackle it. 🙂

    Your scripts have become invaluable to my project.
    Thank you!

    • Tsukihime says:

      Another dev mentioned that there were issues with my scene interpreter and message windows, where the focus is not given to the message window if it’s active. It sounds like the issue only occurs if the message does not finish before you exit the screen, so I will look into forcing the message to finish before you can do anything else.

  22. RogueDeus says:

    Another anomaly to report!

    For some reason, when running a ‘fade-screen’ or ‘wait’ command from a common event, when invoked from an item or skill use (such as from an item used to simulate a rest) neither command ever finishes to move onto the next command in the event. It doesn’t freeze the game, it just seems to never finish the event.

    I tested this in clean events with a text msg, a wait, and a second text msg. The second text never shows. Ditto with fade-out and fade-in screen events (minus the wait), no fade-in occurs. The screen is blank, but otherwise completely playable; activating triggers, etc…

    I can only guess there are more commands this occurs on, but I only ran into those as I have yet to try others from item use.

    • Tsukihime says:

      I have reproduced the issue. This script introduces a bug where activating a common event from an item/skill and returning to the map causes the common event to just stop running after the first command.

      I have updated the script to address this bug. However, note that you are unable to fadein or fadeout unless you’re on the map or battle. I have played around with ways to get the fadein/fadeout to work in any scene, but it is still under consideration.

  23. RogueDeus says:

    This script is one of the most useful, little, scripts I have used so far. Thanks!

  24. amicable says:

    when I found this script, I did a little dance. thank you so much for it!

  25. Psylau says:

    I have a problem with this script.
    When i try a Skill with User-Target (for example a healing spell from the menu) I get a error in line 132. “undefined method ‘run_scene’ for nil:NilClass”
    I just copied the script, what do I do wrong?

  26. Tsukihime says:

    Script updated with new usage.

  1. October 13, 2014

    […] fixes have been implemented for the Scene Interpreter. One has been an outstanding issue for a long time, and the other was recently reported to […]

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