[510] Plugin crash (coal1.json:1007)

Plugin specific problems will be solved here.

Moderator: Plugin Moderators

User avatar
sairam
Inhabitant of a Conurbation
Reactions:
Posts: 537
Joined: 31 Dec 2017, 13:35
Location: India Pudukkottai
Plugins: Showcase Store
Version: Beta

Platform

[510] Plugin crash (coal1.json:1007)

#1

Post by sairam »

Hi, I got the following error with a plugin (coal1.json:1007):

Code: Select all

In /storage/emulated/0/TheoTown/plugins/coal plugin/coal1.json:

org.json.JSONException: Expected ':' after frames at character 696 of 
[
  {
    "draw ground":true,
    "frames":[
      {
        "bmp":"coal4.png"
      }
    ],
     "fun":[
      {
        "actions":[
          {
            "type":"remove"
          },
          {
            "type":"build",
            "id":"$zoneindustrial"
          },
          {
            "id":"$coalmine00",
            "type":"build"
          }
        ],
        "condition":{
          "id":"update",
          "type":"upgrade"
        }
      }
    ],
    "height":1,
    "hidden":false,
    "id":"$coalore00",
    "text ":"An unmined coal ore, maybe you can turn it into a coal mine?",
    "title":"Coal Ore",
    "type":"decoration",
    "upgrades":[
      {
       "frames" [
       
       ],
        "id":"update",
        "price":0,
        "text":"Upgrades to coal mine",
        "title":"Mine coal"
      }
    ],
    "width":1
  },
  {
"id": "$coalmine00",
	"type": "industrial",
	"width": 4,
	"height": 4,
	"frames": [{"steal":"$coalmine00"}],
	"level": 2,
	"override":true
	}
]
Device: Redmi 5 (Xiaomi)
Android: 25 (7.1.2)

Thank you in advance.

User avatar
Bearbear76
Former Bearbear65
Reactions:
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: [510] Plugin crash (coal1.json:1007)

#2

Post by Bearbear76 »

Usually these errors should be simple to resolve since the error message is understandable

Code: Select all

Expected ':' after frames
As the error message says, you're missing a ":" after "frames"

Here's the fixed JSON

Code: Select all

[
  {
    "draw ground":true,
    "frames":[
      {
        "bmp":"coal4.png"
      }
    ],
     "fun":[
      {
        "actions":[
          {
            "type":"remove"
          },
          {
            "type":"build",
            "id":"$zoneindustrial"
          },
          {
            "id":"$coalmine00",
            "type":"build"
          }
        ],
        "condition":{
          "id":"update",
          "type":"upgrade"
        }
      }
    ],
    "height":1,
    "hidden":false,
    "id":"$coalore00",
    "text ":"An unmined coal ore, maybe you can turn it into a coal mine?",
    "title":"Coal Ore",
    "type":"decoration",
    "upgrades":[
      {
       "frames" : [
       
       ],
        "id":"update",
        "price":0,
        "text":"Upgrades to coal mine",
        "title":"Mine coal"
      }
    ],
    "width":1
  },
  {
"id": "$coalmine00",
	"type": "industrial",
	"width": 4,
	"height": 4,
	"frames": [{"steal":"$coalmine00"}],
	"level": 2,
	"override":true
	}
]
I suggest you to use jsonlint.com before asking people on the forum as it's quicker
And if you cannot fix it on jsonlint then you should ask for help on the forum

User avatar
CommanderABab
AB
Reactions:
Posts: 11086
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

Re: [510] Plugin crash (coal1.json:1007)

#3

Post by CommanderABab »

The id of the in-game coal mine is not $coalmine00. I believe it is $ind052 or something like that. Run Theotown with debug and experimental features on to find the id when you try to build the in-game one.

Post Reply Previous topicNext topic

Return to “Problems”