A+B or B+A

0 favourites
  • 3 posts
  • I'm having some difficulties with this one.

    <img src="https://dl.dropboxusercontent.com/u/34375299/Construct%202/bugs%20and%20fixes/combineA_and_B.png" border="0" />

    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?

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That actually works perfect, thanks vee41!

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