I forgot to mention one thing: before obtaining cards through the common event [CardReward_XXXXX], we also used the FTKR_SkillTreeSystem plugin to learn several similar skills. I'm not sure if this plugin has affected the card errors. We have also repeated testing of the card acquisition process, and in most cases, card editing proceeds normally. Card errors occur only occasionally.
Viewing post in Deck Editor - CGC Expansion - MV/MZ comments
Additional information: In the latest testing, I conducted over 25 consecutive uses of the common event [CardReward_XXXXX] to obtain cards without using the skill tree to learn skills. The bug still occurred under these conditions.
Furthermore, I tried the same operations in a sample project, and the same bug occurred.
The operation process is as follows: First, obtain cards using the common event [CardReward_XXXXX]. Obtain at least 3 cards, including one duplicate card. Then, directly create a new deck and proceed to edit that deck. This sequence triggers the error.
The additional info is appreciated! We believe we have a good lead on what's causing the issue. Please keep sending through any info you have. We will update you once we have a fix/patch ready for this issue.
If you would be amenable to it, our active Bug Report threads are on the community Discord (https://discord.gg/eshquedrqU). We can offer better real-time feedback to you on there. If that doesn't work for you, we can continue troubleshooting on here :)
We've investigated, and thanks to your detailed report we've figured out the problem! The issue is with this line of code in the CardReward Common Events:
for(var i = 0; i < 3; i++) rewardPicks.push(cardPoolIDs.splice(Math.random() * cardPoolIDs.length, 1));
We wrote it this way to make it fit in the tiny Script Call line limit, but it was producing an error we didn't notice until now. We were pushing one-length arrays containing numbers instead of the numbers themselves! That is doing weird things when it comes time to group cards together.
To fix the issue, replace this line with the following inside your Common Events:
for (var i = 0; i < 3; i++) { var index = Math.randomInt(cardPoolIDs.length); rewardPicks.push(cardPoolIDs[index]); cardPoolIDs.splice(index, 1); }
You may need to condense it to fit in the Script Call, or reorganize the calls, but that should be fine.
Let us know if this resolves the issue, and thank you for your patience on this.
--Isiah
Due to limited script space, I used ChantGPT to condense the corresponding code into a single line and replaced it.
Array.from({length: 3}, () => (index => (rewardPicks.push(cardPoolIDs[index]), cardPoolIDs.splice(index, 1)[0]))(Math.randomInt(cardPoolIDs.length))); | ||