Scene Manager: Call vs. GoTo

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
I'm trying to implement a sort of non-game-over where, upon losing a battle, a player can elect to retry a segment of the game that they failed.  To do this, I added a command window to the Game Over screen that lets the player choose between Retrying, Loading a Save, or Returning to the title screen.

My initial instinct was to have the "Retry" option set some variables and other game elements back to their status at the beginning of the segment, then return to Scene_Map using SceneManager.return - but all that did was close the game.  After poking around a bit I found this was because Scene_Gameover is activated using Scenemanager.goto rather than Scenemanager.call, so the "stack" of scenes is destroyed and I can't return to anything.

So what I did was to modify all the Game Over scripts to use SceneManager.call(Scene_Gameover) instead.  On first blush this seems to work well - the player is now returned to the map once I use a SceneManager.return line, instead of being bounced out of the game.  But I'm not so well-versed in the "nitty gritties" of how data is handled behind the scenes.  So my question is this: Will I introduce any risk, slowdown, or orphaned data by activating Scene_Gameover using the Call (rather than GoTo) command, or by subsequently using the commands SceneManager.call(Scene_Load) or SceneManager.return from the Game Over screen?

Any light you guys could shine upon this for me would be greatly appreciated. =)
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Well, the main point why you should use call instead of goto that you can dynamically return to the previous scene. Like... if Scene_Item called in Scene_Map, then when you call SceneManager.return you will returned to Scene_Map, not to Scene_Menu.

Edit: This will be useful if you're writing a script that use your own scene class. You can make the player access from map by using SceneManager.call or through the menu. And since the default script for Gameover screen doesn't need to come back to map, so that's why it used goto. 

Risk or slowdown? none I guess

Edit 2:

I personally don't want to modify how the default script handle the gameover. So, instead I would like to directly call SceneManager.goto(Scene_Map)
 
Last edited by a moderator:

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Thank you very much for your information!  If you wouldn't mind clarifying just a bit more:

Well, the main point why you should use call instead of goto that you can dynamically return to the previous scene. Like... if Scene_Item called in Scene_Map, then when you call SceneManager.return you will returned to Scene_Map, not to Scene_Menu.
Is there any disadvantages to making the stack of scenes large by using "call" almost everywhere?

I personally don't want to modify how the default script handle the gameover. So, instead I would like to directly call SceneManager.goto(Scene_Map)
Is this just a personal preference, or is there a real advantage to using GoTo here (and I should do the same instead of modifying the default GO scripts for my game)?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Is there any disadvantages to making the stack of scenes large by using "call" almost everywhere?
There is any if you use 'call' many times. It generates many submenus that you have to press X many times to get back to the map.

For example, you enter the main menu --> Select status --> Select the actor. In Scene_Status, there's submenus like Equip, or skill. You call the Scene_Skill through the Scene_Status. And you also add another menu in Scene_Skill like assign skill point (or whatever) that has its own custom Scene class. If you want to go back to the map, you need to get back through (Scene_SkillPoint -- Scene_Skill -- Scene_status -- Scene_Menu -- Scene_Map).

Is this just a personal preference, or is there a real advantage to using GoTo here (and I should do the same instead of modifying the default GO scripts for my game)?
If I want to release the script for public, I would like to stick how the default script works without changing anything. It's for a Sake of Compatibility. If I only want to use the script for myself. I don't mind to overwrite anything. It depends on what I'm aiming for.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
First Language
English
Primarily Uses
RMVXA
Great!  I'm only planning to change the gameover scripts for this one game and I feel like it would be hard to make "customizable" in a way that anyone could use for their own game, so I'll stick with modifying all gameover activations to use Call instead of GoTo.

I really appreciate your help with figuring this out! :)

I'm marking the thread Solved as I believe I now have a good answer to what I needed to know.  But if anyone can give any additional insight on the matter, I'd love that, too.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,047
Members
137,569
Latest member
Shtelsky
Top