How to castom location at Deck function

Game development with Board Game Arena Studio
Post Reply
User avatar
Yu-wolf-or-Oru
Posts: 14
Joined: 15 July 2020, 12:27

How to castom location at Deck function

Post by Yu-wolf-or-Oru »

Hi everyone,
Im new to BGA,programming,english... and I want to implement my own game.

Question↓
I want to custom location at Deck.
How to create new location other than "deck","hand","discard"?

Sorry for this perhaps so easy question.

Greetings
Oru
User avatar
robinzig
Posts: 414
Joined: 11 February 2021, 18:23

Re: How to castom location at Deck function

Post by robinzig »

Everything you need is in the Deck component docs.

In particular, see the references to the `location` argument/column. This is a VARCHAR database column so you can put any string in there you want as a location name, to manage whatever locations your game has where cards can be.
User avatar
Yu-wolf-or-Oru
Posts: 14
Joined: 15 July 2020, 12:27

Re: How to castom location at Deck function

Post by Yu-wolf-or-Oru »

Dear robinzig
Thank you very much for your kindness.
I understand the 'location'.
In other words, 'deck','hand'and'discard' are special 'location' but I can also set them up arbitrarily myself.That is to say!
User avatar
robinzig
Posts: 414
Joined: 11 February 2021, 18:23

Re: How to castom location at Deck function

Post by robinzig »

Yu-wolf-or-Oru wrote: 26 September 2022, 12:52 Dear robinzig
Thank you very much for your kindness.
I understand the 'location'.
In other words, 'deck','hand'and'discard' are special 'location' but I can also set them up arbitrarily myself.That is to say!
I'm not sure if this is a further question or not. But to hopefully make a bit clearer - "deck", "hand" and "discard" aren't really special. They're just predefined location names you can use and there are built-in methods in the Deck class that interact with them directly. But there are also general methods that allow you to move cards to, or retrieve the cards from, any location at all with whatever name you want to come up with. So you can do whatever you want in terms of location names - you're not limited by these "predefined" ones (even though they are used in the majority of games which involve cards).
User avatar
Yu-wolf-or-Oru
Posts: 14
Joined: 15 July 2020, 12:27

Re: How to castom location at Deck function

Post by Yu-wolf-or-Oru »

Dear robinzig

Thank you so much!
You answered everything I wanted to ask.
I appreciate your thoughtful response (*'ω'*)ノ
Post Reply

Return to “Developers”