Cameron9990's Recent Forum Activity

  • > Exact same way I did it for Cards.GetObjectType only that one didn't need to start with str()

    The code on your screenshot works fine for me.

    Are you using "Set key" or "Add key" action? Use "Add key", because "Set key" only works if the key already exists.

    I... I could of sworn I hit copy and paste and then tweaked the words... I'm not sure why it was "set key", you are absolutely correct. Thank you for the clarification.

  • I think we may be talking about different things at this point. I was talking about something along the lines of:

    Mykey = str(sprite.uid)

    Dictionary: add key mykey with value dictionary.get(mykey)+1

    But I may have misunderstood what was being asked.

    Exact same way I did it for Cards.GetObjectType only that one didn't need to start with str()

  • I don’t understand what you mean by str() doesn’t work with a dictionary. Sure it requires that the key be a string but you can convert a number into a string with the str() expression and it’s happy. And I’m not just saying that, I’ve done it a lot.

    Wait I'm confused, I did what you're saying, the value is just never increasing, no matter what I do, it says 0.

  • dop2000R0J0hound

    Sorry for only just responding, been busy with work. But uhhh... well the string thing doesn't work with dictionary, it always comes out as 0, it works with JSON but it's not saving. But I'm also not used to working with JSONs so I'm probably doing that wrong. But even just leaving the layout and coming back it's not doing anything, turns to 0 so uhhhhh... what do?

  • 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.

  • Try Construct 3

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

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

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