Load another project from within the game?

Get help using Construct 2

Post » Fri Aug 17, 2012 11:23 pm

Hi there.

I'm making a set of 4 games that are accessed through a common menu.
Is there any way I can make each game a different project and load each project from the same main menu? Would I have to put links to the urls of each game in the menu buttons? Or is there a way to do it more integrated in the projects themselves?

I'd like to avoid putting all 4 games in the same project because of the mess. Unless anybody has a good idea to organize a lot of layouts and event sheets within a project.

Thanks!
B
10
S
2
G
4
Posts: 11
Reputation: 2,726

Post » Sat Aug 18, 2012 12:35 am

I can't help you in this issue, but if you want make a game with many layouts and each one calling a event sheet where you do a different type of game, then, yes, you can call all the games (layouts) by doing a main menu. It helped?
ImageImageImageImageImageImage
B
92
S
19
G
12
Posts: 1,192
Reputation: 18,276

Post » Sat Aug 18, 2012 12:48 am

@ mmarcati

I have an untested way to go about your problem. I was hoping to produce a tutorial about it in the near future if successful. It requires the following:

-That your game be played through an iframe
-All your games are hosted at the same domain
-All games are the same dimension

You first load up the url, which loades up an iframe with a 'Menu' project. Then from inside the project, the player selects the game they want to play. This creates an event to change the url (I.e. change webpage) in the same window as the C2 game (Iframes are like a layer above another webpage). You remain on the same webpage (due to iframe), but the webpage within the iframe changes. If this works, the result is, your first project acts like a menu.

Hope that helps,

-Adam
B
85
S
31
G
14
Posts: 106
Reputation: 16,430

Post » Sat Aug 18, 2012 1:06 am

@TELLES0808, thanks for the response, but that is what I'm trying to avoid . :) I don't wanto to work with a lot of layouts within the same project for organization reasons.

@Andeming That's what I need! :) But it's more complicated than I thought then. That means I can't just use the button on my Main Menu to link to another URL and that's that? What would happen if I did that without an iframe?
B
10
S
2
G
4
Posts: 11
Reputation: 2,726

Post » Sat Aug 18, 2012 9:20 am

@mmarcati

The purpose for the Iframe is really to position the game on your webpage to where you want it. As well as for asthetics.

If you are just running the game and nothing else, having a menu button which changes the webpage for that window/tab, will just change the webpage. Maybe that's all you want. Its worth exporting a small project and playing around with it live on a website.

I think there may still be the limitation of keeping all the games on one domain. If I recall my experience when I tried to call urls external to my domain, I had to use a work around where I would call another url on my domain which then forwarded the client onto an external site. Otherwise it didn't work. But that was several C2 versions ago.

If I get time I'll experiment. Otherwise the best thing to do is just play around with a few simple C2 projects to see if you can change url the way you'd like.
B
85
S
31
G
14
Posts: 106
Reputation: 16,430

Post » Thu Aug 30, 2012 3:11 pm

Thanks, Andemig! That was very helpful! I'll experiment with linking then, and see if it does the trick.

Thanks again!
B
10
S
2
G
4
Posts: 11
Reputation: 2,726


Return to How do I....?

Who is online

Users browsing this forum: Evanetot and 18 guests