Compare Composed Variable

0 favourites
  • 4 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hi guys!

    Is there a method in Construct 2 to compare function.param (or variables) in a composed array.

    I have Array:

    Pizza1["string0","string2","string3"]

    Pizza2["string0","string2","string3"]

    I want compare a function parameter with the array but composed, like in the photo.

    Sorry for my English but its very hard for me exaplain what i want to do ahaahah.

    Here the image: https://ibb.co/evsDVS

    Comparison: "pizza" & pizzaRichiesta & ".at"&"("& passaggi &")" - But of course Construct return a string not array.

    I dont want manually create everything like pizza1.at(x) but change the number of pizza dynamically

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For example.

    I have pizza1.width --- the result is 3

    but if I do

    "pizza" & varNum & ".width" --- result is the string "pizza1.width" (not 3)

    Is there a solution to convert the string into the value?

  • You can't do that. Just use a 2D array to do the same thing. A Dictionary is an alternate method, but the array applies better in this case.

  • You can't do that. Just use a 2D array to do the same thing. A Dictionary is an alternate method, but the array applies better in this case.

    Yes! I decided to use a 2D array

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