Made this script call:
$game_temp.reserve_common_event(($game_variables[82] + 60))
Now the variable 82 value should be "2", something confirmed by a text box with \V[82] in it. However when I use the script call, the common event doesn't work and the game freezes (the last one is not important). However, when I use the script call command, it works perfectly.
Any ideas? Thank you.
Uh ... when I use the script call the game freezes, but when I use the script call it works perfectly?
So you're doing this in an actual script? That would belong in the RGSSx Script Support thread then (since EVERYTHING in this thread is about the Script Call Command), along with the block of code where you're calling it. You might just have it in a loop that's not exiting or something.
Oh, I'm so sorry. I mean "call common event" command. I when I call it from there it runs just fine. However when I call it using a script call it freezes.
Ah, gotcha. That all makes sense now 🙂
Can you add a screenshot of the event? Are there other commands? Is this during battle or just a regular event?
I notice you've got two sets of brackets in your command. I really don't think that would be an issue, but try just having one set and see if it makes a difference.
What turns switch 10 on?
I don't think it's a problem with the reserve_common_event at all. It will reserve it, but it won't run until the current common event is finished. Once the common event has been reserved, it goes into a loop. What controls that switch? What is going to turn it on?
What are you trying to do here? It may just be that you're not quite going about it the right way. If you just want to show the image, wait for the player to press Enter, then call another common event, you don't need a loop OR the reserve_common_event to do that. Just show the image, use a Show Text command with a transparent background, bottom alignment and no text (only the little arrow at the bottom will be visible and most people won't notice it), followed by a Call Common Event.
If it's something else, you'll have to tell us.
Edit: I've split this off into its own thread as I'm almost certain it's got nothing to do with the script call. To verify that, you could remove the script line altogether and see if it still freezes.
Are you sure the common event is even running? Put in some Show Text commands so you can see what it's up to and what common event is active when it freezes.
Also, an Exit Event Processing at the bottom of a called common event is redundant.
It works just fine when I replace the script call with the call common event command, so I don't understand, why it wouldn't work.
Then maybe it's got something to do with the script.
Actually, with the help of Hudell I figured out that the script call I used is not the same as the call common event command. It just "reserved" the activation of the new event for after the first one ended. He made me a little scriptlet that allowed me to successfully call the event. Thank you Shaz for getting in the trouble of opening a topic for me.
Not a scripter at all, but how I understand it that simply reserves the common event to be started during the next cycle, which doesn't occur because reasons.
Chances are I'm just wrong, but try this instead. It's taken directly from game_interpreter. If the command works then this should work.
common_event = $data_common_events[$game_variables[82]+60] if common_event child = Game_Interpreter.new(@depth + 1) child.setup(common_event.list, same_map? ? @event_id : 0) child.run endedit: boop, too late. Will leave this here anyway for reference