Hi, I'm new to construct (have only been using it a few days) and have decided to embark on what is probably a far too complicated project for learning with, but oh well, I like the challenge!
I'm basically trying to build a Hearthstone clone so I can learn the basics of creating a card game like this to make a much more complicated version later. I've found several very useful threads on this forum already that have helped me find a way to create and "shuffle" a deck using an array, then deal out cards to the player and add them to a "hand" using another array and referencing animation frames for the different cards. I've even managed to assign stats to the cards using another array and a .json file.
What I'm currently having trouble with is removing a card from the players hand when it is played (drag-dropped) I came up with a solution for this, which worked in an initial trial I did in another project file, but in the current project it doesn't seem to be working the same?!
When the card is generated I'm adding the UID of the sprite to an array using the push back action, and that is working fine, I can see in debug. I then have the following event and action set up
On: Deck - Drag/Drop-Drop > Call Function CardPlayed
On: Function - CardPlayed >
arPlayerHand: For each x element >
arPlayerHand: Current value = Deck.UID > arPlayerHand Delete index Self.CurX from X axis
The strangest thing for me is that this was working fine in another project, setup almost identically, but when I copied it over, it doesn't work. I can see that it is calling the function as I added another action to check, but it seems to fail at the "current value=Deck.UID" stage, even though I can see in debug that the UID of the sprite I'm moving is present in the arPlayerHand array at the time.
Huge thanks in advance if anyone can help shed some light on this.
Here's my construct file if it helps
https://drive.google.com/open?id=13nHjP0UpggkOQFW28XajEPb4n9dlUCjc