dop2000's Recent Forum Activity

  • It's hard to troubleshoot without the project file. "For each devices" with the condition where you check for ObjectTypeName should work.

    Where and when do you run this event? Instances in C3 are not created immediately, sometimes you need to wait until the end of the tick to be able to access them from other events. If this is the case, add "Wait 0" before running that event.

    I suggest debugging such issues using Browser Log action. For example:

    For each devices : Browse Log "Iterating devices UID=" & devices.UID
    
    .. devices.ObjectTypeName="foo" : "Picked device:"&devices.ObjectTypeName
    
    etc.
    

    Open the browser console and check the messages there.

  • This is the fourth time you are asking the same question. Please read this post:

    construct.net/en/forum/construct-3/how-do-i-8/best-help-tips-forum-139528

  • There is an official example in C3:

    editor.construct.net

  • You do not have permission to view this post

  • I don't understand the problem. You can still pick family instances by object name. And use Family.ImagepointX/Y

  • I am using dictionaries.AsJSON inside of arrays, and then the arrays are stored as JSON inside another array

    It's a very inefficient way to store data, like you said escaping " with backslashes is probably making 80% of the entire string. I don't think compressing the string with zlib will magically reduce its size from 30KB to 1KB. I suggest you change the way the data is stored. Use just one array or JSON. Don't nest JSONs inside of JSONs inside of JSONs.

    In this game many thousands of objects are stored in a single JSON file. I'm using a string like this, which is pretty compact and easy to read:

    {
     "island1": {
     "objects": [
     {"o": "Tree,animationname","x": 100,"y": 200},
     {"o": "Rock,animationname","x": 405,"y": 112}
     ]
     },
     "island2": {...}
    }
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It depends on how levels are built in your game and what information you need to store in the string. For example, if there are three object types players can place on a 50x30 grid, then you can encode the entire grid into a string 1500 characters long, where letters A-C represent an object and a dot represents an empty cell:

    A.A...BAC.....A.B..CBB.ABC.CCB....

    Another totally different approach is to upload the string to an online service like Pastebin.com

    When you upload a string, you get a unique URL, which can be used to download this string. So people can share and exchange URLs in Discord, instead of full strings.

    Both uploading and downloading from Pastebin can be done with AJAX.

  • One thought is to put all my sprites into a family and then trying pick last created [family]

    This is the right method, I use it all the time.

    I tried doing a for loop from 0 to family.AllChildCount but this only returned a single iteration of the loop. It is not properly counting (or detecting) the family's children.

    AllChildCount expression is related to hierarchies. Family "children" are usually called members, and unfortunately there is no way to get a list of all family members in events. You can make your own list of members, for example with an array.

  • oosyrag haha, I too still learning basic things about Construct. A few weeks ago someone told me that the default order of instances is based on their zIndex, not on their UID or the order they were added to the layout. I always thought that an instance with IID=0 is the instance with the lowest UID. (facepalm)

    By the way, the order of conditions is especially important when using "For each" loops. I prefer picking the instances first, then iterating them, I believe it's better for performance:

    Enemy is on screen
    Enemy is overlapping Zone
    For Each Enemy 
    ......
    
  • I believe you can echo this variable in the php. And then in your Construct project you will be able to get it in the AJAX response. Use "On AJAX completed" event and AJAX.LastData expression should contain that value.

  • You can set the layer as Global, then all objects from it will appear on all layouts where you add a layer with this name.

    Another option is to use hierarchies. Select all objects of the help window, right-click on the parent object (for example WindowBackground sprite) and add all other objects to the hierarchy. Then you will be able to create the entire hierarchy in runtime - WindowBackground will be created with all its children. This way you can store the whole help window on an unused layout and only spawn it when needed.

    I actually have a separate layout "DialogueAssets" in my project with dozens of hierarchies for different menus, dialogue and popup windows etc.

  • The order of conditions in an event is important. This will check the condition once, and if it's true, repeat the loop 10 times:

    Condition
    Repeat 10 times
    

    This will repeat the loop 10 times, every time checking the condition:

    Repeat 10 times
    Condition
    

    You can also use sub-events to make it more clear:

    Repeat 10 times
    ... // sub-event
    ... Condition
    
dop2000's avatar

dop2000

Member since 26 May, 2016

Twitter
dop2000 has 279 followers

Connect with dop2000

Trophy Case

  • 10-Year Club
  • Entrepreneur Sold something in the asset store
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Forum Wizard Made 5,000 posts in the forums
  • Forum Unicorn Made 10,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • x3
    Quick Draw First 5 people to up-vote a new Construct 3 release
  • x14
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

30/44
How to earn trophies