Scene Interpreter
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
- Scene Event Animations – allows you to display pictures and animations in other scenes
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>
Hi Hime,
I just found out when using both Scene Interpreter and Common Equip Events, equipment optimize option will cause game freeze, by setting a common event as interpreter and with a equip event.
I tried some tests, when character does not have that armor(with the event interpreter) equiped, optimize works fine.
Could you please look into it?
Thank you!
Hey Hime,
I have a tiny problem :
First, when I make a choice appear right after a message box, the latter disappears so I end up with just the choice list. I’m not really bothered by this but I noticed that on your screen shot, the message box AND the choices where together.
Second, the real problem here…
The choice list does appear, but it appears “behind” the menu, like this
I’m using your large choices script and the Scene event animation add-on, they’re all above Yanfly’s Ace Menu, and the patch is below all of these scripts.
I also removed them one by one and it didn’t solved the problem.
I have a lot of other scripts but I don’t think they touch something that would change how your script behaves.
If you think that’s a script compatibility issue however, I’ll test in a new project and add my scripts one by one to see if there’s a culprit, but I wanted your thought on this first.
Thanks for reading and for all your scripting o/
I don’t think my screen shot is showing so here’s the link to the image
https://i.imgur.com/V72lCR9.jpg
I would really love to see this script converted to MV. Its perfect for making in game tutorials.
Any plans porting this to MV?
Hime, please make a compatibility patch with your Splash Screen Map script.. Thanks
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
It is a comment, not a script. Change it to a comment and it should work.
Ah oops, thanks. That explains why your’s was green and mine was gray…
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.
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
Sounds pretty logical, thanks!
Oh, SceneManager.return seems to close the game rather than return to the previous scene. Hopefully I won’t need it anyways.
You should not call the return method UNLESS you used “call” to pull up a new scene.
Returning from the last scene will simply close the game.
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?
common event on an equip to change chars actor/face image***
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.
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?
How are you calling the event through the menu?
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.
I have looked the issue and have updated the script to address the problem.
That did the trick! You’re amazing!
can I play common event on battle with this….? thanks..!
You should be able to.
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.
Delete line 109 of the effect script.
Thanks, works like a charm!
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!
Are you placing this script below materials and above main?
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?
Sorry, line 217
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?
Nice script , tsuki,……………
anyway can I use this on battle, so that I can play movie on my skill via common event,…….?
You can’t play movies in battle normally?
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 ?
Do you have the comment in your common event? Does it run when you return to the map?
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!
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.
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.
You will need to modify the menu-calling logic in the map scene to call the common event rather than opening the menu.
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?
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.
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 🙂
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.
You need to explicitly refresh the screen yourself by writing a method that will allow you to refresh the appropriate windows.
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.
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.
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.
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.
Comments or forum posts (if a blog post is not available) would be easier since I check the blog regularly.
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!
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.
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.
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.
Thanks. Works as advertised! 🙂
Also for the warning about fadein/out.
This script is one of the most useful, little, scripts I have used so far. Thanks!
when I found this script, I did a little dance. thank you so much for it!
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?
It was a bug. I have fixed the issue and updated the script. Please try again and see if it occurs. Thanks for the report.
Script updated with new usage.