How do I - wait until all global variables then start layout

Get help using Construct 2

Post » Wed Jun 07, 2017 3:49 am

Hi mates, in the making of my RPG game i realize that when i test it on iPhone the layout of my game starts then a few seconds later loads all my global variables, im looking for a way to wait until all my globals are set then start the Level layout
The case is something like this:

Global HeroHP int 100
Global HeroHPKey Text HeroHPKey is for LocalStorage

So initialize LocalStorage, and assign to HeroHPKey the value HeroHp = 100 with this value set i'm making a HealthBar like HealthBar set With = HeroHp

Now the issue when the Level starts on iPhone it took some seconds until the HealthBar goes from With 0 to 100 and i don't know how to fix this

On my Level Layout
I have "On Start Layout"
Set HealthBar With = HeroHealthBar
And "Everytick"
Set HealthBar With = HeroHealthBar

Thanks in advance
Image

Image
B
16
S
11
G
21
Posts: 16
Reputation: 12,258

Post » Wed Jun 07, 2017 7:17 am

Hi @UlisesFreitas - I've noticed before that iOS devices can sometimes take a few seconds to load in Local Storage data. The way I dealt with this was to load in the data in the previous layout before moving to the new one, or covering the layout with a loading image that is only removed once the data is loaded.

One thing to be careful of is loading Local Storage data in a loader layout. As I understand it (and if I wrong I hope someone sets me straight :) ) if a loader layout has run once it may not run again as the game has already downloaded, so the Local Storage "get" may not be called.
B
16
S
7
G
3
Posts: 395
Reputation: 3,693


Return to How do I....?

Who is online

Users browsing this forum: varr and 5 guests