card_id is randomly allocated by Deck module

Game development with Board Game Arena Studio
Post Reply
stylix
Posts: 12
Joined: 16 March 2014, 15:33

card_id is randomly allocated by Deck module

Post by stylix »

Why card_id is randomly allocated by Deck module?
I copied and pasted heartla code. After initializing new game, I found card table in DB has randomly allocated card_id.
It makes mismatch for color, value and card_id mapping.
What's wrong?
User avatar
Victoria_La
Posts: 620
Joined: 28 December 2015, 20:55

Re: card_id is randomly allocated by Deck module

Post by Victoria_La »

That is what Deck is doing it purposely randomizes card_id, once it assigned it stays the same. I personally don't like this feature at all,
you can write your own sql insert if you don't like it (but in hears tutorial it card_id should not matter, not sure why its a problem)
stylix
Posts: 12
Joined: 16 March 2014, 15:33

Re: card_id is randomly allocated by Deck module

Post by stylix »

Victoria_La wrote:That is what Deck is doing it purposely randomizes card_id, once it assigned it stays the same. I personally don't like this feature at all,
you can write your own sql insert if you don't like it (but in hears tutorial it card_id should not matter, not sure why its a problem)
Thank you.
I will try my own sql later.
In my code, not like heartsla, I wanted to infer card color and value from card_id.
User avatar
quietmint
Posts: 265
Joined: 31 July 2017, 00:28

Re: card_id is randomly allocated by Deck module

Post by quietmint »

stylix wrote:In my code, not like heartsla, I wanted to infer card color and value from card_id.
I don't think I understand why you want this. Isn't this against the whole purpose of having a *table* for the deck of cards? You can add as many columns as you want to the existing table to keep track of attributes about the cards (e.g., suit/color, value, etc.). The default deck provides you with 2 such parameters. In my game, type attribute is for the "suit" (all my cards are equal value, so type_arg attribute or "value" is always 0). You can add more columns to your table if your cards have more than 2 properties to keep track of.
Post Reply

Return to “Developers”