selecting instances of one object

New releases and general discussions.

Post » Thu Jan 08, 2009 7:30 pm

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:

[code:1pyvw0wt]
+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.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 08, 2009 7:42 pm

[quote="linkman2004":11n64d82][quote="zephyrus":11n64d82][quote="Rich":11n64d82]No, only ones involved in the collision.[/quote:11n64d82]


"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.[/quote:11n64d82]

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. :)[/quote:11n64d82]

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
B
2
G
4
Posts: 43
Reputation: 1,136

Post » Thu Jan 08, 2009 7:46 pm

DId you miss my post on the previous page?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 08, 2009 7:51 pm

[quote="deadeye":8278np7t]DId you miss my post on the previous page?[/quote:8278np7t]
i guess i did :D ! went with the last method. works!
B
2
G
4
Posts: 43
Reputation: 1,136

Post » Thu Jan 08, 2009 7:56 pm

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:



Also... why so many shaders just to make your glowing sprites? :shock: Use Photoshop or Gimp or something to blur your sprites before hand. That's just overkill. Yikes.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu Jan 08, 2009 8:01 pm

[quote="deadeye":2n4gjffg]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:



Also... why so many shaders just to make your glowing sprites? :shock: Use Photoshop or Gimp or something to blur your sprites before hand. That's just overkill. Yikes.[/quote:2n4gjffg]

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.
B
2
G
4
Posts: 43
Reputation: 1,136

Post » Thu Jan 08, 2009 10:32 pm

Bleh, I didn't even think about the fact that that would destroy the plant as well. I should know these things, I work with containers all the time. :P
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Previous

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 4 guests