#Learning SkJson
1 messages · Page 1 of 1 (latest)
Did you read this https://github.com/cooffeeRequired/skJson/wiki/4.-Files#creating-a-file
you can do something like set {_hi} to json from file "..."
and edit value "data[0]::username" of json file "/plugins/Script/Jsons/test.json" to >"Jakub"
You can get individual values of the json with set {_loc} to value "Location" of {_json}
I might be wrong about this one but you can probably get individual values directly like this: value "data[0]::username" of json file "/plugins/Script/Jsons/test.json"
Sorry for being inexperienced but how does “data[0]::username” work like what part of the Json file would that find
{
username: “test”
}
This? ^^
@queen hedge
the [] represent an array
where is array in your example?
{"data": [{"username": "Bontoos"}]}
an array
{"username": "Bontoo"}
without arry
I don’t really understand how this all works sorry for wasting peoples time but I just can’t connect the dots in my brain. Would the things you sent be the json file and data is like the category in it and username is the data I want to access or what
sadly i got no clue but i wish to learn how i can make my skripts more configurable so please do teach me
i'd say skjson for storage, skript-yaml for configurations
plus skript-yaml is easy to use
would you be able to go through the basics like how to access the file, The specific content etc. Thanks btw
Did you read the GitHub docs
For SkJson or Skript-yaml?
Skjson
I did read through it but im guessing due to my lack of knowledge i didnt undestand anything
So i sorta figured out skript-yaml. Only thing im sort of not sure about is how the reading is being done as all the examples ive found theres no example showing the actuall yaml file.
set yaml value "%player%.location"``` would this change player.location as in this example yaml file
```yaml
player.location: "this"
except the actual player's name
set (yaml value "%player%.location" from "config") to "this"
from "config" is the location of the yaml file
you gotta experiment with it
so "config" will automatically be the loaded yaml file or do i have to load yaml file "" as config?