Sandbox - getElementsArray

Game development with Board Game Arena Studio
Post Reply
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Sandbox - getElementsArray

Post 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");
}
User avatar
Een
Posts: 3854
Joined: 16 June 2010, 19:52

Re: Sandbox - getElementsArray

Post 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)
User avatar
JesterX
Posts: 26
Joined: 31 December 2012, 21:06

Re: Sandbox - getElementsArray

Post 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 :)
Post Reply

Return to “Developers”