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:
create one custom property short code with {"duration": 10} for each virtual good, and assigning these short codes to each virtual good; or
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
C
Customer Support
said
over 7 years ago
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.
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
Customer Support
said
over 7 years ago
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.
Hamlet Archer
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:
is that in fact how custom properties work? or have i misunderstood its design?
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
- Oldest First
- Popular
- Newest First
Sorted by Newest FirstFauna Face
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
Customer Support
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
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics