Run a file from Ge game

Non-platform specific questions.

Run a file from Ge game

Postby tzoli » Mon Mar 14, 2011 4:42 pm

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)
Creepers are capable of climbing ladders, despite lacking arms. (Minecraft wiki)
User avatar
tzoli
 
Posts: 343
Joined: Sat Jun 12, 2010 6:54 pm
Location: Behind you
Score: 15 Give a positive score

Re: Run a file from Ge game

Postby MrJolteon » Mon Mar 14, 2011 5:29 pm

LoadGame("FileNameHere");

Works only with GE files
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Run a file from Ge game

Postby tzoli » Mon Mar 14, 2011 5:32 pm

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 :()
Creepers are capable of climbing ladders, despite lacking arms. (Minecraft wiki)
User avatar
tzoli
 
Posts: 343
Joined: Sat Jun 12, 2010 6:54 pm
Location: Behind you
Score: 15 Give a positive score

Re: Run a file from Ge game

Postby MrJolteon » Mon Mar 14, 2011 5:43 pm

Yep

I think it works with any .exe, but I'm not sure.
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Run a file from Ge game

Postby Camper1995 » Mon Mar 14, 2011 6:15 pm

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
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Run a file from Ge game

Postby Game A Gogo » Mon Mar 14, 2011 8:32 pm

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?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: Run a file from Ge game

Postby tzoli » Tue Mar 15, 2011 7:03 pm

Always write this:
The "farmer.dat" isn't a valid game
Creepers are capable of climbing ladders, despite lacking arms. (Minecraft wiki)
User avatar
tzoli
 
Posts: 343
Joined: Sat Jun 12, 2010 6:54 pm
Location: Behind you
Score: 15 Give a positive score

Re: Run a file from Ge game

Postby lcl » Tue Mar 15, 2011 8:18 pm

You have to export it as .dat-file first.
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score

Re: Run a file from Ge game

Postby Camper1995 » Tue Mar 15, 2011 8:50 pm

tzoli wrote:Always write this:
The "farmer.dat" isn't a valid game
:roll:
Say hello to my little friend.
User avatar
Camper1995
 
Posts: 707
Joined: Tue Dec 30, 2008 7:20 pm
Location: Lost in the past.
Score: 44 Give a positive score

Re: Run a file from Ge game

Postby Game A Gogo » Tue Mar 15, 2011 9:21 pm

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");"
}
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest