How do I select an Boolean Variable froam an value of another variable?

  • Hi, i have a little problem. How can i select an bollean variable from an value of another variable? If crafteditem = knife then set player.knife to TRUE?

    I can do it manually :

    If crafteditem = knife then set player.knife to TRUE

    If crafteditem = axe then set player.axe to TRUE

    If crafteditem = bow then set player.bow to TRUE

    but how can i set it automatically?

    If crafteditem = [X] then set player.[X] to TRUE?

    Thanks a lot for help ;)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • up please

  • So I've been banging my head against this for nearly an hour, and I don't think this can be done with Booleans, simply because Construct can't (that I can find at least), call boolean names from anything except a drop down menu. If someone knows a way around this I'd love to know.

    The best I could come up with is using a Dictonary instead of booleans, toggling their value from 0 to 1 when they key name matches craftedItem.

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