Tomycase's Forum Posts

  • I'm curious, does it also apply to C2 tilemaps? We still have on-going projects developed on C2

  • I already know how to pin by using events, IID, loops, etc; my question was specifically about selecting an UID directly in the behavior script, but if that's not possible, then nevermind

  • Does anyone know if something like this would work for the Pin behavior?

    We're looking for a way to automatically pin an instance to an UID when the instance is created in layout without requiring events by using a behavior property, a sort of equivalent of the child/parent tree system from C3, we thought it would be useful for menus and interfaces

    Thanks in advance

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Frames 1-4* as I used loopindex+1, but yes this one is made with the idea that there's as much frames that there's instances;

    For a pool based on the total number of frames (still excluding frame 0), this does the job :

  • To be fair instance picking can be tricky in C2 and C3 so it's worth the head-scratching;

    Btw I over-complicated it, you don't need a function or an array to achieve the shuffle, try this :

  • You can also try the self-calling function method, where you set up a function that will go through a random instance that hasn't been randomized, set its frame and move to the next instance

    Example capx :

    drive.google.com/file/d/1bS84qMrTWlIFO0Tqq3V5YLDGuLTvPWtS/view

  • Your welcome!

  • Alright I made an example capx, feel free to change the distance/speed values to fit your needs, but that should solve your problem (works with multiple enemies instances) :

    drive.google.com/file/d/1F5L75Z0UjxcNAGX2NukdTzTFaiYE7p7O/view

  • No i mean, was it meant to activate a random enemy if many enemies are on screen?

    Also, what's the Line of Sight distance you used?

  • And what about the "Pick at random" condition? What's the effect you're trying to achieve with it?

    Also what's the Line of Sight reach?

  • So the enemy stays still, enters a short ALERT phase when detecting the player, then start moving toward them; Once close enough, if the player is not attacking already, the enemy will attack, did I get everything right?

  • I see many issues in your events logic, can you describe me how your enemies are supposed to behave exactly? I'll make an example capx, that will be easier than writing an essay;

    If possible link me your capx file, that'll be faster to edit

  • Hello, thanks for the detailed answer, I'm not sure how to apply that solution yet, but I hope to manage it eventually; also I guess that to make a list of said objects you need to use an array?

    Also a lot of people says that Javascript is easy to learn, but I easily get overwhelmed by script languages (the main reason C2 was easy for me to pick up and learn), but I'm progressing slowly

  • What are the events for the ATTACK state of an enemy? This is probably where the problem is

  • Hello, you need to use the "For Each" condition at top of event 27 to be able to pick the enemies correctly and compare their distance separatly