How do I save object state and load it?

Get help using Construct 2

Post » Wed May 10, 2017 8:59 am

Hi, i'm working on multiplayer game ( like clash royal ) and i need to save objects state ( position, some instance variable and ... ) when host disconnect .

how i can save these things and load ( create objects and set their instance ) ?

what the best way ? Json ? array ?

best regards,
B
10
S
3
Posts: 180
Reputation: 1,212

Post » Wed May 10, 2017 5:09 pm

If it is only object properties and not e.g. behavior-related values, you can simply export the current object's state via the object expression [objectname].AsJSON.

You can save this with LocalStorage, Browser Invoke Download or NW.js filesystem.
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests