✔JustAnyone In distress

Plugin specific problems will be solved here.

Moderator: Plugin Moderators

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

✔JustAnyone In distress

#1

Post by JustAnyone »

Help please. My brain can't work anymore.

Code: Select all

In /storage/emulated/0/TheoTown/plugins/DSA Headquarters/dsahq.json:

org.json.JSONException: Names must be strings, but {"id":"dsahqup2","price":50000,"monthly price":500,"frames":[{"bmp":"meteor1.png"}],"title":"DSA Headquarters","text":"Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)","influence management":1000} is of type org.json.JSONObject at character 971 of [
	{
		"id":"dsahq",
		"type":"public",
		"width":3,
		"height":3,
		"frames":[{"bmp":"dsahq.png"}],
		"title":"DSA Headquarters",
		"text":"Headquarters of all DSA operations.",
		"influence management":"500",
		"needs road":"true",
	    "water":"-5",
        "power":"-5",
		"monthly price":"300",
		"max count":"1",
		"upgrades":[{
        "id":"dsahqup1",
        "price":50000,
        "monthly price":500,
        "frames":[{"bmp":"meteor1.png"}],
        "title":"DSA Headquarters",
        "text":"Upgrade the hardware to spy fellow theotown players.",
        "influence management":500,
         "requirement":{"requirements":[{"type":"RANK","data":{"id":"$rnk_city_big"}}]},
        {
        "id":"dsahqup2",
        "price":50000,
        "monthly price":500,
        "frames":[{"bmp":"meteor1.png"}],
        "title":"DSA Headquarters",
        "text":"Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)",
        "influence management":1000}],
         "price":"500000"
	}
]
Last edited by JustAnyone on 02 Nov 2017, 13:07, edited 4 times in total.

User avatar
Barky
TheoTown Cartographer
Reactions:
Posts: 2056
Joined: 17 Apr 2017, 22:13
Location: Ireland
Plugins: Showcase Store

Platform

Re: What?

#2

Post by Barky »

Try using

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

Platform

Re: What?

#3

Post by Lobby »

Use https://jsonlint.com/ to find syntax issues. In this case you forgot a closing bracket }

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: What?

#4

Post by JustAnyone »

Lobby wrote:
04 Aug 2017, 17:53
Use https://jsonlint.com/ to find syntax issues. In this case you forgot a closing bracket }
Thank you!

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Some json, what is wrong?

#5

Post by JustAnyone »

Code: Select all

[
	{
		"id":"dsahq",
		"type":"public",
		"width":3,
		"height":3,
		"frames":[{"bmp":"dsahq.png"}],
		"title":"DSA Headquarters",
		"text":"Headquarters of all DSA operations.",
		"influence management":"500",
		"needs road":"true",
	    "water":"-5",
        "power":"-5",
        "price":"500000",
		"monthly price":"300",
		"max count":"1",
		"upgrades":[{
        "id":"dsahqup1",
        "price":50000,
        "monthly price":500,
        "frames":[{"bmp":"meteor1.png"}],
        "title":"DSA Headquarters",
        "text":"Upgrade the hardware to spy fellow theotown players.",
        "influence management":500,
         "requirement":{"requirements":[{"type":"RANK","data":{"id":"$rnk_city_big"}}]},
        {
        "id":"dsahqup2",
        "price":50000,
        "monthly price":500,
        "frames":[{"bmp":"meteor1.png"}],
        "title":"DSA Headquarters",
        "text":"Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)",
        "influence management":1000,
         "requirement":{"requirements":[{"type":"RANK","data":{"id":"$rnk_city_big"}}]}}]}
	}
]
Just fix ir for me please. My brain hurts...

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

Platform

Re: Some json, what is wrong?

#6

Post by Lobby »

Code: Select all

[{
	"id": "dsahq",
	"type": "public",
	"width": 3,
	"height": 3,
	"frames": [{
		"bmp": "dsahq.png"
	}],
	"title": "DSA Headquarters",
	"text": "Headquarters of all DSA operations.",
	"influence management": "500",
	"needs road": "true",
	"water": "-5",
	"power": "-5",
	"price": "500000",
	"monthly price": "300",
	"max count": "1",
	"upgrades": [{
			"id": "dsahqup1",
			"price": 50000,
			"monthly price": 500,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Headquarters",
			"text": "Upgrade the hardware to spy fellow theotown players.",
			"influence management": 500,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			}
		},
		{
			"id": "dsahqup2",
			"price": 50000,
			"monthly price": 500,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Headquarters",
			"text": "Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)",
			"influence management": 1000,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			}
		}
	]
}]
jsonlint helps a lot, it even indents your code :bf

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: Some json, what is wrong?

#7

Post by JustAnyone »

Lobby wrote:
07 Aug 2017, 22:10

Code: Select all

[{
	"id": "dsahq",
	"type": "public",
	"width": 3,
	"height": 3,
	"frames": [{
		"bmp": "dsahq.png"
	}],
	"title": "DSA Headquarters",
	"text": "Headquarters of all DSA operations.",
	"influence management": "500",
	"needs road": "true",
	"water": "-5",
	"power": "-5",
	"price": "500000",
	"monthly price": "300",
	"max count": "1",
	"upgrades": [{
			"id": "dsahqup1",
			"price": 50000,
			"monthly price": 500,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Headquarters",
			"text": "Upgrade the hardware to spy fellow theotown players.",
			"influence management": 500,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			}
		},
		{
			"id": "dsahqup2",
			"price": 50000,
			"monthly price": 500,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Headquarters",
			"text": "Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)",
			"influence management": 1000,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			}
		}
	]
}]
jsonlint helps a lot, it even indents your code :bf
Thank you again!

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone's DSA Headquarters .json problems

#8

Post by JustAnyone »

Code: Select all

[{
    "id":"dsacar", 
    "type":"car", 
    "frames":[ 
      {"bmp":"carsample.png","w":12,"h":13,"count":4} 
    ], 
   "v2":true 
  },
  {
	"id": "dsahq",
	"type": "public",
	"width": 3,
	"height": 3,
	"frames": [{
		"bmp": "dsahq.png"
	}],
	"title": "DSA Headquarters",
	"text": "Headquarters of all DSA operations.",
	"influence management": "500",
	"needs road": "true",
	"water": "-5",
	"power": "-5",
	"price": "1000000",
	"monthly price": "250",
	"max count": "1",
	"upgrades": [{
			"id": "dsahqup1",
			"price": 30000,
			"monthly price": 500,
			"build time": 30,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Hardware Upgrade",
			"text": "Upgrade the hardware to spy fellow theotown players.",
			"influence management": 1000,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			}
		},
		{
			"id": "dsahqup2",
			"price": 50000,
			"monthly price": 1000,
			"build time": 60,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Cars Upgrade",
			"text": "Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)",
			"influence management": 2000,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			},
			"car spawner":[
      {
        "cars":["dsacar"],
        "radius":10,
        "count":5
 }
    ]
		}
	]
}]
Why cars are being mean and not spawning after I upgrade my building?
Thank you.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone's DSA Headquarters .json problems

#9

Post by JustAnyone »

JustAnyone wrote:
08 Aug 2017, 15:31

Code: Select all

[{
    "id":"dsacar", 
    "type":"car", 
    "frames":[ 
      {"bmp":"carsample.png","w":12,"h":13,"count":4} 
    ], 
   "v2":true 
  },
  {
	"id": "dsahq",
	"type": "public",
	"width": 3,
	"height": 3,
	"frames": [{
		"bmp": "dsahq.png"
	}],
	"title": "DSA Headquarters",
	"text": "Headquarters of all DSA operations.",
	"influence management": "500",
	"needs road": "true",
	"water": "-5",
	"power": "-5",
	"price": "1000000",
	"monthly price": "250",
	"max count": "1",
	"upgrades": [{
			"id": "dsahqup1",
			"price": 30000,
			"monthly price": 500,
			"build time": 30,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Hardware Upgrade",
			"text": "Upgrade the hardware to spy fellow theotown players.",
			"influence management": 1000,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			}
		},
		{
			"id": "dsahqup2",
			"price": 50000,
			"monthly price": 1000,
			"build time": 60,
			"frames": [{
				"bmp": "meteor1.png"
			}],
			"title": "DSA Cars Upgrade",
			"text": "Upgrade Headquarters to get cool DSA cars. (Not implemented yet!)",
			"influence management": 2000,
			"requirement": {
				"requirements": [{
					"type": "RANK",
					"data": {
						"id": "$rnk_city_big"
					}
				}]
			},
			"car spawner":[
      {
        "cars":["dsacar"],
        "radius":10,
        "count":5
 }
    ]
		}
	]
}]
Why cars are being mean and not spawning after I upgrade my building?
Thank you.
Lobby could you help me out the 3rd time?

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

Platform

Re: JustAnyone's DSA Headquarters .json problems

#10

Post by Lobby »

If I got you right you want to provide a car spawner within an upgrade. That's currently not supported.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone's DSA Headquarters .json problems

#11

Post by JustAnyone »

Lobby wrote:
09 Aug 2017, 16:25
If I got you right you want to provide a car spawner within an upgrade. That's currently not supported.
Yes, exactly!

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone's DSA Headquarters .json problems

#12

Post by JustAnyone »

Could you add a support for that in the near future?

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

Platform

Re: JustAnyone's DSA Headquarters .json problems

#13

Post by Lobby »

Near future? I have no idea
:java :json :plugin

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone's DSA Headquarters .json problems

#14

Post by JustAnyone »

Another problem. All Plug-in buildings don't seem to spawn custom cars which they are said to do.

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

Plugin Creator

Platform

Re: JustAnyone's DSA Headquarters .json problems

#15

Post by CommanderABab »

Maybe radius 10 doesn't get them out of the building. :)

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone's DSA Headquarters .json problems

#16

Post by JustAnyone »

Lobby wrote:
09 Aug 2017, 16:25
If I got you right you want to provide a car spawner within an upgrade. That's currently not supported.
If I would use overide function, would it work?

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

Plugin Creator

Platform

Re: JustAnyone's DSA Headquarters .json problems

#17

Post by CommanderABab »

No, currently unsupported means just that.

User avatar
JustAnyone
Developer
Reactions:
Posts: 3474
Joined: 23 Jul 2017, 12:45
Location: Easter Island
Plugins: Showcase Store

Platform

Re: JustAnyone In distress

#18

Post by JustAnyone »

Code: Select all

[{
		"id": "dsacar",
		"type": "car",
		"flag user7": true,
		"flag military": true,
		"frames": [{
			"bmp": "agentcar.png",
			"w": 16,
			"h": 13,
			"count": 4
		}],
		"v2": true
	},
	{
		"id": "dsahq",
		"type": "military",
		"category": "dsacat",
		"ordinal": 0,
		"width": 4,
		"height": 4,
		"frames": [{
			"bmp": "dsahq.png"
		}],
		"car spawner": [{
			"cars": ["dsacar"],
			"radius": 1000,
			"count": 500
		}],
		"title": "DSA Headquarters",
		"text": "Headquarters of all DSA operations.",
		"influence management": "500",
		"needs road": "true",
		"water": "-5",
		"power": "-5",
		"requirement": {
			"requirements": [{
				"type": "BUILDING",
				"data": {
					"id": "$mltry_hq00"
				}
			}]
		},
		"price": "5000000",
		"monthly price": "250",
		"random fun": [{
			"condition": {
				"type": "and",
				"inner": [{
						"type": "building count",
						"id": "dsahq",
						"min": 0,
						"max": 0
					},
					{
						"type": "date",
						"z": 20,
						"frame": 30
					}
				]
			},
			"actions": [{
				"type": "notify",
				"id": "$notify_test00",
				"z": 1
			}]
		}],
		"max count": "1",
		"upgrades": [{
				"id": "dsahqup1",
				"price": 100000,
				"monthly price": 500,
				"build time": 30,
				"frames": [{
					"bmp": "dsahq.png"
				}],
				"title": "DSA Hardware Upgrade",
				"text": "Upgrade the hardware to spy fellow theotown players.",
				"influence management": 1000,
				"requirement": {
					"requirements": [{
						"type": "BUILDING",
						"data": {
							"id": "JAROCKET"
						}
					}]
				}
			},
			{
				"id": "dsahqup2",
				"price": 500000,
				"monthly price": 1000,
				"build time": 60,
				"frames": [{
					"bmp": "dsahq.png"
				}],
				"title": "DSA Database Upgrade",
				"text": "Upgrade database to cover the whole region!",
				"influence management": 2000,
				"requirement": {
					"requirements": [{
						"type": "RANK",
						"data": {
							"id": "$rnk_city_big"
						}
					}]
				}
			}
		]
	}
]
Any thoughts on why my cars aren't spawning?

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

Platform

Re: JustAnyone In distress

#19

Post by Lobby »

Is it still an issue?

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

Plugin Creator

Platform

Re: JustAnyone In distress

#20

Post by CommanderABab »

Could you show a screenshot of the building and the roads it is placed on?

Post Reply Previous topicNext topic

Return to “Problems”