1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.32 Bug Reporting thread
    Solutions and more information may already be available.

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

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by torsion, Aug 20, 2016.

  1. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    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 line: obj:queueGameEngineLua('print(scenetree.findObject('scenario_player0'):getID())')
    67.20533|E|libbeamng.lua.V|*** in chunk: string
    
    Maybe I'm doing something the wrong way, but I can't see why escaped double quotes would ever evaluate to single quotes.

    EDIT: Attaching demo scenario based on DarthBob555's demo scenario from over here. "The Gauntlet - SBR Edition (derby)"
     

    Attached Files:

  2. tdev

    tdev
    Expand Collapse
    Developer
    BeamNG Team

    Joined:
    Aug 3, 2012
    Messages:
    3,031
    obj:queueGameEngineLua('print(scenetree.findObject(\"theplayer\"))')

    works here? :/
     
  3. Dummiesman

    Dummiesman
    Expand Collapse

    Joined:
    Sep 17, 2013
    Messages:
    4,685
    What he's meaning in the OP is, when that is put into JSON, it replaces escaped quotes.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice