Stock Item, keeping the same order as played.

Game development with Board Game Arena Studio
Post Reply
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Stock Item, keeping the same order as played.

Post by RicardoRix »

I have a stock item, where cards get played to. (addToStockWithId)
http://en.doc.boardgamearena.com/Stock

I need to keep the display order as the same order in which the cards are played.

I can't use a weight to start with because I don't know the order they will be played in the future.
I could dynamically use changeItemsWeight() as they get played, although I haven't tried. The problem I foresee is that when the page refreshes F5 then the order will get lost.

So that seems I need to save the order to the DB, but that seems very long winded.

Am I missing something obvious?

------------------------------------------

Answer my own question, I am going to use the 'card_location_arg' field of the Card DB to help maintain the play order.
Last edited by RicardoRix on 05 April 2019, 10:16, edited 1 time in total.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: Stock Item, keeping the same order as played.

Post by RicardoRix »

While talking about stock item, I believe the wiki doc to be slightly inaccurate about setOverlap():
setOverlap( horizontal_percent, vertical_percent )
Make items of the stock control "overlap" each other, to save space.
By default, horizontal_overlap and vertical_overlap are 0.
When horizontal_overlap=20, it means that a stock item will overlap over 20% of the width of the previous item. horizontal_overlap can't be greater than 100.
In my experience if the value is 20 then the cards don't overlap by 20%, they show only 20% of the card underneath.
A value of 100% will show all the cards as if it isn't being used, same as default 0.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: Stock Item, keeping the same order as played.

Post by RicardoRix »

Also my game is almost ready. Who do I need to knock up / what is the next step?
User avatar
Een
Posts: 3861
Joined: 16 June 2010, 19:52

Re: Stock Item, keeping the same order as played.

Post by Een »

Hi!

About card order, I was going to suggest indeed to use the location_arg. The full state of the game needs to be persisted in the database to restore it when refreshing the game, so if the order is important it needs to be stored.

About setOverlap() you are certainly right. Do not hesitate to fix the documentation when you find some errors, we use a wiki to allow that ;)

Great about your game being almost ready! You can mail the studio adress or PM me to give us details about the project to review.
User avatar
RicardoRix
Posts: 2548
Joined: 29 April 2012, 23:43

Re: Stock Item, keeping the same order as played.

Post by RicardoRix »

OK, thanks.

I have changed the wiki as well as adding a few bits about debugging.

Classic case of the last 10% taking 80% of the time, but hopefully in the next few days it will be ready
User avatar
A-dam
Posts: 107
Joined: 28 September 2013, 18:15

Re: Stock Item, keeping the same order as played.

Post by A-dam »

Also, this is good way to go through before contacting admins: http://en.doc.boardgamearena.com/Pre-release_checklist
Post Reply

Return to “Developers”