question

Canberk Soner avatar image
Canberk Soner asked

Nested Drop Tables

Hello,

We have container items that can drop items from multiple drop tables. These drop tables can be nested, so they can contain other drop tables too (not more than 3 "levels" I think)

Opening a container does exactly what we need, but the problem is we need to display all possible items in the container to the user. Container item only has the string IDs of the drop tables, no other information about them.

So I thought I'd call server.GetRandomResultTables with CloudScript, but it requires me to specify drop table IDs, and while I know the IDs of top-level drop tables from the container, I do not know the names of drop tables they contain without getting drop table data by specifying their ID. This means an absurd amount of API calls and I'm pretty sure it is going to hit 25 api call limit.

How can this be solved? How do I display all item contents of a container with nesteddrop tables?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image
Seth Du answered

You are right, we suggest not iteratively calling APIs to retrieve data. I believe you have to manually calculate the items and store them in Custom Data field of the item. However, you can create a local tool to help you do a one-time calculate.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Canberk Soner avatar image Canberk Soner commented ·

Thanks for the suggestion. Unfortunately, I think we'll hit the custom data size limit pretty fast because we have lots of items and some drop tables contain almost all of them, and isn't very practical.

0 Likes 0 ·
Canberk Soner avatar image Canberk Soner commented ·

I'm going to try a cloudscript function to get detailed contents of a single container item instead of all of them, since the UI doesn't display multiple container contents at the same time. This should only take about 3-4 api calls. I'll update the thread when I see it is working.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Canberk Soner commented ·

There is another solution. You may expose only the 'level 1' items to players at first, then players have to trigger an action (for example, press that container icon) for the next 'level'. Player should also go back to last 'level' for getting other containers/ drop table information. The thing is trying to offer limited information (Only 1 level) at a time.

0 Likes 0 ·
Canberk Soner avatar image
Canberk Soner answered

I've decided on an approach and putting this as an answer here in case it helps someone else.

Since the UI only needs to display the full contents of one chest at the same time, I've made a cloudscript function that takes a container item's content drop table ids and makes calls to server.GetRandomResultTables with those ids until it has the item id nodes of all drop tables and nested drop tables in that container.

In our case for 1 container, only 2-3 api calls are necessary so this is quite "affordable".

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.