I have pretty much got everything working I wanted to but I am still having some trouble with my card fetch script...
Basically the script is "working".. but there is a strange error with certain cards not being drawn. I do not know what and I have tried everything I can think of.
Example:
Script A draws 15 cards from 6 different decks, alll are unique named cards for the target deck getting constructed but there are multipul copies of the card name in the source decks. Apart form one card that has 4 copies pulled the the source deck.
Script B draws 15 cards from 5 different deck. All are unique named apart from 5 which has 5 copies pulled from one of the source decks.
Code:
--Deck List A
spellList = {}
weaponsList = {"Heavy Pick", "Longspear", "Longsword", "Sickle"}
armourList = {"Helm", "Scale Mail", "Wooden Shield"}
itemList = {"Caltrop Bead", "Ring of Climbing"}
allyList = {"Athlete", "Recruit", "Riding Horse"}
blessingList = {"Blessing of Ascension", "Blessing of Ascension", "Blessing of Ascension"}
cohortList = {"Donahan"}
--Deck List Example B
spellList = {}
weaponsList = {'Bolas', 'Hand Crossbow', 'Javelin', 'Shortbow', 'Shortbow'}
armourList = {'Leather Armor', 'Wooden Shield'}
itemList = {'Potion of Beast Skin', 'Trapsmith Gloves'}
allyList = {'Frog', 'Riding Horse'}
blessingList = {'Blessing of Ascension', 'Blessing of Ascension', 'Blessing of Ascension', 'Blessing of Ascension'}
cohortList = {}
These are the two deck lists and the scripts they are from are attached to separate objects and do not interact as far as I know. The idea is that I can copy the script object and just edit the deck list you see here at the top and then.. it works.
The strange problem is that BOTH these scripts work fine... as long as they are trigged first.
Which ever one I trigger 2nd, it will not draw the WOODEN SHIELD. There are 2 wooden shield cards in the armours deck.. but only 1 will ever draw, the one I click on 1st.
Things I have tried
- The names of all Wooden Shields are correct
- I have tried drawing the wooden shield, then deleting the other, copying the one that drew correctly and putting it back in the deck... same problem for the 2nd script
- I have made a tmp script that draws every card in the game onto the table and then back into a deck.. so to refresh and reset the GUIDS (or at least I think it worked for that)
- I have tried chaning Wooden Shield to another card name that has doubles in that deck.. they draw fine for both no matter who gose first
Really confused here.. I am sure it has something to do with the auto assigned GUIDs but I am stumped at how I am to fix this.