Code Help
Moderator: Plugin Moderators
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Not in pt, what do I do? Re-install it?
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.
=^._.^= ∫
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
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
{
[
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
Re: Code Help
It's really helpful. It often pinpoints the (first) error at the line number in the code.Lobby wrote: ↑Sun Jul 02, 2017 20:10You haven't tried to put your code into https://jsonlint.com/ have you?

-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
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'
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Ok I didnt notice
This may not be new to you but it is to me, alright
This may not be new to you but it is to me, alright
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
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: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
- CommanderABab
- AB
- Reactions:
- Posts: 9128
- Joined: Tue Jun 07, 2016 21:12
- Plugins: Show
- Version: Beta
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
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 ','

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
[
...
],
[
...
]
=^._.^= ∫
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Thank you Lobby, I understand now!
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Ok I am officially sick of this
JSONLint says it's valid
I see no problem
Wont work
Will I pm link or?
JSONLint says it's valid
I see no problem
Wont work
Will I pm link or?
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
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
}
]
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
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
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
I sent you link in PM
See for yourself
See for yourself
-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
facepalm
Thats how it saved automatically
Thanks
Thats how it saved automatically
Thanks

-
- TheoTown Cartographer
- Reactions:
- Posts: 2072
- Joined: Mon Apr 17, 2017 22:13
- Location: Ireland
- Plugins: Show
Re: Code Help
Well its finally in game, however it isnt spawning the kart
Am I missing something in code?
It should spawn then randomly go on the track
Am I missing something in code?
It should spawn then randomly go on the track