Quantcast
Channel: BeamNG
Viewing all articles
Browse latest Browse all 62276

quote replacement json -> lua (escaped double quotes turn into naked single quotes)

$
0
0
This line functions fine when executed from vehicle lua on the console:
Code:
obj:queueGameEngineLua('print(scenetree.findObject(\"scenario_player0\"):getID())')
But if I insert it into a "command" in a scenario JSON the escaped double quotes are replaced with single quotes, as evidenced by this error on the console:
Code:
67.20530|E|libbeamng.lua.V|*** FATAL LUA ERROR: [string "string"]:1: ')' expected near 'scenario_player0'
67.20532|E|libbeamng.lua.V|*** while executing this...
quote replacement json -> lua (escaped double quotes turn into naked single quotes)

Viewing all articles
Browse latest Browse all 62276

Trending Articles