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:

And these are my actions (“Utente” is the Italian word for “User”, btw):

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! :)
Posts: 19
Reputation: 268

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!

24 functions dedicated to producing randomly generated terrain for all kinds of games.
Posts: 245
Reputation: 2,314

Post » Mon Jan 23, 2017 9:02 am

Okay, I'll give the Dictionary/Local Storage a try, thank you very much!
Posts: 19
Reputation: 268

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests