Code Help
Moderator: Plugin Moderators
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: Code Help
Your code doesn't follow the syntax I suggested, which is crucial for multiple plugins within one file. There are basic rules in JSON you have to obey.
Radius -1 is not supported as it's a lot of effort to find a target building on the whole map. However you can use a big value (like 512) in case you want the whole map as target.
Most of your questions are answered somewhere in the documentation, don't expect people to be your search engine for free.
Radius -1 is not supported as it's a lot of effort to find a target building on the whole map. However you can use a big value (like 512) in case you want the whole map as target.
Most of your questions are answered somewhere in the documentation, don't expect people to be your search engine for free.
- Barky
- TheoTown Cartographer
- Reactions:
- Posts: 2056
- Joined: 17 Apr 2017, 22:13
- Location: Ireland
- Plugins: Showcase Store
-
Platform
Re: Code Help
Ok,
I changed to
And changed radius to 512, re downloaded it, still doesnt show up
I changed to
Code: Select all
[
{
car
}
]
[
{
building
}
]
[
{
road
{
[
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: Code Help
You haven't tried to put your code into https://jsonlint.com/ have you?
- CommanderABab
- AB
- Reactions:
- Posts: 11107
- Joined: 07 Jun 2016, 21:12
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: Code Help
It's really helpful. It often pinpoints the (first) error at the line number in the code.Lobby wrote: ↑02 Jul 2017, 20:10You haven't tried to put your code into https://jsonlint.com/ have you?
- Barky
- TheoTown Cartographer
- Reactions:
- Posts: 2056
- Joined: 17 Apr 2017, 22:13
- Location: Ireland
- Plugins: Showcase Store
-
Platform
Re: Code Help
I did it and this came up but I dont know how to fix
This is probaly obvious to you
Code: Select all
Error: Parse error on line 4:
...ar", "frames": [ ("bmp": "RallyCar.pn
---------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', ']', got 'undefined'
- CommanderABab
- AB
- Reactions:
- Posts: 11107
- Joined: 07 Jun 2016, 21:12
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
- Barky
- TheoTown Cartographer
- Reactions:
- Posts: 2056
- Joined: 17 Apr 2017, 22:13
- Location: Ireland
- Plugins: Showcase Store
-
Platform
Re: Code Help
Code: Select all
Error: Parse error on line 11:
... }], "v2": true}][{ "id": "$garage.r
--------------------^
Expecting 'EOF', '}', ',', ']', got '['
Yes I know its probaly obvious or easy to understand but gimme a break
- CommanderABab
- AB
- Reactions:
- Posts: 11107
- Joined: 07 Jun 2016, 21:12
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: Code Help
Expecting a comma, there between ][.
- CommanderABab
- AB
- Reactions:
- Posts: 11107
- Joined: 07 Jun 2016, 21:12
- Plugins: Showcase Store
- Version: Beta
-
Plugin Creator
Platform
Re: Code Help
V2 is just the start of the line.
- Barky
- TheoTown Cartographer
- Reactions:
- Posts: 2056
- Joined: 17 Apr 2017, 22:13
- Location: Ireland
- Plugins: Showcase Store
-
Platform
Re: Code Help
But if I add comma all I get is
It's confusing to me
Code: Select all
Error: Parse error on line 11:
... }], "v2": true}], [{ "id": "$garage
--------------------^
Expecting 'EOF', got ','
- Lobby
- Developer
- Reactions:
- Posts: 3705
- Joined: 26 Oct 2008, 12:34
- Plugins: Showcase Store
- Version: Beta
-
Platform
Re: Code Help
A JSON file can either contain a top level object {} or a top level array []. For plugins we use a top level array, therefore our base structure looks like
Code: Select all
[
...
]
For this reason something like
Code: Select all
[
...
],
[
...
]
- Barky
- TheoTown Cartographer
- Reactions:
- Posts: 2056
- Joined: 17 Apr 2017, 22:13
- Location: Ireland
- Plugins: Showcase Store
-
Platform
Re: Code Help
Code: Select all
[{
"id": "Rallycar00",
"type": "car",
"frames": [{
"bmp": "RallyCar.png",
"w": 28,
"h": 10,
"count": 4
}],
"v2": true
}, {
"id": "$garage.rally.unique.id.dc00",
"type": "sport",
"author": "Barky",
"text": "A small compund for your rally-kart, must be built next to track",
"width": 1,
"height": 1,
"frames": [{
"bmp": "RallyStation.png"
}],
"needs road": false,
"price": 1000,
"monthly price": 10,
"car": "Rallycar00",
"car radius": "512",
"car count": "1"
},
{
"id": "RallyTrack001",
"type": "road",
"flag user5": true,
"flag normal": false,
"author": "Barky",
"text": "A track for your rallies!",
"level": 1,
"width": 1,
"height": 1,
"frames": [{
"bmp": "RallyTrack.png",
"w": 32,
"h": 16,
"count": 16
}],
"speed": 5.0,
"price": 50,
"monthly price": 5,
"allow transfer": false,
"connectable": false,
"allow bus": false
}
]
- Barky
- TheoTown Cartographer
- Reactions:
- Posts: 2056
- Joined: 17 Apr 2017, 22:13
- Location: Ireland
- Plugins: Showcase Store
-
Platform
Re: Code Help
Nope
Downloaded Zip
Unlocked Zip
Put it in plug in folder
Went in game
Nothing there
It doesnt crash or anything it doesnt show up in game or in "pt"
I will pm you a link
Downloaded Zip
Unlocked Zip
Put it in plug in folder
Went in game
Nothing there
It doesnt crash or anything it doesnt show up in game or in "pt"
I will pm you a link