A+B or B+A

Get help using Construct 2

Post » Fri Apr 19, 2013 2:21 pm

I'm having some difficulties with this one.



I have an Array with all sort of different object.
When You select an object it's name is stored to Combine_A var and then You can select second object which name is saved to Combine_B var.
So always first selected goes to Combine_A and second selected to Combine_B.

That way if param0 = "box3" and param1 = "box6" it creates a new object, adds it to an Array, deletes both from param0 and param1 and calls Close (Reset). If one of params is not equal above call Close(Remember).

What about
param0 = "box3" or param0 = "box6"
param1 = "box6"    param1 = "box3"
?

Obviously I can create events for both situations and it will work fine.
But the thing is I have no idea how many objects I will have and how many of them will combine with each other.
If there will be 8 objects to combine I will need to set all of the events twice for every combine action to check if
param0 = "object1"
param1 = "object2"    
or
param0 = "object2"
param1 = "object1"

param0 = "object7"
param1 = "object8"    
or
param0 = "object8"
param1 = "object7"
and so on...


I'm looking for some kind of a system to let me specify if Combine_A = A or B and Combine_B = A or B once.

Any thoughts?
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Fri Apr 19, 2013 2:32 pm

You could put both parameters into single string and use string.find on your comparisons. Like: string.find(src, box1) is not -1 and string.find(src, box2) is not -1, do stuffs.
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Fri Apr 19, 2013 3:16 pm

That actually works perfect, thanks @vee41!
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Matthew de, Skebab and 6 guests