How to make family members shoot at different time?

Not favoritedFavorited Favorited 0 favourites
  • 11 posts
From the Asset Store
This music pack covers differents situations for visual novels, anime games and many more!
  • Hello! How can I do action that depends on the instance variable in the family?

    Why I can't make it work properly in my examples? Here are my attempts: https://www.dropbox.com/scl/fi/ly9r5o4hz8q0wxxh58elc/Attack-the-Base-in-Line-Custom.c3p?rlkey=oeu9hrt3tnwcs2kifzibtle35&st=yu5tbx7t&dl=0

  • Are you asking about the "ally attack" timer? Your approach is almost correct. The problem is that the entire event #5 repeats on every tick, restarting the timer again and again, so it never ends.

    You need to add additional conditions, for example "Timer not running". Or use a triggered event, for example "Allies On Collision with enemyBase"

  • The timer was one of the ways to resolve the main problem. The problem is that all instances of family members are repeating events at the same time, even if they should have different delays based on their variable.

    Here is C3P file the Group called V3 have every X time of instance variable and as I understood should attack with different time, but in my case they attack synchronously

    https://www.dropbox.com/scl/fi/5tup8m27gn9n69o3ckz7w/_Attack-the-Base-in-Line-Custom-2.c3p?rlkey=6616wpmz4snqz5n2cqsdgckcj&st=sjwgz4m8&dl=0

  • The timer was one of the ways to resolve the main problem. The problem is that all instances of family members are repeating events at the same time, even if they should have different delays based on their variable.

    Here is C3P file the Group called V3 have every X time of instance variable and as I understood should attack with different time, but in my case they attack synchronously

    https://www.dropbox.com/scl/fi/5tup8m27gn9n69o3ckz7w/_Attack-the-Base-in-Line-Custom-2.c3p?rlkey=6616wpmz4snqz5n2cqsdgckcj&st=sjwgz4m8&dl=0

    Hey, it's not gonna work like that.

    I've marked in the screenshot what I added to make it work.

    And yes, I added the attack particle again otherwise I just can't see what time they attack.

    - 4 timer event.

    -6 event check if it is still moving and has already arrived at the base then we stop it and start the individual timer.

    -24 event missing check if the base is still alive.

    fex.net/s/rvd3bpa

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, Sensei dop2000 and Mr. igortyhon I don't want to be annoying and I remember how you helped me with turret behavior before, but I couldn't use it for main project. When you are making it, it works perfect and at the moment when I change something everything stop working. I just want to understand how it works to stop asking similar questions.

    Why do we need that - 6 event movement check? What if there will be situation where units are not moving? Maybe to trigger timer only one time? But...

    I created two more groups in the project with similar mechanism.

    1) If timer is not working for continuous triggers, then why it's not working for "on created" event? (damage for some reason is only from first ally) I don't understand it and why timer works without "for each" for ally?

    2) How to make it work without timer? Where is my mistake?

    C3P https://www.dropbox.com/scl/fi/x758hw94evujv3uqztvb0/2_AttacktheBaseiLineCustom3.c3p?rlkey=wdss3rc2qxtykewyewwco5i3g&st=8vdst6m0&dl=0

  • I'll try to explain.

    You need to understand the logic of Construct3 and then any mechanics will be as easy for you as opening a can of beer!

    -- You see event number 4, it has a green arrow, it means that this event is a trigger. So what does this particular event number 4 mean. When any object in the “Alli” family triggers the timer with the tag “attack” then the function will be called. It's a separate trigger for each object in the family.

    -- Now event number 6, you have to be careful with this event, it doesn't have an arrow, which means that this event will be executed 60 times per second. So 60 times a second Construct3 will check all the objects of the “Alli” family and will see if they have reached the base or not and if this object is moving and if the object is moving and it has already reached the base, then we will stop it and at the next check this object will not participate and we will start a timer for it.

    -- You need to imagine how Construct3 goes through all the events on the sheet that do not have a green arrow and check if the condition is met.

  • Thank you for explanation

    Event number 4. I understood part about trigger and why we don't need "for each" there.

    Event number 6. Yes, it's checking distance every frame. So every frame, then base is in the distance it runs that timer. Okay, but "move to is moving" is also continuous and has no trigger (green arrow). Is not it just two conditions? Can I create boolean "can attack" make it true if base is the range and trigger timer by checking that true/false?

    Why on created is not triggering timer correctly in this example?

    How to make every X time individual for each instance?

    Example: https://www.dropbox.com/scl/fi/x758hw94evujv3uqztvb0/2_AttacktheBaseiLineCustom3.c3p?rlkey=wdss3rc2qxtykewyewwco5i3g&st=drp2p635&dl=0

  • Thank you for explanation

    Event number 4. I understood part about trigger and why we don't need "for each" there.

    Event number 6. Yes, it's checking distance every frame. So every frame, then base is in the distance it runs that timer. Okay, but "move to is moving" is also continuous and has no trigger (green arrow). Is not it just two conditions? Can I create boolean "can attack" make it true if base is the range and trigger timer by checking that true/false?

    Why on created is not triggering timer correctly in this example?

    How to make every X time individual for each instance?

    Example: https://www.dropbox.com/scl/fi/x758hw94evujv3uqztvb0/2_AttacktheBaseiLineCustom3.c3p?rlkey=wdss3rc2qxtykewyewwco5i3g&st=drp2p635&dl=0

    Construct3 is good because in it the same actions can be realized in different ways.

    For example, I prefer to implement it this way.

    -- on the trigger of creation we immediately set a point taking into account the distance of the attack.

    -- on the reach trigger, we start the attack timer.

    -- by the attack timer trigger we determine which unit is attacking to choose the attack animation.

    -- But that's assuming the base doesn't move.

    I'm not very good at explaining it, maybe one of my colleagues will do it better.

    fex.net/s/nfcknmt

  • Your explanation was excellent and very informative about triggers and timer. Thank you very much!

    After some experiments, now I definitely know much-much more about it. Occasionally it was difficult to find the correct way to trigger something only once. The surprise for me was that true/false is not a trigger. As I understood, the best and easiest way to convert a continuous event to a trigger is using "trigger ones while true as a sub-event" which saved me a lot of brain cells. If there is any other ways I would like to know it)

    Only one thing I couldn't make to work while experimenting is every X seconds per instance variable of the family

    https://www.dropbox.com/scl/fi/qxusb1msti4a9eoupr4lu/AttacktheBaseiLineCustom5.c3p?rlkey=88x0nls6rc4kkf7tw9cenudg2&st=ftxalgnj&dl=0

  • Your explanation was excellent and very informative about triggers and timer. Thank you very much!

    After some experiments, now I definitely know much-much more about it. Occasionally it was difficult to find the correct way to trigger something only once. The surprise for me was that true/false is not a trigger. As I understood, the best and easiest way to convert a continuous event to a trigger is using "trigger ones while true as a sub-event" which saved me a lot of brain cells. If there is any other ways I would like to know it)

    Only one thing I couldn't make to work while experimenting is every X seconds per instance variable of the family

    https://www.dropbox.com/scl/fi/qxusb1msti4a9eoupr4lu/AttacktheBaseiLineCustom5.c3p?rlkey=88x0nls6rc4kkf7tw9cenudg2&st=ftxalgnj&dl=0

    You don't want to use a ready-made timer on the object as we suggested, that's not a problem, but then you have to organize it yourself through events on the sheet.

    Event number six will not work the way you want it to. I'll tell you what's going on in there.

    You want each hero to have its own attack speed, and you have added an event every X seconds and a variable look in the object from the family, but there are many of these objects on the map and Construct3 takes the first hit hero looks at its value and with this period attack all.

    I give you an example of how you can do it yourself through the variables of the object.

    fex.net/s/r7frzrm

  • Excellent explanation, it's understandable why it was not working, thank you again and again. I will use timer in this case, but I also wanted to know why it's better then custom method. Woohoo, now I can build my own tower defense, with blackjack, and ...

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