Limit to Push-To-Array per cycle?

0 favourites
  • 5 posts
From the Asset Store
Perfect for your zombie game! Animated from motion capture data Left, Right, Top Down!
  • Hi everyone,

    I'm having object instances push their UID to an array upon spawning (muitiple within a single cycle). But I sem to be getting irregular results, with only two of the instances making it into the array.

    Any idea why that might happen, is there some limitation to the number of pushes or some overwriting issue when doing multiple pushes in a single cycle?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No limit, when your loop iterates to much, the cycle just gets prolonged (drop in FPS).

    Must be your logic. Probably forgot to pick them by UID in the same sub events as the creation sub event. That is ,by the way, the only pick that works before the next root event.

  • I'm seeing that each object type only appears once in the array but there are multiple instances of each type.

    So that points toward what you said, somewhat although I'm not sure I get it:

    To specifiy a little, I have triggers that look up their connected spawn points (SPs hold UID of connected trigger).

    The spawn points then spawn the actual enemy, the enemy registers to that array and the spawn point is destroyed.

    All in a single event:

    Event - On touch of trigger:

    Subevent - Pick SP by comparing SPvar to triggerUID

    Action - spawn enemy (of type of SP)

    Action - register enemy UID to array

    Action - destroy SP

    Trigger and array share a container so AFAIK no picking is required

    Now i see that I'm not specifically picking the instance of the enemy i just created, but should that be necessary, when it's the succeeding action within the same event anyway?

  • Here's the image of the event

  • Yup, needed a For Each SpawnLocator_S_Rifle below to run all the actions

    could have guessed, I suppose ...

    thanks 99Instances2Go

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