Page 1 of 1

Stock Item, keeping the same order as played.

Posted: 04 April 2019, 22:31
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.

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

Posted: 04 April 2019, 23:10
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.

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

Posted: 04 April 2019, 23:18
by RicardoRix
Also my game is almost ready. Who do I need to knock up / what is the next step?

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

Posted: 05 April 2019, 11:55
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.

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

Posted: 05 April 2019, 12:18
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

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

Posted: 05 April 2019, 16:42
by A-dam
Also, this is good way to go through before contacting admins: http://en.doc.boardgamearena.com/Pre-release_checklist