#369

Solved

table.create Bug

Reported by Colter Cookson on OCTGN · 18/04/2011 03:06:52

Assigned to:
jods
Priority:
Normal
Status:
Solved
Category:
Game scripts
Version:
0.9.*
Issue type:
Bug

I noticed that the cards created by table.create have a different position for the players that do not create them. For example, a card the first player creates at (160, -180) is located at (172, -168) for the other three players. The same pattern of (+12, +12) holds for other cards.

This makes it difficult to write scripts that depend on card position. For example, I am creating an OCTGN version of Thunderstone, a game where the players slay monsters. When a player kills a monster at a given place in the dungeon, they need to move the monsters that are further back up, draw a new monster from the dungeon deck, and place it at the back. I wrote a script to automate this. The script worked fine when I played by myself, but because of the position difference, it did not work when I played with a friend.

card.moveToTable puts the card in the same position for all players, so it can get around the position difference in table.create. Since I am creating all the cards the players will need at once, I can use “for all card in table: cardMoveTo(cardX, cardY)” to make the card’s positions the same for all players.

While synchronizing the card positions works, it slows down the game. Would it be possible to change table.create so the card appears at the same position for all players either by default or with an extra argument?

Notes:
I am using OCTGN 0.9.3.2. My friend was not available, so I simulated extra players by launching four instances of OCTGN on the same machine.

On the off chance this is a quirk with my game, not table.create, I have uploaded it to my MediaFire account (www.mediafire.com/?pn8m0hn9p50u0). To see the problem, load the synchronization-free game file and the set file, start a game, right-click on the table, and select Start Game. Eventually, stacks of cards should appear on the table. Right-click on them and select Broadcast Position to see their positions.

Attachments

No attachment has been uploaded, yet.


Loading comments...