How do I load Whole game before play?

Get help using Construct 2

Post » Fri Oct 07, 2016 1:43 am

Hello and thanks for your time.

I am making a huge game that uses Audio, Ajax to load txt files, and a lot of events, actions and variables. The problem is when the game loads the first layout, it loads only visual graphics, leaving what is underground load during the game (such as Ajax files and audio), but these are important for the game to work properly and for the complete game immersion.

So how do I do for the game loads everything before letting the player start?

here is the game(you can see that the Ajax is loading if you put the mouse over one faction and you can't see the description)

https://www.scirra.com/arcade/strategy- ... line-11526

I would also like to ask for a feedback about the game, let me know how I'm doing.
Image
B
12
S
3
G
5
Posts: 9
Reputation: 3,198

Post » Fri Oct 07, 2016 2:49 am

For the stuff like audio preloading and requesting on ajax, be sure to set a variable once the requests complete/audio finishes pre-loading so that the title screen (or when starting the game) actually starts only when said variable meets the expected value?
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 531
Reputation: 19,614

Post » Fri Oct 07, 2016 3:24 am

Nice idea, but how do I set the game to start only when the variable is true? Maybe another layout?
Image
B
12
S
3
G
5
Posts: 9
Reputation: 3,198

Post » Fri Oct 07, 2016 3:33 am

Image
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 531
Reputation: 19,614

Post » Fri Oct 07, 2016 3:46 am

Sorry but this i understood, what comes next is my question. Also this system brings another problem because there are a lot of AJAX requests on my project, so I need multiple text files. Here is a Image to explain:

Image
Image
B
12
S
3
G
5
Posts: 9
Reputation: 3,198

Post » Fri Oct 07, 2016 3:50 am

Image
Chain all of your ajax requests like this. When one finishes, have it's 'on completed' check start a 'queue' and request for the next ajax file you need and so forth. Then with the last AJAX request you have, put the variable change as a check to confirm all of the assets were loaded I put in the previous post up there. Don't allow the game to actually load (such as on player request with pressing start/space) until said variable meets said value.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 531
Reputation: 19,614

Post » Fri Oct 07, 2016 3:51 am

Also, I would recommend pre-loading all of the ajax files and audio before the game technically starters, gameplay wise, such as from the title/first menu screen before starting a new game.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 531
Reputation: 19,614

Post » Fri Oct 07, 2016 4:00 am

Got it, I'll do this.
Image
B
12
S
3
G
5
Posts: 9
Reputation: 3,198

Post » Fri Oct 07, 2016 6:06 pm

To put it all to work properly I had to make some adjustments, as the request of the Array that I had to change Load From Json to Set Value At X and a variable to be true when the last request is completed:
Image

So for each faction I set the corresponding X in the Array:
Image

Then I put a variable "StartSignal" that is true when the audio is loaded and the variable "Request" is 1. While all this does not occur, a Loading text appears on the screen.
Image

To see all this working please take a look at my game -> https://www.scirra.com/arcade/strategy- ... line-11526
If you have a more efficient method, please post a reply.
Thanks LaDestitute for your time and suggestions, it helped me a lot.
Image
B
12
S
3
G
5
Posts: 9
Reputation: 3,198


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests