#382
New
Add an empty dictionary for each player in the global player array
Reported by Divided By zer0 on OCTGN · 05/05/2011 15:48:27
- Assigned to:
- jods
- Priority:
- Normal
- Status:
- New
- Category:
- None
- Version:
- 0.9.*
- Issue type:
- Feature
Now that we have a nice global array (a list?) for storing the player names, I’d like to expand it a bit to give us a place to store some variables to be polled by local scripts. I’d like this array that you added to be expanded to be a nested array (or a tuple?) which includes an empty dictionary per player which the local script can populate to story values that the game needs to remember for each player. This would be extremely useful for comparisons and the like.
So if your current global array population looks like this
players = [player1, player2, player3]
I’d like to make it look like this
players = [[player1,{}], [player2,{}], [player3,{}]]
So then I can do something ‘like this’:http://pastebin.ca/2054255
In my case, I’d like to have a place to store poker hand ranks (eg a two pair is a 2, and is lower than a three of a kind which is a 4) and then announce the leader and do some actions according to that result.
At the moment I could theoretically hack around this by creating a new counter per player, but it’s not a elegant solution and it can only work with numerical comparisons.
So if such an implementation is possible, it would open up a lot of possibilities.
Attachments
No attachment has been uploaded, yet.
Loading comments...