Launching an AGS game within an AGS game...

Started by Snake, Mon 08/10/2007 13:18:39

Previous topic - Next topic

Snake

Sorry to be a pain in the ass here, but I can't for the life of me remember or find the command to launch an AGS game from within one.

Was it ever not implemented and I just missed it?

Thanks in advance,


--Snake
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Akatosh

If I may quote the manual...

Quote
RunAGSGame
RunAGSGame (string filename, int mode, int data)

Quits the current game, and loads up FILENAME instead. FILENAME must be an AGS game EXE or AC2GAME.AGS file, and it must be in the current directory.
MODE specifies various options about how you want to run the game. Currently the supported values are:

0   Current game is completely exited, new game runs as if it had been launched separately
1   GlobalInt values are preserved and are not set to 0 for the new game.

DATA allows you to pass an integer through to the next game. The value you pass here will be accessible to the loaded game by it reading the game.previous_game_data variable.
The save game slots are shared between the two games, and if you load a save slot that was saved in the other game, it will automatically be loaded.

Bear in mind that because the games must be in the same folder, they will also share the music.vox, speech.vox and so forth. This is a limitation of this command.

NOTE: The game you run will be loaded at the same resolution and colour depth as the current game; if you mismatch colour depths some nasty results will occur.

NOTE: Make sure that the game you want to run has a filename of 8 characters or less, or this command will fail in the DOS engine.

NOTE: The game you want to launch must have been created with the same point-version of AGS as the one you are launching it from. (version 2.xy - the X must be the same version between the two games).

Example:

RunAGSGame ("MyGame.exe", 0, 51);

will run the MyGame game, passing it the value 51.

Of course, that command is of limited use... I think DemoQuest had a Launch Minigame function, didn't it?

Snake

You may and thank you very much.

Blargh, missed it when looking through all of the commands! I wish I had seen it so I didn't have to post a thread here.

Thanks again, Akatosh,


--Snake
Grim: "You're making me want to quit smoking... stop it!;)"
miguel: "I second Grim, stop this nonsense! I love my cigarettes!"

Akatosh

You're welcome, it's not that bad if you forget an obscure command like that  ;)

Radiant

Out of curiosity - what is it you're planning to do? Because for the live of me I can't think of a purpose for this command...

m0ds

Surely it can be used to load a game split into various exe parts? I've often wondered how to do this.

Is there a way to launch a non AGS game exe within AGS? Perhaps that's just stupid, since a game generally isn't in a window. But again something useless and interesting to know.

This is also in the wrong forum snake, but cos I'm interested now, I'll leave it here for a while :p

Radiant

Quote from: m0ds on Mon 08/10/2007 14:29:58
Surely it can be used to load a game split into various exe parts? I've often wondered how to do this.
I suppose. But why would you want to split a game into various exe parts to begin with?

m0ds

#7
For games released in chapters, I would've thought. Well, maybe there is some sneaky trick that already does it - I've never played a game broken into chapters before, but I'd assume once you get the next chapter, then the next, playing from the first again you're just instantly taken into the new part(s) you've got, without you having to exit and re-load and stuff.

The Book of Spells could all be linked up :D

Rui 'Trovatore' Pires

The book of spells HAS been linked up, and I think it was like that. :D

Another use would be to do a stunt like DoTT, where you could play Maniac Mansion.

And maybe the game can run ITSELF. So you can further extend the gag and have a computer in which the player character can play the game, isn't this what Al Emmo did?

Anyway, it's mostly for humouristic gags like this. For serious porpuses, division into chapters, sure. You could even use it to split the game-making process - each person or team of persons does a specific part of the game. Then they all get put together.

Actually, that might work pretty neatly as a competition or an event of some sort. Hmmm...
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

radiowaves

#9
In order to progress in the game you would have to step back and so you have to play it all again, inside a game. Sort of a time travel! Nice idea!
So basically it can be taken quite far. Multiple storylines etc. You could change your inventory items with past or future events.
And ofcourse a nice loophole. Game inside a game inside a game inside a game...
I am just a shallow stereotype, so you should take into consideration that my opinion has no great value to you.

Tracks

Rui 'Trovatore' Pires

Not if you make careful use of variables... although it's a point. :P So non-sequential gaming is rather out.

...bleh, come to think of it, it was just a silly idea.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Radiant

Quote from: radiowaves on Mon 08/10/2007 19:30:20
In order to progress in the game you would have to step back and so you have to play it all again, inside a game. Sort of a time travel! Nice idea!
So basically it can be taken quite far. Multiple storylines etc. You could change your inventory items with past or future events.
Yes, but running an AGS game from within itself sounds approximately like the worst way of implementing this :P

ciborium

The only thing I can think of is if you have a game with a huge number of rooms.

Even if released all at once, it might be broken into two 250 room games...

I read somewhere that only the first 300 rooms are state saving.

LUniqueDan

While we're there, just wondering...
Is there any actual AGS-released who ever use more than 200 rooms?
(including close-ups and other trickeries?)
"I've... seen things you people wouldn't believe. Destroyed pigeon nests on the roof of the toolshed. I watched dead mice glitter in the dark, near the rain gutter trap.
All those moments... will be lost... in time, like tears... in... rain."

MillsJROSS

Perhaps if you want to release a chapter like version of a game, and make it so it can be played in sequence, or separately.

Perhaps you want to release a collection in one mega-pack where the games where created separately. I don't think this is a bad command, just a command that will rarely be used.

-MillsJROSS

RickJ

It's useful for doing chapters as MillsJROSS says and also for doing side arcade type games.  Arcade type games many times end up with much of their code in the global script and make heavy use of repeatedly_execute() handler.  Moving those things to a separate EXE makes a lot of sense and keeps both EXEs much cleaner than if they were combined.  In addition the Arcade game can be made such that is directly playable without going through the main game. 

   

Radiant

Quote from: LUniqueDan on Tue 09/10/2007 01:44:02
While we're there, just wondering...
Is there any actual AGS-released who ever use more than 200 rooms?
Not to my knowledge. And if there are, chances are that many of the "physical rooms" are actually handled by the same "logical room" (for instance, ATOTK has a rather extensive ocean, but all of that is done in Room55.crm).

Quote from: RickJ on Tue 09/10/2007 08:40:38
Arcade type games many times end up with much of their code in the global script and make heavy use of repeatedly_execute() handler.  Moving those things to a separate EXE makes a lot of sense and keeps both EXEs much cleaner than if they were combined.
(devil's advocate) isn't that what the various separate scripts and header files are for?

Okay, I can see people can conceive of a use for this, but I'm wondering how many of these conceptions have been used, ever, in practice :P

MrColossal

I used it in Time Out [cough cough] I made the intro and then started working on the actual game in a separate exe. I call the intro exe from within the main game when you choose the intro option on the menu.

This way I was able to distribute the Intro as a sort of teaser for the main game and then just release the main game.

I just haven't gotten around to that last part yet!
"This must be a good time to live in, since Eric bothers to stay here at all"-CJ also: ACHTUNG FRANZ!

SMF spam blocked by CleanTalk