Let players change card order

Game development with Board Game Arena Studio
Post Reply
emily_nicole
Posts: 8
Joined: 08 February 2022, 01:45

Let players change card order

Post by emily_nicole »

Is it possible to change the stock weight of a card based on card id?? I am trying to let the players reorder their cards and I cannot figure out the best way to go about it.

The first step I was trying to get to work was just to have a player click a card and for that card to move to the front of their hand.
User avatar
Victoria_La
Posts: 665
Joined: 28 December 2015, 20:55

Re: Let players change card order

Post by Victoria_La »

emily_nicole wrote: 09 March 2022, 18:20 Is it possible to change the stock weight of a card based on card id?? I am trying to let the players reorder their cards and I cannot figure out the best way to go about it.

The first step I was trying to get to work was just to have a player click a card and for that card to move to the front of their hand.
Yes you can set weight to whaever function you want, the question is on how you store it in database, changing id for purposes of sorting is extreme
emily_nicole
Posts: 8
Joined: 08 February 2022, 01:45

Re: Let players change card order

Post by emily_nicole »

Is there a simpler solution to letting the players change the order of their cards?
User avatar
Shazzypaz
Posts: 98
Joined: 27 December 2020, 15:22

Re: Let players change card order

Post by Shazzypaz »

I'm finishing up a card game in which the players can reorder their cards, including moving cards to the middle of the hand. I'm using css flex with card order saved in a separate table. My first attempt used stock, but it was awkward.
User avatar
RavingWanderer
Posts: 83
Joined: 12 May 2020, 16:08

Re: Let players change card order

Post by RavingWanderer »

The stock Stock object doesn't really do user-controlled card order. In one of my projects (contractrummy) I replaced some of its guts in order to accomplish this. This is risky, since it involved changing things that are not documented and thus not actually supported.
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Let players change card order

Post by Tisaac »

Shazzypaz wrote: 10 March 2022, 03:39 I'm finishing up a card game in which the players can reorder their cards, including moving cards to the middle of the hand. I'm using css flex with card order saved in a separate table. My first attempt used stock, but it was awkward.
Yep, the simple solution is simply to not use stock.
Post Reply

Return to “Developers”