Saving each instances to a form of data?

0 favourites
  • 6 posts
From the Asset Store
Match the similar cards with each other and free all animals!
  • Hi guys me again <img src="smileys/smiley1.gif" border="0" align="middle" />. Im trying to make a advanced level editor kinda thing to share with the community.

    Basically I need to know how to save each instance to a string or something so i can then send the data to my server and retrieve it on command :).

    So is there a way to convert each instance into one whole piece of data?

  • loop through them and build some string like

    foreach Sprite
      set save to save&sprite.X&","&Sprite.Y&","&Sprite.Angle&","&Sprite.AnimationFrame&","&Sprite.instancVar1&newline

    It's a bit like the replay thing I did a while ago

  • Yann, Yeah i had a look at that thread, Very informative. But you used tokenat() right?

    So lets break this down <img src="smileys/smiley1.gif" border="0" align="middle" />

    I need a global var called text, its a string. I get that,

    I get most of the second line aswell except: "&Sprite.instancVar1 what is instanceBar1?

  • Whatever instance variable you feel like saving

  • Oooooooh I see [:0] Thanks guys!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • tokenat let you retrieve each part of the string. you can locate a part (token) thanks to an index and a separtator.

    In our example, each object can be retrived thanks to the 'newline' separator

    And each data of an object (once you retrieve the line) thanks to the "," separator.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)