Help with my I.A of turret geting new objective

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hello I want to achieve this:
    I have turrets that player can create with a radius, turret body and a turret part that rotates when any monster is near and shot him. (in a future will add line of sigh but first need this to work).
    -Turrets must select an objective when monster enter in his radius and won't leave it until monster dies or monster leaves from radius
    -Turret will only shot and rotate in direction of objective
    -(Later will add line of sigh to objective)
    -Also need to fix that turret rotate instantly to monster, maybe saving actual angle and new angle and then slowly substract?

    I dont know what i'm doing wrong need some help, here is an example of my code, thanks!

  • what turret should do if 2 enemies is in radius?

    if U need smooth rotation, use value with angle to monster, and use fast loop:
    every 10ms change direction: actual direction +/- 1
    +/- is a secon condition to loop event (IF monster direction > actual direction THEN actual direction ++)

    Please login to see this link.
    please help - just give me a feedback

  • what turret should do if 2 enemies is in radius?

    if U need smooth rotation, use value with angle to monster, and use fast loop:
    every 10ms change direction: actual direction +/- 1
    +/- is a secon condition to loop event (IF monster direction > actual direction THEN actual direction ++)


    Turret must select the first objective enters in radius, he ignores others until this is dead or leaves radius

  • Here's a modified example:

    Please login to see this attachment.

    I've simplified a bit here and there, added a "rotate-to-destination" part,
    and the turret shots only if it's in an offset of +/-10 degrees towards target (you can change it in line 13 >> angle_to_dest)
    I've moved some of the values to the "visor" object, when useful

    a selection of my Fusion examples can be found Please login to see this link.

  • Here's a modified example:

    Please login to see this attachment.

    I've simplified a bit here and there, added a "rotate-to-destination" part,
    and the turret shots only if it's in an offset of +/-10 degrees towards target (you can change it in line 13 >> angle_to_dest)
    I've moved some of the values to the "visor" object, when useful

    Wow that's exactly what I was going for! thanks!, I see where I failed on my first attemp, btw in line 15 you use:
    -Attack_timer ("turret_visor")< 60
    -every 00"-01
    +Add 1 to atack timer

    How you target each counter of turrets instead of all since u dont make a foreach? I tought u should do it always when u want to do multiple independent task on objects

  • As a general rule,
    Foreachs are strictly needed when you need to address specific parameters of an object
    that are not available in the object's own "new condition" submenu
    (the one popping out when you click on the object for inserting a new condition)

    All of those are self-scoping,
    so i.e. if you check a condition against alt values of an object,
    all single instances of the object will be checked, and the action(s) will perform on them each singularly

    while it doesn't work the same if you "compare two general values" and pick the values from the object

    In this case it's even simpler,
    because we only need to "add 1" (and not retrieve some specific data from specific objects in the action)
    to "all objects matching condition"
    so altval < 60 will pick all objects whose alt val is < 60
    and all of those objects will get a +1

    a selection of my Fusion examples can be found Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!