Compare Instance Variable

Get help using Construct 2

Post » Thu Jun 18, 2015 4:13 pm

Did "Compare Instance Variable" really work like an array if more than one have the same value?

And if I pick one, the follow foreach will only have this in?
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 4:22 pm

I always use several compares to limit the amount of object I need for eaching through, or use an extensive pick all / pick by evaluate, then for each the results.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Thu Jun 18, 2015 4:30 pm

Y, I somtimes had problems with it. Can it be they need to be sub? Or also in AND.

And so its impossible to make:

On Mouse click on Object
Foreach Object

Will only pick the first, true?
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 4:34 pm

If you clicked the object, it should already be selected, so you would not have to loop through all the objects.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Thu Jun 18, 2015 4:39 pm

No you dont understand me.
Its only an example.
Its for situation all other must be deselected before select the clicked one.
For this i source out with a function.

I only want know if I am right. Any coding result I find myself.
I try to understand this completly...

So its really like an array, every sub Compare Instance Variable make it smaller, until I have my target.
Like Object[outergroup][innergroup][id]
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 4:45 pm

deathangel1479 wrote:No you dont understand me.
Its only an example.
Its for situation all other must be deselected before select the clicked one.
For this i source out with a function.

I only want know if I am right. Any coding result I find myself.
I try to understand this completly...



Ahh, yes, I have had similair situations.

local var TMPUID = 0

Event on touched X
action set TMPUID x.UID

--subevent pick all X
--action set boolean selected false

--subevent pick X by unique UID where UID = TMPUID
--action set boolean selected true
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Thu Jun 18, 2015 4:56 pm

You don't need the second pick. As soon as you pop up from the first sub-event, the SOL is back to where it was, so just a blank sub-event is sufficient, then do your "touch" actions.
ImageImageImage
B
71
S
21
G
231
Posts: 3,688
Reputation: 129,352

Post » Thu Jun 18, 2015 5:05 pm

Hmmm.
My english is not very well, you confuse me. :D

Again with a picture:

Image

So there are some diferent situations(AND/SUB), what work what not?
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Post » Thu Jun 18, 2015 5:16 pm

@blackhornet wrote:You don't need the second pick. As soon as you pop up from the first sub-event, the SOL is back to where it was, so just a blank sub-event is sufficient, then do your "touch" actions.



Ohhw, I did not know this :)
I just never took the risc hahaha, thnx


@deathangel1479, it seems I have no clue what your asking really :lol:


From your events above, what is not working ?
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Thu Jun 18, 2015 5:18 pm

it works fine, for moment but I can not be sure that sometimes if I have other groups, something is breaking out, if I not understand absolut completly how they work. That's my problem.

I need help from a real insider. :cry: :D
Sorry for my bad english, but I really do my best! And use and check with Google Translator.
B
10
S
4
G
1
Posts: 158
Reputation: 1,303

Next

Return to How do I....?

Who is online

Users browsing this forum: Mayfly, R0J0hound, tarek2 and 21 guests