Cameron9990's Forum Posts

  • Consider using JSON instead, you can store any amount of data for each card. For example:

    > CardJSON set path to CardName
    CardJSON set ".quantity" to (CardJSON.get(".quantity")+1)
    CardJSON set ".price" to 500
    

    To retrieve a value: CardJSON.get(CardName & ".price")

    idk, I use Construct explicitly when I don't feel like coding, I don't think there was any other ways to do JSONs unless I'm just blind.

  • That sounds fine to have a value per type in the family. If you wanted a value per instance you could use cards.uid as the key.

    If you wanted multiple values per type or instance you could just use another dictionary or append something like “:value1” to the key or something. For example cards.uid&“:value1”

    Unfortunately UID is itself a number. The key for a dictionary can't be a number.

  • The only way I've been able to do is

    But I need at least one more way to do a number value. Anyone got anything?

  • Try removing "Is overlapping Deck" condition in the function. If it fixes the issue, then investigate why some cards may not be overlapping the deck. Or move this condition in front of the For Each loop.

    I moved it in front and it worked, thanks you guys.

  • dop2000 and igortyhon I uhh... may need an explination for what's going on with the spawning here...

  • All the cards keep stacking in the same spot instead of doing the loopindex bit.

    Tagged:

  • My text would go past the bottom of the layout so I want a way to just shrink the text box but make it to where you can scroll though text, is there a way to do that? Or like, to make it to where the bottom of the text box is always at like the bottom of the text? I think either would work.

    Tagged:

  • Yes. It's called "Pick by highest/lowest value" from the System object. It will pick the object. If you want to know the actual value then just access it and store it in a variable after picking.

    You can choose a family just like any other object.

    I meant more for like an action like an Object.Blank

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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: