Cameron9990's Recent Forum Activity

  • I'm trying to make it to where you can scroll through a list, I found that the method I was using sorta broke once I added a search bar. Is there a variable that gets like the highest Y out of the whole family and the lowest Y as well?

  • "Text is Cards.Name" condition doesn't pick cards. It only checks the name of the first card.

    In order to pick cards, you need to swap it:

    > Cards compare variable Name=lowercase(Search.text) : Cards set visible
    Cards compare variable Name≠lowercase(Search.text) : Cards set invisible
    

    But if the name can contain uppercase and lowercase characters and you want to ignore the case, you'll have to use System Pick condition.

    > System Pick By Evaluate Cards, lowercase(Cards.Name)=lowercase(Search.text) : Cards set visible
    System Pick By Evaluate Cards, lowercase(Cards.Name)<>lowercase(Search.text) : Cards set invisible
    

    How would I make it show up if only part of the word is typed in?

  • No seriously, am I doing something wrong?

    Tagged:

  • Loop over all the keys in the dictionary and create a card for each one?

    I tried, for me it's making a random card for each one instead of the exact card.

  • There’s always many ways to do things. One way could be:

    Use an array or json object to store a list of all the cards. In it you could store things like the name of the card, the file name of the image, and if it’s owned.

    Then you could make a second list of owned cards or use find() with the name to filter the list. Basically by looping over the complete list and building the filtered list from that.

    Now to display those cards you’d loop over the filtered list and create the cards and position them like dop suggests.

    If looping over the lists becomes too slow you could only loop over part of the lists per frame.

    You could also possibly not have to create all the cards from the filtered list to display them. Depending how you display them you could calculate what cards would be visible and only create those.

    Finally if video memory becomes an issue with so many unique cards you would need to do some kind of memory management. So instead of adding all the card images to the card sprites animation, you’d add them to the files folder of your project. Then you’d load/remove the images on the fly to the card sprite as needed at runtime. It’s probably more tedious to do than it sounds. You’d want to keep track of what images were loaded to avoid repeated loading.

    Anyways, that’s a fairly low level overview of what might be needed. There are probably many simplifications or shortcuts.

    I'm currently using a Dictionary to store the info on what cards are owned. How would I only spawn the cards that have Dictionary data?

  • So you need to arrange them in a grid, like an inventory? There are plenty of examples of how to do this.

    Here is a simple loop:

    Result:

    Waittt... would every single card in my game have to be on the screen then moved when this function is called.... because that'd be about 10k cards slapped around somewhere by the time I'm done... is there a way to have it spawn items in a family that are marked as owned?

  • Is there any way to change my viewport size in the event sheet?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • https://www.construct.net>

    Or do you need to arrange them differently? Post a picture of what you have in mind, or a video of a similar game.

    The cards all meet the search criteria, if a card doesn't, it won't appear there. And it'd be only owned cards. (the right side of the screen)

  • Check out this demo:

    https://howtoconstructdemos.com/template-for-a-card-game-shuffling-a-deck-of-cards-dealing-cards-to-two-players/

    It may not be exactly what you are asking, but it shows how to sort and re-arrange cards.

    What? not in the slightest what I need, that's why I said the card bit wasn't important. I guess what I'm asking for is more like an inventory thinking about it.

    Like a database of cards... but only showing the ones you own, or what meets the search criteria without any gaps or anything.

  • I asked ChatGPT to decipher this post:

    Yeah, I get what they’re asking. They’re making a pack-opening simulator (like for a collectible card game) and want to add a deck builder. The issue they’re facing is displaying a list of cards in a searchable way without gaps, while also making sure cards with a quantity of zero don’t appear.

    Breaking Down the Problem:

    • Listing cards for a search → They need a way to display all the cards they own.
    • Hiding cards with zero quantity → If a card isn’t owned, it shouldn’t be listed.
    • No gaps → If a card is removed, the list should shift up to keep things tidy.

    Cameron9990 Is this what you are asking?

    ...correct

  • For context real quick (doesn't matter if you play this type of game or not) I'm making a pack opening simulator for a card game, I'd like to make a deck builder.

    How would I take a bunch of sprite objects and have them listed out for a search, but also be able to have those objects not pop up if the variable for how many of a given object you own is 0 without having any gaps between anything?

    Sorry if this is poor wording, feel free to ask any questions out of confusion.

    Tagged:

  • There is a link to an example project in the documentation, have you seen it?

    Okay, genuinely last question... how do you do this when you select a family to be your icon set? I mean, it allows you to select a family, so I assume it's possible.

Cameron9990's avatar

Cameron9990

Member since 2 Feb, 2019

Twitter
Cameron9990 has 1 followers

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

10/44
How to earn trophies