How do I load game on start of layout invisible

Get help using Construct 2

Post » Sun Jun 18, 2017 1:17 pm

hi, how do i condition when user run first time game layout should not display load button (because load state dont exist)
but when user save state during game and reload game on menu load button should be visible ?
B
10
S
2
Posts: 42
Reputation: 717

Post » Sun Jun 18, 2017 1:26 pm

If you are using local storage to keep the saves, on start on layout you can add a sub event that checks if a key exist in storage, if it does not reposition the load button somewhere out of the canvas like -200,-200.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Sun Jun 18, 2017 1:32 pm

Set the button invisible by default. Then use a variable test canLoad=false. Set canLoad=true when save game exists and use an event that tests canLoad and when true set button to visible. You can also use the same variable to enable/disable the button in case player can still click where it is hidden and activate it.

You can also simply spawn the button at the coords you want, or move it on and off screen as needed instead of using invisible.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
71
S
19
G
8
Posts: 640
Reputation: 9,701

Post » Sun Jun 18, 2017 1:36 pm

imhotep22 wrote:If you are using local storage to keep the saves, on start on layout you can add a sub event that checks if a key exist in storage, if it does not reposition the load button somewhere out of the canvas like -200,-200.


im using Scirra save and condition 'load save from slot 'mysave'' but not local storage
B
10
S
2
Posts: 42
Reputation: 717

Post » Sun Jun 18, 2017 1:56 pm

chrisinfinger wrote: Set canLoad=true when save game exists and use an event that tests canLoad and when true set button to visible.



How make this condition?
because in system conditions list i dont see this ?
B
10
S
2
Posts: 42
Reputation: 717

Post » Sun Jun 18, 2017 2:10 pm

You can keep a Boolean variable to see if there is a load state or not, but then again the value of the Boolean has to be kept in local storage because how else you will know if there is a load state or not( if you close the game Boolean resets to default value).
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Sun Jun 18, 2017 7:38 pm

imhotep22 wrote:You can keep a Boolean variable to see if there is a load state or not, but then again the value of the Boolean has to be kept in local storage because how else you will know if there is a load state or not( if you close the game Boolean resets to default value).

any tips how do this in event sheet?
B
10
S
2
Posts: 42
Reputation: 717

Post » Sun Jun 18, 2017 9:38 pm

Add the storage plugin to your game( its already in c2 you don't have to download anything).

Then when the players presses the button to save the game add 2 extra actions, one toggle the Boolean from false to true, or if its an number toggle it from 0 to 1, then as another action select the local storage -> set item, add a key and the variable you wish to save.

When all of this is done, on layout load check storage item for item(key) exits if the key exits then move the load button where ever you want it.

Here how I did it on my game Confusion which you can find on the arcade

https://s18.postimg.org/leeze1cft/Screenshot_8.jpg
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Tue Jul 04, 2017 8:38 pm

https://www.dropbox.com/s/my773lmz733ez ... 3.png?dl=0

can you take look at this?

On my side dont work,



imhotep22 wrote:Add the storage plugin to your game( its already in c2 you don't have to download anything).

Then when the players presses the button to save the game add 2 extra actions, one toggle the Boolean from false to true, or if its an number toggle it from 0 to 1, then as another action select the local storage -> set item, add a key and the variable you wish to save.

When all of this is done, on layout load check storage item for item(key) exits if the key exits then move the load button where ever you want it.

Here how I did it on my game Confusion which you can find on the arcade

https://s18.postimg.org/leeze1cft/Screenshot_8.jpg
B
10
S
2
Posts: 42
Reputation: 717

Post » Wed Jul 05, 2017 11:20 am

On item exist is only trigger when you check for certain key, you need to add on start of layout -> local storage -> check item -> safe exist.

See the screenshot I send you, on it first I check if my 3 keys exist, and if they do I load the saved values from them, if you don't check for key the item exist will not trigger.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests