What is wrong with this code?

0 favourites
  • 4 posts
From the Asset Store
Be quick and choose whether the shown equation is right or wrong.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ObjectTypeName returns object name (a string), it can't be 0 or 1.

    You need to explain what you are trying to do.

  • ObjectTypeName returns object name (a string), it can't be 0 or 1.

    You need to explain what you are trying to do.

    I'm making a card game, I have it set in the pack opener to whenever something in the card family spawns to add 1 to Cards.ObjectTypeName in the dictionary so it can keep track of how many of each card I own... so if you're telling me it needs to be a string that's a little odd to me since numbers are what I've been using and it's been working.

    But basically this is for the card gallery, I want it to be if you own at least 1 copy of a card it's 100% solid, and if not it's slightly translucent.

    Although I believe what I did is checking if any exists as apposed to checking each card. Which of course, I'd need it to check each card.

  • Ah, sorry, you are right - if you have card names as dictionary keys, then your code is correct.

    If it isn't working, my guess is that you are not picking Cards instance. There should be a parent event which picks one Cards instance, for example, a clicked card. Or if you want to process all cards, put these events inside the "For each Cards" loop.

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