Changing cards in a card game

0 favourites
  • 6 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Hi, how do I make a card change like in the Reigns game? I do it through the Array using ChatGpt, that's how it advises and how it comes out for me.

    An error comes out with tokenat, I don't understand what I'm doing wrong, can someone tell me what I'm doing wrong with tokenat?

  • As the screenshot prompts, the parameters of tokenat expression are filled in in the wrong.

    The correct usage is:

    tokenat(src, index, separator)

    tokenat(cardData, 0, "|")

  • Hi, yes, I was told that it needs to be replaced, but even when replacing, it gave an error. That's why I even asked for help here, because no one knows how to fix it. :/

  • Can you upload your files?

    Do you know what tokenat actually does?

    tokenat("apples|oranges|bananas", 0, "|")

    returns apples.

    tokenat("apples|oranges|bananas", 1, "|")

    returns oranges.

  • Unfortunately, not really, if I had known, I would not have used ChatGpt, I sent all the code in the screenshots, I wanted to use an array to create cards and descriptions for them, and ChatGpt suggested how to divide the array for answers.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ChatGPT doesn't understand what C3 does and will just say things that look correct but are not the same as what they actually do.

    ArrayCard.c3p

    ---

    if you want to import some card data, you can create an Array file and then load it into the Array object through AJAX.

    Uused for reference them as the card original database.

    In the game, you can have a other Array to manage the "current card", which stores the card ID. it determines the cards that player can currently use.

    If you want to exchange, that is, replace the IDs of these cards.

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