0 Favourites

selecting instances of one object

This forum is currently in read-only mode.
  • there should be a way to select a certain instance of an object (if used many times) in the event editor and perform an action on it.

  • How do you mean? Isn't that what conditions do anyway? In what situation would it be useful?

  • How do you mean? Isn't that what conditions do anyway? In what situation would it be useful?

    i have several objects that glow, and if i want to destroy only one of them when you walk over it, what would i do?

  • Have a condition which tests for the collision then a destroy action.

  • Have a condition which tests for the collision then a destroy action.

    that doesn't destroy all of them?

    EDIT: it destroyed all the glows in the layout.

  • No, only ones involved in the collision.

  • No, only ones involved in the collision.

    "On collision between player and blueplant ---> blueglow: Destroy."

    there are multiple "blueglow" on every plant in my layout, and it destroys all of them on collision with any blueplant.

  • > No, only ones involved in the collision.

    >

    "On collision between player and blueplant ---> blueglow: Destroy."

    there are multiple "blueglow" on every plant in my layout, and it destroys all of them on collision with any blueplant.

    Put the blueglow objects in a container with the blueplant objects. That way when you collide with the blueplant object, it will automatically pick the glow object associated with the plant. Containers wiki page. Hope that helps.

  • >

    > > No, only ones involved in the collision.

    > >

    >

    > "On collision between player and blueplant ---> blueglow: Destroy."

    >

    > there are multiple "blueglow" on every plant in my layout, and it destroys all of them on collision with any blueplant.

    >

    Put the blueglow objects in a container with the blueplant objects. That way when you collide with the blueplant object, it will automatically pick the glow object associated with the plant. Containers wiki page. Hope that helps.

    awesome. thanks!

  • In this case though you can't use containers to destroy the glow. If you destroy one object in a container, it destroys all the objects in the container. Since you want the plant itself to stay, you'll have to find another way.

    If you're going with containers, you could make the blueglow invisible when you touch a plant, instead of destroying it.

    If you're not going with containers, then you'll have to define which blueglow you mean in your conditions. Construct can only pick the proper instances if you tell it which ones to pick in your conditions.

    This:

    "On collision between player and blueplant ---> blueglow: Destroy."

    Is incorrect. You haven't defined which blueglow you want in the condition, so they all disappear. Try this:

    +On collision between player and blueglow
      ->blueglow: Destroy
    [/code:1pyvw0wt]
    
    Since the blueglow has been defined in the condition, that's the only blueglow picked for destruction.
  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • >

    > > No, only ones involved in the collision.

    > >

    >

    > "On collision between player and blueplant ---> blueglow: Destroy."

    >

    > there are multiple "blueglow" on every plant in my layout, and it destroys all of them on collision with any blueplant.

    >

    Put the blueglow objects in a container with the blueplant objects. That way when you collide with the blueplant object, it will automatically pick the glow object associated with the plant. Containers wiki page. Hope that helps.

    I'll do a quick rundown of what I want and what is happening.

    I have 1 blueplant object and 1 blueglow object but multiple instances of those 2 objects across the layout.

    The blueglow object is behind the blueplant object and I want the blueglow object behind a blueplant to dissapear when you collide with the blueplant.

    I tried putting blueglow and blueplant in a container, but this only caused the blueplant to dissapear when collided with, and not the blueglow.

    I can't for the life of me understand what is going on, so here is a .cap file. I hope someone can explain it.

    http://willhostforfood.com/files3/3737739/platform.cap

  • DId you miss my post on the previous page?

  • DId you miss my post on the previous page?

    i guess i did ! went with the last method. works!

  • I don't see the containers you made, but if you do put blueglow and blueplant in a container together then this works as well:

    <img src="http://i39.tinypic.com/2uz732v.png">

    Also... why so many shaders just to make your glowing sprites? Use Photoshop or Gimp or something to blur your sprites before hand. That's just overkill. Yikes.

  • I don't see the containers you made, but if you do put blueglow and blueplant in a container together then this works as well:

    <img src="http://i39.tinypic.com/2uz732v.png">

    Also... why so many shaders just to make your glowing sprites? Use Photoshop or Gimp or something to blur your sprites before hand. That's just overkill. Yikes.

    yeah i know its overkill, but i wasn't really planning on making anything out of this before i posted it here, so yeah i think im gonna do that someday soon once i get cs4 up and running.

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