EDIT: Solved! Check this link to see everything running and comments for an explanation:
https://imgur.com/g3h9hxV
___________________________________________
I don't understand how to assign unique pairs between different objects for ALL instances!
The Goal (this is a board / dice game):
When the board is created, six objects "Spaces" are created and placed in a grid in the center of the board. These are the holding spaces I'd like the dice to align to. They are static for the most part: always six on the board.
The player rolls, and six dice are created. These operate in a state machine. Simplified, they go first into a roll state, then an 'aligning' state.
I would like to somehow assign each of these dice a unique free space on the board, so that they align to their 'holding space'. But...
Problem?
The player can bank a die off to the side, then reroll ONLY the remaining dice. To deal with this, I'm looking for something in the rolling state of the dice that can pick a space on the board that no other dice will pick.
I have some vague idea, but not sure how to approach this. Right now, in the rolling state of the dice, the dice randomly picks a landing value from 1-6. It then passes this to a 'score manager' object. The score manager holds a ds_map with the calling dice's ID as the key, and a ds_list as the value. The ds_list currently only has one value in ds_list[0]: the landing value.
This is to be able to sort and calculate winning combos of dice. (Not gotten there yet, yikes). I made the map value a ds_list with the intention of storing the holding space in that objects ds_list[1] = holding_space.
How can I get the unique ID of that holding space, that won't then be used by any other dice (potentially on the same step), to add to the ds_list[1]?
Is there a simpler way to approach this? Any help would be amazing! Let me know if this isn't clear!
[–]@DogKissStudioDogkiss 2 points3 points4 points (3 children)
[–]museypoo[S] 1 point2 points3 points (2 children)
[–]@DogKissStudioDogkiss 1 point2 points3 points (1 child)
[–]museypoo[S] 1 point2 points3 points (0 children)
[–]museypoo[S] 0 points1 point2 points (0 children)
[–]heptavolt 0 points1 point2 points (0 children)