99Instances2Go's Forum Posts

  • goto Array.at( floor( random(0,Array.width) ) )

  • Also, this works when there are just no instances of 'object'. Your rules apply also in that situation. But you can not compare non existing objects. You would not catch that exception.

  • Object > Compare instance variable > var .. Equal to .. 4 <--- picks all instances of Object with var= 4

    ________(no actions)

    Else <--- when that previous picklist is empty, parent condition is untrue, so the else runs

    _____Create Object somewhere

    _____set var to 4

  • UberLou

    It is just how it works. C2 is mostly about picking.

  • Magistross

    That is a new construction 4 me, ty for sharing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nothing fancy, just the basics.

    https://www.dropbox.com/s/0tngi3me11188 ... .capx?dl=0

  • The actions run, as explained in the manual here:

    https://www.scirra.com/manual/75/how-events-work

    There is just no object picked.

    This is a the logic (not a workarround) if you would insist using 'OR' in a picking situation.

    https://www.dropbox.com/s/0fb3727hnew5r ... .capx?dl=0

    Personal i never us 'OR' when picking.

  • Besides that i doubt that such a chain 'Pin A to B & pin B to C' actual will work Pin Wise ....

    Making that chain is easy ....

    System > For > name = "i" .. start = zero ... end is Sprite1.count - 1

    System > Pick nth instance > object = Sprite1.. Instance = loopindex("i")

    System > Pick nth instance > object = Sprite2.. Instance = loopindex("i")

    System > Pick nth instance > object = Sprite3.. Instance = loopindex("i")

    ______________actions > Pin Sprite1 to Sprite2

    ______________actions > Pin Sprite2 to Sprite3

  • Well, you feed only 1 enemy to the function, while there are more of them in the picklist.

    https://www.dropbox.com/s/s3ncphroda3b6 ... .capx?dl=0

  • Done

    Thank you for all that work, must been days to do all that.

  • Hosting the plugin on my DropBox, because original link seems broken.

    ***removed lnk***

    Referring to :

  • Hosting the plugin on my DropBox, because original link is broken.

    https://www.dropbox.com/s/60xzyzmopvxuq ... y.zip?dl=0

  • You obvious need the concept of a trigger, that is what you did find out yourself too.

    Else, at the speed they 'run', they overlap 2 ticks, resulting in rotating twice 90 degrees (or 180 degrees).

    You noticed that, and that is why you used 'trigger once while true'.

    I backed initial off from an explanation because i have a little problem that i can not explain. You used a 'trigger once' as a lonely condition. You can never do that. Because it works this way ... >

    When the event is true, it runs the actions. Then it waits till the event is untrue, in the mean while it will not run the action. While the event is untrue, it will obvious run no actions. The next time the event is true, it will run the actions, and then it waits again.

    Or: It runs the actions only once when that event is changing from untrue to true. Hence 'Trigger ONCE while true'.

    Now, a lonely 'trigger once' runs once, and after that 'once' this event can not ever be set untrue again. Hence you need to start such a event with a condition that can be changed from true to untrue to true ... and so on, to make the (second condition) 'once while true' work.

    I can not explain why it runs its action in that sub event, that you made, at this moment. That has me puzzled. So, you might not learn from the best in this.

    What i can i explain is why a 'trigger once' does not work as you expect when paired up with a picking condition. A Picking condition ( like 'Is (A) overlapping (B)' ) is ONLY untrue when the picklist is empty.

    So.

    The game starts with everything empty.

    The first tick that they overlap, the resulting picklist from that overlap is not empty. That makes the condition true. Since the condition flips from untrue to true, the 'trigger once' allows the actions to run. The blue dot in the left/down corner is changing angle. The next tick, the resulting picklist from that overlap is not empty due the overlaps on the right side. The condition is true (no empty picklist), so there is no flip from untrue to true, and the 'trigger once' is not allowing the actions to run. This means that non of those blue dots get a rotation. Since they are just moving the same path, the overlap is still true in the next tick. And will still be true as long as they overlap. There is no flip from untrue to true happening, as a result the 'trigger once' will not allow the actions.

    Once those blue dots on the right are out of the overlapping situation, the resulting picklist finaly gets empty. The condition is now untrue. At that the moment a blue dot on the left overlaps, the picklist is not empty, the condition is true and there is a flip from untrue to true happening. Hence the 'trigger once' can do its job. And so on ....

    And from this point, everything works as you expect.

    So now, it is clear that this 'trigger once' can not do the job. Yet, we desperately need a trigger.

    Well, on collision is a trigger. All conditions that start with 'on' are triggers.

    WHEN the collision happens, IT PICKS the colliding objects, the actions work purely on the picked objects. And, when you have 5 object colliding at the same time, it triggers ONCE for each object.

    The rest is just making sure that the angles can not shift due little floating point errors. Your setup is really tight.