HELP How can I execute a command from a game that switches me to another game?

Started by BowsetteGamer, Tue 03/01/2023 19:14:18

Previous topic - Next topic

BowsetteGamer

Let me explain, I want to create a game menu that when I press start the game, I am transported to the real video game, I would like to know if that can be done, it is to save me the guis and have to create things within the game, I want to know if it is possible to do an external game menu  ??? 

eri0o

Can you explain a bit more of what you are trying to do, why and what you want to achieve?

Technically an AGS game can run another AGS game, just not sure if this is the question.

Khris

It sounds like you're describing a launcher?
Since an AGS game is just an .exe file (in the context of a launcher) this is not really a question about AGS, more one about creating a Win32 GUI app with a "run exe" button I guess.

Edit:
Creating a 2nd AGS game with sprites and GUIs to launch the actual game so you don't have to include the launcher resources into the main game sounds like bollocks to me so has to be a translation issue.

Crimson Wizard

I'm too not quite certain about the reasons, but there's RunAGSGame function that lets to run another AGS game from the first one (and so forth): https://adventuregamestudio.github.io/ags-manual/Globalfunctions_General.html#runagsgame

heltenjon

Interesting command. So I guess one could use this to fuse a game made in chapters or make a compilation of shorties, for example? (Apropos of nothing, the interactive fiction Annual Competition usually has a Frame game in which the player may choose which other game to play, but they may also be run normally, using whatever interpreter it's made with.)

BowsetteGamer

Quote from: eri0o on Tue 03/01/2023 19:39:10Can you explain a bit more of what you are trying to do, why and what you want to achieve?

Technically an AGS game can run another AGS game, just not sure if this is the question.
well I have 70% of the game finished; When I started it, I didn't consider putting a game menu on it, but I wanted the game to start at once and that's it, and the fact is that since I already have the game done, if I start making the menu it would be complicated for me, so I thought and if I make a game that works as a menu and then I program it so that the menu game closes and runs the real game, and well I was wondering if that was possible

BowsetteGamer

Quote from: Khris on Tue 03/01/2023 20:02:36It sounds like you're describing a launcher?
Since an AGS game is just an .exe file (in the context of a launcher) this is not really a question about AGS, more one about creating a Win32 GUI app with a "run exe" button I guess.

Edit:
Creating a 2nd AGS game with sprites and GUIs to launch the actual game so you don't have to include the launcher resources into the main game sounds like bollocks to me so has to be a translation issue.
exactly as you described is what I'm trying to do, but listen, it's not nonsense, it's that there are many things that I don't understand about the ags engine and I'm working on a game that I really like and I'm doing it with my own content, it's not a translation error, in fact this is my first post since most of the things I've done in the game is based on the documentation that the engine gives you but it's in English and I don't understand much English, I already discovered that the command is runAGSgame, the question I now have is, what function does data fulfill, that is, does it know that it is:

RunAGSgame ("Mygame.exe", 0, 51);

"51" represents the data but what function does it have there, is it optional, what is that?

BowsetteGamer

Quote from: heltenjon on Tue 03/01/2023 22:06:57Interesting command. So I guess one could use this to fuse a game made in chapters or make a compilation of shorties, for example? (Apropos of nothing, the interactive fiction Annual Competition usually has a Frame game in which the player may choose which other game to play, but they may also be run normally, using whatever interpreter it's made with.)
Exactly that was what I thought, to merge so that the programming work does not present errors or anything like that, and thus you can put other things on them and work unitarily in each part of your game without having to specify everything in the same game. Let's say that we are making 5 Age of Empires maps, in ags, imagine putting the 5 maps in a single game, now if you have a menu you will create a selector and it will be easier for you.

BowsetteGamer

Well thank you very much to everyone, those who helped me with the command, I began to test and test with RunAGSgame and the results were what I expected, Thank you "Crimson Wizard" for helping me, but I have a question "what is the data in this command?", which is the "51" that is expressed to me in the dynamic help of AGS and the data is necessary, is it optional, what is that for?

What I'm looking for is that one game functions as a menu and the other is the game as such without any functions, attributes or anything like that for the original game because all that is in the original game, the menu is just a menu and it executes the another game

glurex

Quote from: BowsetteGamer on Wed 04/01/2023 03:31:25
Quote from: eri0o on Tue 03/01/2023 19:39:10Can you explain a bit more of what you are trying to do, why and what you want to achieve?

Technically an AGS game can run another AGS game, just not sure if this is the question.
well I have 70% of the game finished; When I started it, I didn't consider putting a game menu on it, but I wanted the game to start at once and that's it, and the fact is that since I already have the game done, if I start making the menu it would be complicated for me, so I thought and if I make a game that works as a menu and then I program it so that the menu game closes and runs the real game, and well I was wondering if that was possible

Maybe I'm not understanding well. But what's the problem with make a new room with the game menu? You have to set the player (and make it invisible) to start in that room and in the Start option of the menu telport that character to the first room (where your game starts, and make player visible again if needed).

Khris

That's what I was afraid of: you want to do this because you don't know that there's a much easier way.
Maintaining two games and publishing two exes just because you want to add a title screen to a 70% finished game is also bollocks :)

Also, the data parameter is explained right inside the manual entry you mention:
QuoteDATA 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 51 is just an example value.

Anyway, this is known as the xy problem.
Instead simply ask "I have a game that is 70% done, how do I add a title screen to it?"

Matti

Khris is right.

As Glurex said it's quite simple to add a menu: You only need a new room, a GUI, and a few small functions in the global script for the different buttons: Continue, New Game, Quit.. Nothing else needs to be added to the game.

heltenjon

Hmmm...I meant my comment above not as an explanation to the IP, but more as a question about when this command will be useful; what is it intended for? Sorry if it was misleading for you, BowsetteGamer!  :-[

I can think of three instances, but they may not what the creators of the command had in mind:

1 and 2: If I already have several games made, and they are too small to release separately, or if they have been released as chapters and I want to merge them.

3. If multiple devs work on different parts of a story and wants to merge them into one game.

Will the command be useful for that, or will it be a false friend?

BowsetteGamer

Quote from: Khris on Wed 04/01/2023 09:08:42That's what I was afraid of: you want to do this because you don't know that there's a much easier way.
Maintaining two games and publishing two exes just because you want to add a title screen to a 70% finished game is also bollocks :)

Also, the data parameter is explained right inside the manual entry you mention:
QuoteDATA 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 51 is just an example value.

Anyway, this is known as the xy problem.
Instead simply ask "I have a game that is 70% done, how do I add a title screen to it?"

Kris obviously read the manual, that's where I got the doubt, what I was referring to is:
 there is 51 (apart from obviously being an example), the question is what is that "51", because I can put "0" and that's it, but how does the game take it, as false, null or create a variable, what I would like to know is; regardless of the number that it puts, what does the number do, I know it is data but it is the section of the file or it is a file called "51", excuse me if I do not understand, the fact is that the manual is there, but there are things that one says ; aha but what happens with this, okay it's DATA and it passes me the files from the old to the new one, but because of the number, it wasn't easier to put "ags.dat" for example there if I understand, but it gives me a numerical value, here's the doubt.
Now I have a question, I know you prefer the in-game menu, I already did that and actually created it in a previous game, that's why I decided to create an external menu. but listen because you are afraid to create 2 games, we can not compress that and create a zip or rar file and upload it to the net, maybe the file will be less heavy and if the player has any doubts, we put a README.txt and that is all


BowsetteGamer

Quote from: glurex on Wed 04/01/2023 05:11:34
Quote from: BowsetteGamer on Wed 04/01/2023 03:31:25
Quote from: eri0o on Tue 03/01/2023 19:39:10Can you explain a bit more of what you are trying to do, why and what you want to achieve?

Technically an AGS game can run another AGS game, just not sure if this is the question.
well I have 70% of the game finished; When I started it, I didn't consider putting a game menu on it, but I wanted the game to start at once and that's it, and the fact is that since I already have the game done, if I start making the menu it would be complicated for me, so I thought and if I make a game that works as a menu and then I program it so that the menu game closes and runs the real game, and well I was wondering if that was possible

Maybe I'm not understanding well. But what's the problem with make a new room with the game menu? You have to set the player (and make it invisible) to start in that room and in the Start option of the menu telport that character to the first room (where your game starts, and make player visible again if needed).

There is no problem with making a menu within the game, the fact is that my game uses many variables, many functions and I don't want to get confused, apart from the fact that it has a large number of characters and I want to make a menu that is pretty decorative and looks good I don't want just the start game and an image downloaded from the net that serves as a background, something good is what I want and that's why I want to do it separately so that everything fulfills a unique function and it can be seen that effort was put into it and it's not just tell story and that's it

BowsetteGamer

Well, regarding the question of the post, it's okay because I will put a title screen inside the game, the case was to create a gui launcher, I don't know if you are thinking that I am doing a graphic adventure, my game is actually an isometric rpg, I'm also remastering virgin interactive's monopoly, and well I still have no idea how to put the command that executes the dice roll, does anyone here know the game "Rome AD92" I've also been creating part of that, actually I'm creating 3 games, they are still in their demo version but they need to be finished, with respect to the rpg it is pure fighting in the demo I have not added a story yet, but the notion of the game is like all rpgs; fighting and adventure and well that's the game I'm trying to make but it has a lot of characters imagine loading one more title on top and making it look aesthetic and work. Something that I like about AGS is that you can also make an Age of Empires, so I would also like to create one, which is why I need the launcher gui.  ;-D

BowsetteGamer

In my opinion there is a big difference between making this menu

and where people when entering the game say: oh my god I want to try this, because there is a great job it is not just to put a start game and that's it.

You have to put decoration, creativity and a nice sound and if you put a retro style on it that's great, and in the background that animations can be seen, but for me that requires a lot of work in the real game so I prefer to create the launcher gui

Cassiebsg

Yes, as everyone already said, just add a room or a GUI to the almost finished game. Much easier to do than creating a new game just to launch the game.

The GUI option is the "easiest" since you can then allow the player to access the menu at any time (like, if you want to add Load/Save/Settings options to it).

Just create a new menu, make it visible from the start, and make sure its set to pause the game. Add a "Start game" button, where all you need to do is hide the menu GUI when you click it, and your game will just start exactly like you want to (since when you hide the menu, the game will be unpaused and start).

EDIT: But you can do a nice cool menu inside the game, it doesn't need to be simple, can be as complicated as you like. I don't see the need for creating a "new game" just so you get a menu. But it's your game, if you want a "game menu" that all it serves is launching the real game, then you're of course free to do so. :)
There are those who believe that life here began out there...

BowsetteGamer

Quote from: Cassiebsg on Wed 04/01/2023 18:16:03Yes, as everyone already said, just add a room or a GUI to the almost finished game. Much easier to do than creating a new game just to launch the game.

The GUI option is the "easiest" since you can then allow the player to access the menu at any time (like, if you want to add Load/Save/Settings options to it).

Just create a new menu, make it visible from the start, and make sure its set to pause the game. Add a "Start game" button, where all you need to do is hide the menu GUI when you click it, and your game will just start exactly like you want to (since when you hide the menu, the game will be unpaused and start).

EDIT: But you can do a nice cool menu inside the game, it doesn't need to be simple, can be as complicated as you like. I don't see the need for creating a "new game" just so you get a menu. But it's your game, if you want a "game menu" that all it serves is launching the real game, then you're of course free to do so. :)
and animations can be added to the gui at different specific points, because I want to add animations to the menu

BowsetteGamer

Quote from: BowsetteGamer on Wed 04/01/2023 18:28:16But you can do a nice cool menu inside the game, it doesn't need to be simple, can be as complicated as you like. I don't see the need for creating a "new game" just so you get a menu. But it's your game, if you want a "game menu" that all it serves is launching the real game, then you're of course free to do so. :)

That is true but the advice that everyone is giving me is good, I just want answers to my doubts as a secondary help to that of the manual, because to be honest there are things that are understood and others not or at least there are doubts about it

SMF spam blocked by CleanTalk