Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

To clarify, this error occurs when you are trying to use the CardReward common events while the Deck Edit Scene is open?

Please attach a screenshot of the error or the debug console logs when this error happens as that will help us narrow down the cause of it.

(2 edits)

This message does not have a clear clue to fix the bug, so the text has been modified, and the main content is the reply under this message.

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.

Yes, it most likely would. Perhaps there is an incompatibility there. Would you be able to share a screenshot of your full plugin manager so we may replicate the issue on our end?

Deleted 111 days ago
(1 edit)


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 :)

(1 edit)

That's fine, but my mobile number cannot register on Discord. If there are any new issues or updates, I will provide new feedback on this page.

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

(2 edits) (+1)

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)));
After testing, the card misalignment bug no longer occurred. Thank you very much.