spread values?

This forum is currently in read-only mode.
  • I'm using duplicates of the same object and want to access each object in a fastloop, in mmf i'd use the spread value method to identify each duplicate, how do you do it in construct?

    I've noticed in the properties they are listed as having unique id's, how to you retrieve them through events?


  • There is a function "Name.UID" which gives Universal ID, not everything can use this for ex. Gradient object

  • Spread values are kind of obselete in Construct because you only would use them to fastloop through each instance of an object, and 'For Each' in the system object does this much more easily. If you make the condition 'For Each Sprite', the conditions beneath it and the event actions and subevents are repeated once for each instance of Sprite, each time with just the current Sprite instance picked.

  • I see now. The 'for each' sounds very nice.

    I've tried it but when i try to run the app i get this error

    "Temp.exe has encountered a problem and needs to close. We are sorry for the inconvenience."

    I add a box to the frame,

    I create the condition "always" then action fastloop "fall" no.of boxs amount of loops.

    Then next event condition, on loop "fall", + condition "for each box", then the action set box.y to box.y +1

    Then i get that error.

  • i can confirm it's the "for each" condition causing the error, when i remove it the app runs fine.

  • okay i had them in the same condition box, when i put the "for each" condition into a "sub-event" instead it works fine.

    Can i ask what the difference is?

  • Hey use Edit option ok? Double post is bad, Triple Post is very bad!

    And sub event just mean that the main condition is fulfilled and its own. Its like Loop in a Loop with condition XD.


    Here's example:

    If A is rectangle then Add +1 to score

    and if A is square then Add +1 to score

    So if you have square the score will be 2, if a different rectangle it will be 1, if neither it will be 0.

  • It shouldn't have crashed, can you set it up so it crashes and send the .cap to ?

  • You can download the cap. file here,


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You've misunderstood how to put together a for-each loop - you don't need the other loop at all, for-each works on its own! In the .cap you provided, all you need to do is:

    + For Each Box

    : (actions)

    and that does all the repeating and picking for you automatically, it's really very simple. Still, it shouldn't crash no matter what combination of conditions you come up with, so I'll try fixing that for next build.

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