Animation problem

Plugin specific problems will be solved here.

Moderator: Plugin Moderators

User avatar
MaysaChan
Villager
Reactions:
Posts: 24
Joined: Wed Jul 11, 2018 20:08
Location: Thailand
Plugins: Show
Version: Beta
Phone model: Galaxy Tab S3
Contact:

Plugin Creator

Platform

Animation problem

#1

Post by MaysaChan » Fri Mar 29, 2019 18:08

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 20 times
error.log
(1.16 KiB) Downloaded 14 times
Anime Tiddie Construction Co.,Ltd

Just another THAI DUDE

Rookie Artist

Plugins Illustrator (Rookie)

&

Plugins Maker

User avatar
Lobby
Developer
Reactions:
Posts: 3373
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Animation problem

#2

Post by Lobby » Sun Mar 31, 2019 20:30

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").
...Have a nice stay

Post Reply Previous topicNext topic

Return to “Problems”

Who is online

Users browsing this forum: No registered users and 3 guests