-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON: Add more ACE #470
Comments
JSON expression: JSON.KeyCountDictionary has the useful Add This is very useful for statistics and UI lists. For example, if you want to create objects based on the number of keys in the path. And assign index numbers to these objects. Currently, you have to access the path via JSON: For each and create a local variable outside to count, which is very cumbersome. |
JSON action: Stop LoopWe also need When Loop in this structure, When you find a matching value, need a 'Stop loop' so that it does not traverse the entire file. |
JSON expression: GetDefaultDictionary has the useful I would appreciate if JSON would also get this functionality as it is very handy. GetDefault(key, valueIfMissing)Return the value stored for a key, but if it is missing, return a different value instead. For example Dictionary.GetDefault("name", "guest") will return the value of the key "name" if it exists, otherwise it will return the string "guest". |
JSON action: For Each(Ordered)order any JSON array or object by their keys and/or by their values (ascending/descending), For example, it is very useful when you want to add sorting functionality to the UI. for example: [
{"id": "7001", "name": "banana"},
{"id": "1002", "name": "carrot"},
{"id": "2024", "name": "apple"}
] Order By "id" {"id": "1002", "name": "carrot"},
{"id": "2024", "name": "apple"}
{"id": "7001", "name": "banana"}, Order By "id.name" {"id": "2024", "name": "apple"}
{"id": "7001", "name": "banana"},
{"id": "1002", "name": "carrot"}, |
Reviewed guidelines
Checked for duplicate suggestions
Summary
JSON is a very useful and powerful, but C3's vanilla JSON plugin missing some of necessary ACEs, which often causes us to get stuck in some places.
Possible workarounds or alternatives
You need to add a lot of extra steps, or use js to complete it. For experienced developers, this is pretty easy. But when we want to introduce the vanilla JSON plugin to newbies, this puts us in an awkward situation.
Proposed solution
I will add it below
Why is this idea important?
It is very useful for some data-driven games.
Additional remarks
No response
The text was updated successfully, but these errors were encountered: