Events for the same object but that affects just one

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.
  • Hi,
    I'm having problems to program events that must be executed for a specific object.
    Example: There are several landmines scattered around the level, when the character approaches one landmine just that one should blink rapidly, the other landmines shouldn't ... But what happens is that no one blinks or all landmines blinks at the same time.
    Anyone can help me?

  • I'm guessing you're using "compare two general values", which is a big no-no when you have multiple instances of the same object type.

    Basically, you just need to say something like this:

    + Always
    -> Mine: Set distance to: sqr(((X("Mine") - X("Player")) pow 2) + ((Y("Mine") - Y("Player")) pow 2))

    + Mine: distance < minDistance
    -> Mine: blink...

    If you have multiple players as well, then you'll need a nested loop.
    Either way, there are a gazillion examples of this floating around...

  • This shouldn't be happening but you're going to have to give the landmines a qualifier. A qualifier is a grouping of actives that can differentiate in the events pool.
    But for the basics of qualifiers, which should do what you want, just go to the object's properties and open up the events tab. Click on the empty space next to qualifiers and a button titled: 'Edit' should appear. Click on that, and you'll have the ability to add/delete qualifiers. Now go into your application events (where you have the landmine events at) and place the landmine's conditions (like when you approach it) on the specific qualifier you chose for the landmine (the qualifier will now appear as a tab in your events as if it were an ordinary active object). You cannot replace certain things only pertaining to the landmine with the qualifier (such as creating the landmine) so don't worry about that.

    Hopefully this helped, maybe not though. Good luck.

    That's my main.

  • Thanks for the replies... LavaFlamin66, I already tried the qualifiers... don't know if I did something wrong, but it didnt work.
    MuddyMole, I made a test with your code, and put on the screen the result of "sqr(((X("Mine") - X("Player")) pow 2) + ((Y("Mine") - Y("Player")) pow 2))", but it's always showing the distance between the player and the last landmine I put on the level... I realize now that all landmines blinks only when I approach the last landmine that I put on the level.. strange.... any Ideas?

Participate now!

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