[Asked][1.9.61a] Plugin crash (pathway.json:102)

Plugin specific problems will be solved here.

Moderator: Plugin Moderators

User avatar
1Code
Inhabitant of a Megacity
Reactions:
Posts: 302
Joined: 30 Jan 2020, 16:56
Location: https://bit.ly/3P5dhnT
Plugins: Showcase Store

Plugin Creator

Platform

[Asked][1.9.61a] Plugin crash (pathway.json:102)

#1

Post by 1Code »

Hi, I got the following error with a plugin (pathway.json:102):

Code: Select all

In plugins/pathway/pathway.json:

io.blueflower.stapel2d.util.json.JSONException: Value at 24 is null.
Device: SM-A217F (samsung)
OS version: 29

Thank you in advance.

Code: Select all    Reset

[ { "id":"$pw00_01", "type":"data", "script":"pw.lua" } ]
JSON checker
Check

Code: Select all    Reset

if script:getDraft():getId() == "$pw00_01" then local t = [[ [ { "id":"$pw00_00", "type":"template", "level":1, "speed":1.5, "price":50, "price factor":0.005, "monthly price":10, "draw ground":true, "flag normal":false, "flag pedestrian":true, "allow bus":false, "auto join":false }, { "id":"$pw00", "type":"road", "category":"$cat_bus00", "template":"$pw00_00", "title":"Pathway (diagonal)", "text":"A simple path", "frames":[ { "bmp":"pathway.png", "w":32, "h":16, "y":16, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":16, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":16, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":16, "count":16 } ], "allow diagonal":true, "hidden":]]..tostring(Runtime.getVersionCode() >= 1968)..[[ }, { "id":"$pw01", "type":"road", "category":"$cat_bus00", "template":"$pw00_00", "title":"Pathway", "text":"A simple path", "frames":[ { "bmp":"pathway.png", "w":32, "h":16, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "count":16 } ], "diagonal road":"$pw00" }, { "id":"$pw02", "type":"road", "category":"$cat_bus00", "template":"$pw00_00", "title":"Pathway (diagonal)", "text":"A simple path", //"text":"I caught you checking the json code of the plugin, you can use them but you can't steal and republiish this plugin without a written permission from me", "frames":[ { "bmp":"pathway.png", "w":32, "h":16, "y":48, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":48, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":48, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":48, "count":16 } ], "allow diagonal":true, "hidden":]]..tostring(Runtime.getVersionCode() >= 1968)..[[ }, { "id":"$pw03", "type":"road", "category":"$cat_bus00", "template":"$pw00_00", "title":"Pathway", "text":"A simple path", "frames":[ { "bmp":"pathway.png", "w":32, "h":16, "y":32, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":32, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":32, "count":16 }, { "bmp":"pathway.png", "w":32, "h":16, "y":32, "count":16 } ], "diagonal road":"$pw02" }, { "id":"$pw04", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":0, "w":32, "handle y":8 } ] }, { "id":"$pw05", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":32, "w":32, "handle y":8 } ] }, { "id":"$pw06", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":64, "w":32, "handle y":8 } ] }, { "id":"$pw07", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":96, "w":32, "handle y":8 } ] }, { "id":"$pw08", "type":"road decoration", "title":"Pathway", "text":"A simple path", "price":100, "animation":[ { "id":"$pw04" }, { "id":"$pw06" } ], "frame animation indices":[ [],[],[],[], [],[0],[],[0], [],[],[1],[1], [],[0],[1],[] ], "on click fun":[ { "action":{ "type":"build", "id":"$pw09" } } ], "required flag normal":false, "required flag pedestrian":true, "script":"pw.lua" }, { "id":"$pw09", "type":"road decoration", "title":"Pathway", "text":"A simple path", "price":100, "animation":[ { "id":"$pw05" }, { "id":"$pw07" } ], "frame animation indices":[ [],[],[],[], [],[0],[],[0], [],[],[1],[1], [],[0],[1],[] ], "on click fun":[ { "action":{ "type":"build", "id":"$pw08" } } ], "hidden":true, "required flag normal":false, "required flag pedestrian":true, "script":"pw.lua" }, { "id":"$pw10", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":256, "w":32, "handle y":8 } ], "light":true }, { "id":"$pw11", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":288, "w":32, "handle y":8 } ], "light":true }, { "id":"$pw12", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":320, "w":32, "handle y":8 } ], "light":true }, { "id":"$pw13", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":352, "w":32, "handle y":8 } ], "light":true }, { "id":"$pw14", "type":"road decoration", "title":"Crosswalk", "text":"A simple crosswalk", "price":100, "animation":[ { "id":"$pw10" }, { "id":"$pw11" }, { "id":"$pw12" }, { "id":"$pw13" } ], "frame animation indices":[ [],[],[],[], [],[0, 2],[],[0, 1, 2], [],[],[1, 3],[1, 2, 3], [],[0, 2, 3],[0, 1, 3],[0, 1, 2, 3] ], "min dirs":2, "flag normal":true, "required flag normal":true, "required flag pedestrian":false }, { "id":"$pw15", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":384, "w":32, "handle y":8 } ] }, { "id":"$pw16", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":416, "w":32, "handle y":8 } ] }, { "id":"$pw17", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":448, "w":32, "handle y":8 } ] }, { "id":"$pw18", "type":"animation", "frames":[ { "bmp":"pathway2.png", "x":480, "w":32, "handle y":8 } ] }, { "id":"$pw19", "type":"road decoration", "title":"Pathway", "text":"A simple path", "price":100, "animation":[ { "id":"$pw15" }, { "id":"$pw17" } ], "frame animation indices":[ [],[],[],[], [],[0],[],[0], [],[],[1],[1], [],[0],[1],[] ], "on click fun":[ { "action":{ "type":"build", "id":"$pw20" } } ], "required flag normal":false, "required flag pedestrian":true }, { "id":"$pw20", "type":"road decoration", "title":"Pathway", "text":"A simple path", "price":100, "animation":[ { "id":"$pw16" }, { "id":"$pw18" } ], "frame animation indices":[ [],[],[],[], [],[0],[],[0], [],[],[1],[1], [],[0],[1],[] ], "on click fun":[ { "action":{ "type":"build", "id":"$pw19" } } ], "hidden":true, "required flag normal":false, "required flag pedestrian":true }, { "id":"$pw21", "type":"road", "category":"$cat_bus00", "template":"$pw00_00", "title":"Pathway (diagonal)", "text":"A simple path", //"text":"I caught you checking the json code of the plugin, you can use them but you can't steal and republiish this plugin without a written permission from me", "frames":[ { "bmp":"pathway3.png", "count":3 }, { "bmp":"pathway4.png", "w":32 }, { "bmp":"pathway3.png", "count":2 }, { "bmp":"pathway4.png", "x":32, "w":32 }, { "bmp":"pathway3.png", "count":2 }, { "bmp":"pathway4.png", "x":64, "w":32 }, { "bmp":"pathway3.png", "count":2 }, { "bmp":"pathway4.png", "x":96, "w":32 }, { "bmp":"pathway3.png", "count":3 } ], "allow diagonal":true, "hidden":]]..tostring(Runtime.getVersionCode() >= 1968)..[[ }, { "id":"$pw22", "type":"road", "category":"$cat_bus00", "template":"$pw00_00", "title":"Pathway", "text":"A simple path", "frame":{ "bmp":"pathway3.png", "count":16 }, "diagonal road":"$pw21" }, ] ]] Draft.append(t) end function script:draw(x, y, l) if script:getDraft():getId() == "$pw08" then if City.getRotation() == 2 then Builder.buildRoadDeco(Draft.getDraft("$pw09"), x + 32, y + 32, l) elseif City.getRotation() == 3 then Builder.buildRoadDeco(Draft.getDraft("$pw09"), x, y + 32, l) end elseif script:getDraft():getId() == "$pw09" then if City.getRotation() == 0 then Builder.buildRoadDeco(Draft.getDraft("$pw08"), x, y, l) elseif City.getRotation() == 1 then Builder.buildRoadDeco(Draft.getDraft("$pw08"), x + 32, y, l) end end end
Interactive Lua editor
Run
Last edited by 1Code on 26 Mar 2022, 22:16, edited 1 time in total.

Return to “Problems”