Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(2 edits)

Bug Report

Hello, while testing the plugin for our project, I encountered an issue:

When using common events like CardReward_XXXXX to obtain cards, there is a small probability of cards being selected out of order.


Example:

A B C D E      ←     →          OOO

F G H  I  J             F

K L MNO


When I select card F from the left window, the middle separator displays card F, and upon confirmation, the right window adds card F. 

However, when I select card G from the left window, the middle separator still displays card F, and upon confirmation, the right window adds card F again. 

When I select card H from the left window, the middle separator displays card G, and upon confirmation, the right window adds card G. 

When I select card I from the left window, the middle separator displays card H, and upon confirmation, the right window adds card H.

 When I select card J from the left window, the middle separator displays card I, and upon confirmation, the right window adds card I...

Before reaching the card with the error message, specifically before the position of card G, card selection behaves normally.

Other feedback: 

This bug also occurs when selecting cards in the card classification. It causes misalignment after encountering cards with error messages.There will be no misalignment if that specific error card is not present in the classification.

The core plugin version being used is v1.6.1.

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.