Objects and events independent of copies of that object?

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 a platform game with enemies, and each enemy has a left and right detector object (to detect when it hits a wall) as well as a few floor detector objects (to check when it's on the floor/needs to turn around at a cliff). As well as this, they use a platform movement object to move. So that's 7 objects, each interacting with alterable values and the like, per enemy.

    If I want more than one enemy, I can copy them or make the program create them mid-game, but they go haywire - detectors for one enemy will effect the others, the platform movement object doesn't work properly etc.

    Is there any way to kind of "group" the objects together so they don't conflict, and the events in the event editor only effect each "enemy group" independently?

    Thanks.

  • Your issue is that you dont have identifiers for your enemies/detectors. Without proper identification, fusion wont be able to tell which enemy youre referencing, and in turn wont know where to place your detectors. The easiest way to solve your problem is to create an alterable value called "ID" for all of your enemies/detectors. Then at the start of the frame(or when any new enemy is created), "Spread Value 0 in ID". This will give each object a unique ID. Then all you need to do is say:
    IF Detector( "ID" ) = Enemy( "ID") > Set Detector Position to wherever you want it to be on the enemy. Having seperate objects as detectors has its own set of issues but this will fix your problems with having multiple instances of the same object. Id highly recommend looking into embedded detectors, youll have to rework your code a fair amount, but instantiating multiple copies of the same enemy will be very easy and well worth the initial work.
    Heres a good introduction to embedded detectors:
    Please login to see this link.

    Having embedded detectors can make animations a bit more difficult though.
    There is another method of detectors/collisions that is the most difficult to implement of all, but certainly the most scaleable and versatile. Its fairly well explained by schrodinger here. The basics of it invole using a single object to handle all colisions, by creating instances of that single detector as a "Mask" to test for collisions of other objects.:
    Please login to see this link.

    Good Luck :)

    Fusion Veteran Since 2005. Example Projects: Please login to see this link.

  • Thanks for the help!

    I ended up using IDs, but instead of using the IDs to link enemies and detectors, I used fastloops each frame to go through each enemy (using "if ID = loop index") to create and assign a detector and platform movement object for each enemy. Then another similar fastloop to destroy any detectors/PMOs when a corresponding enemy is destroyed in-game.

    Took hours to set up and it finally works, thanks for the idea!

Participate now!

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