The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

I have a game that I want to load, from the menu screen of another game (mini-game)

When I try change_scene() or change_scene_to(), it tries to parse the string path to the current directory.

I've looked into the Directory object in Godot and I get how to call the directory and the items inside. But I don't understand how to opening a whole different game from it's main scene and switch the directory that the initial game is using. I feel like it's simple and something I'm missing, but I can use some help.

Thanks a bunch!

in Engine by (367 points)

1 Answer

0 votes

My question to your question is, why do you want to do that?

by (134 points)

I have a game that I created and then I made another game. I want put them together via the menu screen that I've created in the second game.

Got it. I don't know if you can call another application using GDscript. But you can definitely do it using c# .net library. I suggest you look into it and create a single c# script for this purpose. Export both the games under the same directory and then call the first game by providing the .exe path and close the second game.

This link should Help

I appreciate the solution. I should have made it more clear. I want to still pass variables, such as the outcome of the players progress in the other game. Like score, if they won or lost the game for example. That way in the main game I can use them for other aspects of the game.

I know there is a way to call a directory in Godot, but is there a way to tell Godot to use that directory instead of the one it's currently using?

Yes, you can do that with this method of using a c# .script. You just need to create a json file with all the data before closing the first game... and then use it to copy the data into the second game. This way you'll be able to take all the progress of the first game to the second game.

Gotcha. Godot is my first game engine and first time attempting script, so I've never touched C#. But I'll look into this and let you know how it goes. Thanks for the tip. If it works out, I'll hit best answer.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.