How do I store multiple object's position, to be created later

0 favourites
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • look at the image. there is one object "A" and above that there are dots. I have set these dots for all A to Z alphabets in my Layout. Now my layout is full of these scattered letters. So is there any way to store them So I can get them as it is later by doing system > create object or something else So i can get whole Letter with their own dots.

    if not possible then any way if i place them in different layout and then get them from that layout?

    my main purpose is to keep clean my Original Layout.

    Note: dots have few variables and each dots have their own values for those variable.

  • You can't get dots from another layout.

    What you can do is save dots for each letter in JSON format in a text file. Then when you need to re-create dots for any letter, you read them from that text file, create dot object and load it from JSON string.

    Something like this:

    // SAVING DOTS FOR ANY LETTER
    For each Dot : 	Set variable s to (s & Dot.AsJSON & newline)
    
    Browser invoke download string s
    // then save it as a text file
    
    
    
    // RESTORING DOTS FOR A LETTER
    // First read the text file into variable s with AJAX
    
    Repeat (tokencount(s, newline)-1) times
    	Create dot
    	Dot load from JSON tokenat(s, loopindex, newline)
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • dop2000 i did this with one letter and got this tooooo many things, I don't know what's going on here. but I noticed some of the values similar to dot's position, size etc.

    {"c3":true,"ivs":{"638163530026166":0,"482238706993632":0},"w":{"x":958,"y":342,"w":45,"h":45,"l":532593044975390,"zi":1},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":1},"w":{"x":933,"y":393,"w":45,"h":45,"l":532593044975390,"zi":2},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":2},"w":{"x":908,"y":444,"w":45,"h":45,"l":532593044975390,"zi":3},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":3},"w":{"x":884,"y":495,"w":45,"h":45,"l":532593044975390,"zi":4},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":4},"w":{"x":859,"y":545,"w":45,"h":45,"l":532593044975390,"zi":5},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":5},"w":{"x":834,"y":596,"w":45,"h":45,"l":532593044975390,"zi":6},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":6},"w":{"x":809,"y":647,"w":45,"h":45,"l":532593044975390,"zi":7},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":7},"w":{"x":784,"y":698,"w":45,"h":45,"l":532593044975390,"zi":8},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":8},"w":{"x":760,"y":749,"w":45,"h":45,"l":532593044975390,"zi":9},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":9},"w":{"x":735,"y":800,"w":45,"h":45,"l":532593044975390,"zi":10},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":10},"w":{"x":711,"y":850,"w":45,"h":45,"l":532593044975390,"zi":11},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":0},"w":{"x":982,"y":393,"w":45,"h":45,"l":532593044975390,"zi":12,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":1},"w":{"x":1007,"y":444,"w":45,"h":45,"l":532593044975390,"zi":13,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":2},"w":{"x":1032,"y":494,"w":45,"h":45,"l":532593044975390,"zi":14,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":3},"w":{"x":1056,"y":545,"w":45,"h":45,"l":532593044975390,"zi":15,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":4},"w":{"x":1081,"y":596,"w":45,"h":45,"l":532593044975390,"zi":16,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":5},"w":{"x":1106,"y":647,"w":45,"h":45,"l":532593044975390,"zi":17,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":6},"w":{"x":1131,"y":698,"w":45,"h":45,"l":532593044975390,"zi":18,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":7},"w":{"x":1155,"y":748,"w":45,"h":45,"l":532593044975390,"zi":19,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":8},"w":{"x":1180,"y":799,"w":45,"h":45,"l":532593044975390,"zi":20,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":9},"w":{"x":1205,"y":850,"w":45,"h":45,"l":532593044975390,"zi":21,"a":5.374463384973052},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":0},"w":{"x":847,"y":717,"w":45,"h":45,"l":532593044975390,"zi":22},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":1},"w":{"x":904,"y":717,"w":45,"h":45,"l":532593044975390,"zi":23},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":2},"w":{"x":961,"y":717,"w":45,"h":45,"l":532593044975390,"zi":24},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":3},"w":{"x":1017,"y":717,"w":45,"h":45,"l":532593044975390,"zi":25},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}{"c3":true,"ivs":{"638163530026166":0,"482238706993632":4},"w":{"x":1074,"y":717,"w":45,"h":45,"l":532593044975390,"zi":26},"data":{"a":442500896777420,"cas":5,"ar":0,"ce":true}}

  • Looks like there is no line breaks between each JSON string. Other than that, what do you worry about? Just create new Dot instances and set them from these JSON strings one by one.

  • this code not working for me

    Repeat (tokencount(s, newline)-1) times

    Create dot

    Dot load from JSON tokenat(s, loopindex, newline)

    no object created

  • and the above json data

    is that also storing dot's angle and variable data?

  • Please post your code or project file.

  • this file

  • I told you in my previous comment that you forgot to insert line breaks between each JSON string. Add line breaks (newline) and it will work.

    For each Dot : Set variable s to (s & Dot.AsJSON & newline)

  • the problem in my events is

    when a download popup comes and i do save it then it doesn't have any data in it

    So i did copy data directly from debug mode.

  • Create another sub-event and move "Browser invoke download" there. It should run after the loop, not inside the loop.

  • is still blank

  • use "Invoke download of string" action.

  • what is MIME type?

  • https://www.google.com/search?q=mime+type

    Just leave it empty

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