How do I make a multiple users menu?

Just started using Construct 2? Post your questions here

Post » Fri Jan 20, 2017 9:49 am

Message: Eln can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Hello! New C2 user here. :-)
I would like to make a start menu for multiple users, like this:
https://drive.google.com/open?id=0B_DxiYdRG7pQREdlSnhHRXd5dk0

And these are my actions (“Utente” is the Italian word for “User”, btw):
https://drive.google.com/open?id=0B_DxiYdRG7pQUHpld3k5UHp2b2M

Now...if there’s not a save file slot yet, is the “on load failed” event right? I can’t test this part because I still don’t understand where the program puts the save slots on the hard drive!
And how do I erase the save slot (with the classic “trash” icon) if an “erase save” action doesn’t exist?

Thanks in advance! :)
B
5
Posts: 12
Reputation: 254

Post » Fri Jan 20, 2017 3:35 pm

Personally, I would store this data in a Dictionary. A Dictionary is used to store and re-call data which you can identify with a 'key' - a unique identifier. In this case, I would make your 'key' be the Player's name (so long as another player hasn't already used that name of course!), and in the value I would store 'SaveStateJSON'. The value 'SaveStateJSON' is only available in events called by the condition 'On save complete', and represents the snapshot of the game that is created for a save fil.

You should then use Local Storage to hold the contents of the Dictionary, so that it can be recalled at a later date. Local Storage is worth getting your head around - but I would advise reading the complete manual entry on the subject before moving forward with it. A lot of questions about LocalStorage posted on here can be fixed by actually reading the manual - it is not entirely as straightforward as it seems!

https://www.scirra.com/manual/188/local-storage
The LEVEL GENERATOR TOOLKIT



24 functions dedicated to producing randomly generated terrain for all kinds of games.
B
25
S
7
Posts: 242
Reputation: 2,306

Post » Mon Jan 23, 2017 9:02 am

Okay, I'll give the Dictionary/Local Storage a try, thank you very much!
B
5
Posts: 12
Reputation: 254


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest