question

Octolust avatar image
Octolust asked

Using rule to randomize item drop

I'm new here and I need some help about how using the Rule.

When kill a monster, boss, or open a box. Player 'll get item. But i want randomize property of items like Damage, Speed... It cant be done with Economy system right? Or I not found it yet?

So i make a rule it when player get an Item, it trigger a Rule to edit property of it


rule: player_inventory_item_added
But at Rule -> excute cloudscript-> Arguments (JSON):


how i can send IntancesID of new item to cloud function?

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

·
Seth Du avatar image
Seth Du answered

You can generate random value in the inventory custom data. For example, when you call GrantItemsToUsers, you can add random generated value in the Data property of ItemGrants list. You may find useful information in this thread: GrantItemsToUsers with json data even though the original question is about exceeding Inventory item data value size limits, which you should also take care of.

2 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.

Octolust avatar image Octolust commented ·

@SethDu
Hahaa but thread you said is own by me. And yeah, I findout how to generate random value by cloudscript and set Rule to trigger cloudscript run every i get an item (may be though dropbox catalog), add and edit Custom Data of this new Item.


With player_inventory_item_added
But dont known how to make cloudscript known what is the item player just get.

In the Edit Rule page, ACTIONS have Type :excute cloudscript. But what things i need in Arguments (JSON). Maybe playfab add something to player_inventory_item_added for admin get ItemInstanceId of Item trigger Rule

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Octolust commented ·

Haha, sorry about that. According to the documentation Writing Custom Cloud Script, you can use context.playStreamEvent to get the information of triggered event.

0 Likes 0 ·

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.