I need different ways to use the dictionary to store unique values for each object in a family

Not favoritedFavorited Favorited 0 favourites
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Try adding "For each Cards" condition to that event.

    Also, why are you using UIDs as key names? UID is not a reliable identifier. If cards are created in runtime, their UIDs may be different every time the game or layout is restarted.

    If you are placing cards manually in the layout editor, their UIDs will stay the same until the card is destroyed. Still I suggest using an instance variable as a unique card ID.

  • Try adding "For each Cards" condition to that event.

    Also, why are you using UIDs as key names? UID is not a reliable identifier. If cards are created in runtime, their UIDs may be different every time the game or layout is restarted.

    If you are placing cards manually in the layout editor, their UIDs will stay the same until the card is destroyed. Still I suggest using an instance variable as a unique card ID.

    I did UID because that's what the other guy suggested. Also... is there literally any way to interact with other copies of the same object in a family? Like if I click on an object it'll change the variable of another of the same object?

  • is there literally any way to interact with other copies of the same object in a family? Like if I click on an object it'll change the variable of another of the same object?

    Everything is possible. You just need to pick that other instance of the same object or family. You can use "System Pick All":

    On Card clicked
    Card compare variable code="A"
    ... Pick all Card
    ... Card compare variable code="B" : Card set variable price to 100
    

    or call a function:

    On Card clicked
    Card compare variable code="A" : Call function UpdateAnotherCard(Code: "B")
    
    On Function UpdateAnotherCard
    .....
    
    
  • Everything is possible. You just need to pick that other instance of the same object or family. You can use "System Pick All":

    > On Card clicked
    Card compare variable code="A"
    ... Pick all Card
    ... Card compare variable code="B" : Card set variable price to 100
    

    or call a function:

    > On Card clicked
    Card compare variable code="A" : Call function UpdateAnotherCard(Code: "B")
    
    On Function UpdateAnotherCard
    .....
    
    

    I uhh... don't think I did it right. Keeps picking the wrong card.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you explain what are you trying to do? Do you want to save all cards in the dictionary? Then you need a For Each loop.

    Pick all Cards
    For Each Cards : Dictionary add key....
    
Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)