Making enemy triggering independent?

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.
  • I have this code, actually every monster has a radius with him ( same id following etc) with this code monsters find the closest player and follow him (they switch target when other player is closer), problem is when I overlap any radius every monster start to follow that player instead of keep independent, how can i referenciate just the only one i'm overlaping?

    Please login to see this attachment.

  • Changed some bits here and there, better using a single object value for the pick nearest calculations
    (I generally keep a single object values, used as "engine" of the game for making this kind of things)
    now enemies will get "flag 0 ON" when there's somebody in range:

    Please login to see this attachment.

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

  • Changed some bits here and there, better using a single object value for the pick nearest calculations
    (I generally keep a single object values, used as "engine" of the game for making this kind of things)
    now enemies will get "flag 0 ON" when there's somebody in range:

    Please login to see this attachment.

    that's exactly what i was looking for, thanks!
    Now looking at code I want to fully understand what does and lean it, there are some things i dont understand at all:
    - Why u set the pick instance to an engine, isnt this value changing all the time?
    - Why u set on always a flag to off and then switch it on ? it's to recalculate the nearst object every second? flags work individualy for an object or all at the same time?

  • It's useful to use a separate active object as a container to hold all your extra alterable values and strings. Therefore you don't have to mess with the internal zombie values and instances if it's a variable that doesn't have to deal with that. He's recording the current chosen zombie's fixed value that was overlapped with the player group. He needs to do this or else the object will lose scope between the two different foreach loops for "pick_nearest" and "find_nearest" for the players (line 7 & 8). Since it's a nested foreach loop, it will go through each zombie that was overlapping the player, and test that one specifically versus all the players.

    Always setting the internal flag 0 off will set it off for all the zombies since a specific one isn't selected. He does this before his foreach loop so it resets all of their internal flag 0's to off. Then when he goes through the foreach loop, setting the internal flag 0 to on will select the zombies that are overlapping players only. Therefore when he does his second foreach loop "find_nearest", it will only target the zombies that were overlapping with the player.

    Custom A* Pathfinding in MMF2: Please login to see this link.
    Random Tile World Generation: Please login to see this link.

Participate now!

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