question

Tolin Simpson avatar image
Tolin Simpson asked

Randomized Item Properties

We're thinking of a system similar to "Boarderlands " where every weapon drop is unique, every weapon has different randomly generated stats within a range, can I create a drop table say SMGs without having to add every single variant to that drop table i.e. Name: SMG1 Accuracy: 1 Recoil: 1 Firerate: 1 and not have to do that 100+ times for each weapon. Currently this is easy to handle with Unity C# but the weapons need to be added to the players inventory in playfab what's the best way of storing Items with random properties if possible.

10 |1200

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

brendan avatar image
brendan answered

Right now, and assuming you don't have a custom game server hosted in our service, the way to do this would be via a Cloud Script function which you call whenever you grant items to the player. The various attributes would be custom properties on the item instance, which you would set in the Cloud Script call.

10 |1200

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

Tolin Simpson avatar image
Tolin Simpson answered

Would I still be able to see the items (and attributes) visually in the Player>Inventory or the Economy>Catalog tabs or would that be stored somewhere else? I am not running a custom game server. I have only just started integrating PlayFab into the project and my JS is rusty so it may take me a while to wrap my mind around cloud script. At least I have a place to start, thanks.

10 |1200

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

brendan avatar image
brendan answered

Not yet. While the player's inventory is visible in the Game Manager, we do not yet provide the custom properties for the items there. This is on our backlog though, so once we can prioritize it, we'll make this available. In the short-term, you could use the "Try It" feature of the API documentation to grab the player's inventory, including all the properties (https://api.playfab.com/Documentation/Server/method/GetUserInventory).

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.