I am trying to add animation to my plugin but its seem there are still some error.
Can anyone check my json file for me? Am I doing correct?
[Answered] Animation problem
Moderator: Plugin Moderators
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: Animation problem
I just pasted your code into https://jsonlint.com/ and it shows the error message:
The missing commas are one issue (actually the only one that was recognized by JSONLint), but more importantly, you have to define your animation objects as separate objects and before you reference to them.
The basic structure has to look like:
Once you've transformed your code into that structure please report back whether it works.
Ps. For short text files I suggest to directly paste the content into your post so people can have a look at it without having to download separate files.
Ps2. You use ids like "fire", "human" and "campinglol". I encourage you to use something more unique to avoid potential conflicts with other plugins. E.g. you could prefix each id with your user name (e.g. "maysachan_fire").
By doing so I noticed that you don't follow the necessary json file structure. Your code (simplyfied):Error: Parse error on line 22:
...id": "human" }] [{ "id": "fire"
---------------------^
Expecting 'EOF', '}', ',', ']', got '['
Code: Select all
[
{
"id": "campinglol",
"type": "decoration",
...
"animation": [
{"id": "fire"},
{"id": "human"}
] <-- Mising comma
[{
"id": "fire" <-- Mising comma and type animation
"frames": [...]
"handle interpolation": 1
}] <-- Mising comma
[{
"id": "human" <-- Mising comma and type animation
"frames": [...]
"handle interpolation": 5
}]
}]
The basic structure has to look like:
Code: Select all
[
{
"id":"fire",
"type":"animation",
...
},
{
"id":"human",
"type":"animation",
...
},
{
"id": "campinglol",
"type": "decoration",
...
"animation": [
{"id": "fire"},
{"id": "human"}
]
}
]
Ps. For short text files I suggest to directly paste the content into your post so people can have a look at it without having to download separate files.
Ps2. You use ids like "fire", "human" and "campinglol". I encourage you to use something more unique to avoid potential conflicts with other plugins. E.g. you could prefix each id with your user name (e.g. "maysachan_fire").
- MaysaChan
- Small-town resident
- Reactions:
- Posts: 26
- Joined: 11 Jul 2018, 20:08
- Location: Thailand
- Plugins: Showcase Store
- Version: Beta
- Contact:
-
Plugin Creator
Platform
Re: [Answered] Animation problem
Ah damn I thought I alr sent thank you message
but anyway Thank you so much!!
but anyway Thank you so much!!