Page 1 of 1

Stock over multiple divs

Posted: 26 March 2016, 12:27
by apollo1001
Hi all

I have a question about the stock component. I understand its use when you have one location (div) for say a set of cards, but am wondering about the situation when one deck is spread amongst multiple locations (each could hold any of the original deck), so currently I believe I need to set up a stock for all of the 'sub-locations' and initialise the complete set of possible types to each. Am I missing some way of creating a 'sub-stock'/'sub-location' without having to set up a new stock for each?

Thanks

Apollo

EDIT: I have created a stock for each div and it works okay, I am merely curious about whether such functionality exists and if I have overlooked it.

Re: Stock over multiple divs

Posted: 27 March 2016, 20:18
by pikiou
You're not missing anything. There currently is no way in the Studio to handle the cards of a deck being spread in different divs.
But creating many stocks is no issue, so the way you're doing it right now it the best way.

Re: Stock over multiple divs

Posted: 30 March 2016, 07:58
by Quinarbre
It hurts your common sense because you're thinking about each card as unique physical object that gets moved from one location to another, like it happens with the deck module in your game.php.

But you need to remember that, as its name hints, stock was made initially for stacks of tokens and such, where the elements have no individual meaning and can be duplicated at will without changing the game much. I guess that component has evolved later to accommodate for cards because it wasn't a big leap from one to the other.