Page 1 of 1

Sandbox - getElementsArray

Posted: 25 May 2018, 14:31
by JesterX
Hello all,

Anyone can tell me why getElementsArray is not picking up any of my cards? I checked my cards, they do have the "CARD" tag.

I get Card count : 0

function shuffleAllCards() {
bga.log("Start Shuffle");
var allCards = bga.getElementsArray( { tag: 'CARD' } );
bga.log("Card count : ${cardCount}", { cardCount: allCards.length });

// bga.Shuffle();

bga.log("End Shuffle");
}

Re: Sandbox - getElementsArray

Posted: 25 May 2018, 14:59
by Een
Hi!
First thing that comes to mind is did you save and publish before starting test session?
(otherwise the last changes to objects won't be available, the script is the only component that is available directly to the test session after a change without republishing)

Re: Sandbox - getElementsArray

Posted: 25 May 2018, 15:48
by JesterX
Well played! It was exactly that. I didn't knew that you needed to re-publish after adding tags :)

I'm getting more experienced with those small thingys :)