[Answered] Animation problem

Plugin specific problems will be solved here.

Moderator: Plugin Moderators

User avatar
MaysaChan
Small-town resident
Reactions:
Posts: 26
Joined: 11 Jul 2018, 20:08
Location: Thailand
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

[Answered] Animation problem

#1

Post by MaysaChan »

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?
Attachments
Camp.json
(1.07 KiB) Downloaded 127 times
error.log
(1.16 KiB) Downloaded 112 times

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: Animation problem

#2

Post by Lobby »

I just pasted your code into https://jsonlint.com/ and it shows the error message:
Error: Parse error on line 22:
...id": "human" }] [{ "id": "fire"
---------------------^
Expecting 'EOF', '}', ',', ']', got '['
By doing so I noticed that you don't follow the necessary json file structure. Your code (simplyfied):

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 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:

Code: Select all

[
  {
    "id":"fire",
    "type":"animation",
    ...
  },
  {
    "id":"human",
    "type":"animation",
    ...
  },
  {
    "id": "campinglol",
    "type": "decoration",
    ...
    "animation": [
      {"id": "fire"},
      {"id": "human"}
    ]
  }
]
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").

User avatar
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

#3

Post by MaysaChan »

Ah damn I thought I alr sent thank you message

but anyway Thank you so much!!

Post Reply Previous topicNext topic

Return to “Problems”