Sign In Register

How can we help you today?

Start a new topic
Answered

Virtual Goods Custom Properties

hello, i have some questions about the custom properties feature on virtual goods.


as far as i understand it, custom properties feature doesn't really add a new custom property to a virtual good. it just allows one to associate a json object to a virtual good via a short code. so if i want to add a custom property, say, "duration" with a number value to a set of virtual goods, i'm not in fact not adding a "duration" property and then assigning values to each virtual good, but instead need to either:

  1. create one custom property short code with {"duration": 10} for each virtual good, and assigning these short codes to each virtual good; or
  2. create a custom property table [{"goodId":"itemA", "duration":10}, {"goodId":"itemB", "duration":20}...] for all virtual goods, and then assigning the same short code to every applicable virtual good. 
option 1 is tedious and prone to error, and option 2 can be simplified by storing the list as a meta collection and skip the custom properties feature altogether.


is that in fact how custom properties work? or have i misunderstood its design?


Best Answer
Hey Hamlet,

Yes, you have the design correct.
For what you are looking to achieve i would suggest something similar to the second approach using the property set as a template for any kind of extra property that your virtual goods might need, and editing the values when you give the virtual good.
There isnt an elegant solution to this, but i'll keep you updated.

-Sean

 


Answer
Hey Hamlet,

Yes, you have the design correct.
For what you are looking to achieve i would suggest something similar to the second approach using the property set as a template for any kind of extra property that your virtual goods might need, and editing the values when you give the virtual good.
There isnt an elegant solution to this, but i'll keep you updated.

-Sean

 

I have 20 ships in game and planning to add more in the near future. Each of this ship has 15 properties with different values. As per your above comment it looks like, I need to create 20 virtual items, and one property "SHIPS" that holds a table/array of these 15 custom properties{{"SHIP_0":{name:"",speed:""}}}. 


Now I create a  property set, that basically contains this custom property we just created, with a new shortcode "SHIPS_SET"


Now each of this 20 items will be assigned the custom property set as "SHIP_SET".


That seems to be super redundant, data to be attached to each of the vitrualItem. Is there a way to add once of the elements of the Set?




 


1 person likes this
Login to post a comment