picking instance by boolean instance variable

Get help using Construct 2

Post » Sun Jul 19, 2015 6:14 pm

Hey!

All is in title... I tried to do it with "pick instance by comparison" but i can't find find the way to use boolean instance variable in "expression" field.

thanks for reading
B
7
S
1
Posts: 64
Reputation: 585

Post » Sun Jul 19, 2015 6:22 pm

Why not just use the sprite condition - is boolean instead of system compare?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 19, 2015 6:30 pm

I try to use this kind of system :

when "sprite" collide "player", "sprite" instance variable is set to boolean "destroyable". When "sprite" "destroyable" variable is true > wait 1 seconde > destroy "sprite".

I guess it's a simple and efficient way to destroy only sprite that have been in collision with player. Isn't it?
B
7
S
1
Posts: 64
Reputation: 585

Post » Sun Jul 19, 2015 6:39 pm

Sprite on collision with player
> sprite destroy

would only destroy the instance of the sprite that collides with the player..

If you really want to check the boolean it would be:

Sprite on collision with player
sprite is boolean
> sprite destroy
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 19, 2015 7:06 pm

Ooops, my bad, i forgot to say my sprite is actually a family.

If I set "destroy" family, all objects of this family are destroyed.

So i want to use boolean instance to pick what object have to be destroyed.
B
7
S
1
Posts: 64
Reputation: 585

Post » Sun Jul 19, 2015 7:11 pm

If you destroy on collision only the family member colliding will be destroyed, for it is picked in the event and the others aren't..

And again, my above events are still the ones to use, just replace sprite with family..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 19, 2015 8:32 pm

Ok, i see what you mean.

Thank you.

I have some questions :

Is it possible to pick an instance by boolean instance and if it's possible, how to do it?

Where can i find a tutorial about picking instance by instance variable?
B
7
S
1
Posts: 64
Reputation: 585

Post » Sun Jul 19, 2015 9:28 pm

norab wrote:Ok, i see what you mean.

Thank you.

I have some questions :

Is it possible to pick an instance by boolean instance and if it's possible, how to do it?

Where can i find a tutorial about picking instance by instance variable?


I thought I already said how to pick by boolean?

"object is boolean instance variable set" - condition..

For other instance variables it would be

"object compare instance variable" - condition
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sun Jul 19, 2015 11:42 pm

LittleStain wrote:If you really want to check the boolean it would be:

Sprite on collision with player
sprite is boolean
> sprite destroy


Sorry... I didn't get it on first time, I'm not so good in english actually.

Literally translated in my language, "check" does not mention the fact to pick.

Thank you for having insisted :)
B
7
S
1
Posts: 64
Reputation: 585


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, valefor and 21 guests