Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

[SOLVED] Item Drop Window Bug Report Locked

A topic by Maindric created May 22, 2025 Views: 92 Replies: 3
This topic was locked by Hakuen Studio 37 days ago
Viewing posts 1 to 5
(1 edit)

BUG: The drop window does not scale with additional drops.

Image:

image.png

Settings:

image.png

You can see there should be at least 2 items dropped from this enemy.

image.png

Max Lines is set to 0, which is supposed to be automatic.

Commentary:

I will set to 3 for now to always show, but I will see if I can dig into the code to resolve.

(3 edits)

Ok, I figured out the issue.

image.png

In the plugin, it checks for the item ID, but it ignores if they are different types of items. As such, if the drop pool includes an Item of ID 1 and a Weapon of ID 1, then one will overwrite the other when populating the rewardList array.

Not sure if this is the best solution, but I fixed it by replacing line 979 code:

            for(const item of BattleManager._rewards.items){

                if(item.id in rewardList && item === rewardList[item.id].obj){
                    rewardList[item.id].amount++
                }else{
                    rewardList[item.id] = {amount: 1, obj: item}
                }
            }

With:

            for(const item of BattleManager._rewards.items){
                var type = -1;
                if(item.hasOwnProperty("itypeId")) {
                    type = "i";
                } else {
                    type = item.etypeId.toString();
                }
                const key = type + item.id.toString();
                if(key in rewardList && item === rewardList[key].obj){
                    rewardList[key].amount++
                }else{
                    rewardList[key] = {amount: 1, obj: item}
                }
            }

This creates a unique key for all types of equipment and items along with the ID. May not be the most performant, but allows the drop table to show all drops, regardless of dropped IDs. Even still allows quantities.

EDIT: On further inspection, this change might allow the removal of && item === rewardList[key].obj as the key should be unique 100% of the time.

Developer

Hi there!

Maindric, I'm so sorry to not answer you. I miss that post... =/

I'm glad you find a solution, and I will implement that on my plugin, thanks for sharing!

If you need/want a paid plugin from me, please add me on discord that I will send you a free key.

Discord: hakuenstudio

Developer

Fixed it on version 1.2.4! Thanks!

Developer locked this topic