Page 1 of 1

Run a file from Ge game

PostPosted: Mon Mar 14, 2011 4:42 pm
by tzoli
Hi!
How can I run a file from Ge game?
A made a menu and if we click on Start game the menu program close(i made it) and the game open((exe or linux file)here is the problem...I don't know how can i make it)

Re: Run a file from Ge game

PostPosted: Mon Mar 14, 2011 5:29 pm
by MrJolteon
LoadGame("FileNameHere");

Works only with GE files

Re: Run a file from Ge game

PostPosted: Mon Mar 14, 2011 5:32 pm
by tzoli
with GE exe files too?
(corect this bad post system...If i want to write anything in the post i must write anything in the title delete and only now cani write :()

Re: Run a file from Ge game

PostPosted: Mon Mar 14, 2011 5:43 pm
by MrJolteon
Yep

I think it works with any .exe, but I'm not sure.

Re: Run a file from Ge game

PostPosted: Mon Mar 14, 2011 6:15 pm
by Camper1995
Yeah. Don't forget you can do it with .dat files too. For example: You have a main menu for a game (exe file)... then when click PLAY
Code: Select all
LoadGame("game1.dat");

or
Code: Select all
LoadGame("\levels\world1\level1.dat");

like this. You don't need to have exe's because people can open them. Nobody will be able to open .dat file. :wink:

(or if you are running the game in Game editor, so not EXE, you can do:
Code: Select all
LoadGame("game.ged");
)
I hope it's more clear now to you.

Have a nice day,

Camper

Re: Run a file from Ge game

PostPosted: Mon Mar 14, 2011 8:32 pm
by Game A Gogo
MrJolteon wrote:Yep

I think it works with any .exe, but I'm not sure.

It works only with anything exported from GE, but not others since this will not load the entire program, but the data part, why load the game engine twice?

Re: Run a file from Ge game

PostPosted: Tue Mar 15, 2011 7:03 pm
by tzoli
Always write this:
The "farmer.dat" isn't a valid game

Re: Run a file from Ge game

PostPosted: Tue Mar 15, 2011 8:18 pm
by lcl
You have to export it as .dat-file first.

Re: Run a file from Ge game

PostPosted: Tue Mar 15, 2011 8:50 pm
by Camper1995
tzoli wrote:Always write this:
The "farmer.dat" isn't a valid game
:roll:

Re: Run a file from Ge game

PostPosted: Tue Mar 15, 2011 9:21 pm
by Game A Gogo
you could do:
Code: Select all
if(fopen("farmer.dat","r+b"))LoadGame("farmer.dat");
else
{
    //Display an error to the user here or you could do "LoadGame("farmer.ged");"
}