I really don't understand "for each"

0 favourites
From the Asset Store
Tap the ball, control it, avoid touching spikes and score higher!
  • hm yea that was slack of me. Will check it out when I get time but I'm sure BH & co will work it out before then

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, I think what I'm trying to do is impossible.

    I just keep running into infinite loops. You can't use a trigger once event with "for each." It will be ignored. Every time I actually do get both enemies to get their turn added, one always gets an infinite loop of turns added. Of course, if I don't use for each, then only one character actually gets the turn added. So, either way, I cannot get it to add up the enemies turns.

    At this point, I am thinking of doing this part over and changing the system. I am only going to give each enemy 1 turn, not 3. This will enable to me use only green-arrow trigger once events such as "on pathfinding arrived" to trigger when the turn gets added. This will prevent any infinite loops.

    I mean, it may work out fine. This system might even be more interesting. I don't know. What I do know is I can't take it anymore trying to get it to trigger once with a for each when the enemy pathfinds a certain distance. So, bollocks to it.

    I have tried 100 combinations of trigger once events, functions, UIDs, boolean variables, giving different sprites the instance variables. No matter what, I end up in the same place; an infinite loop or nothing. I don't know what else there is to try. I don't feel like Construct 2 was made for what I'm trying to do.

    So, tomorrow I'm going to rework the system a bit with only 1 turn per enemy/hero and see how it works out. It might even be better in the long run. Who knows.

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