question

Muhammad Roshaan Tariq avatar image
Muhammad Roshaan Tariq asked

What to use for creating Loot System?

Hi,

I have created a loot system for my players and I am confused about one thing

What should I use for my loot? Containers? Drop tables? Bundles?

My requirements are:

I will give 3 of these things to my players whenever they open the loot box

1) X gold

2) 2 random common items

3) 3 random rare items

For Point 2 and 3 I know that I will have to create a drop table to randomize based on their percentage

But I don't know what to use for this whole system.

Can you please guide me through it?

Player Inventory
10 |1200

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

1 Answer

Sarah Zhang avatar image
Sarah Zhang answered

According to the documentation, Bundles are collections of items and virtual currency that unpack into a player's inventory when granted, and Containers are collections of items and virtual currency that remain as an item in the player's inventory until opened. So if you have the requirement that let players open the box, you need to choose Containers. You can follow the following steps to configure the container.

  1. Create the virtual currency Gold as this section(Example) said.
  2. Create the drop table A as this section(Building drop tables) said.
  3. Navigate to the [Game Manager]->[Catalogs]->[Main]->[Containers], click the [NEW CONTAINER] button.
  4. On the [New Catalog Container] page, name the Item Id as B
  5. Click the [ADD TO CONTAINER] button, select [Drop tables] tab, add drop table A, set the quantity as 1.
  6. Click the [ADD TO CONTAINER] button, select [Currencies] tab, add the Gold, set the quantity as X.
  7. Check the [Consumable] option, fill the blank block under the [By count] as 1.
  8. Save the container.

Then you will get a container that can be opened once. Servers or CloudScript can call sever API GrantItemsToUser to grant the container to users. Clients can call client API UnlockContainerItem to “open” it. You can click the links to check more details of these API.

1 comment
10 |1200

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

Muhammad Roshaan Tariq avatar image Muhammad Roshaan Tariq commented ·

@Sarah Zhang Yeah, I have done it exactly like this. Thanks!

0 Likes 0 ·