NestedQuotedString

From The Battle for Wesnoth Wiki
(Redirected from Nested Quoted String)

Nested quoted string

If your add-on produces an error on the loading stage, and it looks like the quote below, then you can find a solution to your problem here.

 Nested quoted string
 at core/macros/image-utils.cfg:28 
 included from ai/ais/ai_default_rca_strong.cfg:2
 included from _main.cfg:30
 included from ~add-ons/Add-on_Name/scenarios/01_Scenario.cfg:62
 included from ~add-ons/Add-on_Name/_main.cfg:36

This error message consist of three parts:

  • Error name.. In this case, it is "Nested quoted string".
  • (upper) list of mainline files, which are core of the Battle for Wesnoth
  • (lower) list of your add-on files. Their names are usually started from "~add-ons/Add-on_Name", where Add-on_Name is the name of folder, which contains your add-on codebase.

Source of the error is some string, which misses double quote sign at the end.

For example:

 caption = _"Welcome to Wesnoth!
 speaker = narrator

There is no double quote sign at the end of caption value. In the other example, "message" key contains a multi-string value and lacks a double quote sign too:

 message = _"For this tutorial, you are playing Konrad.
 You are standing in the keep, and your mentor Delfador is on the east side of the river.
 speaker = narrator

To find source of the error, you need to check the listed files from the upper one to the lower one. If you hadn't modified core files by yourself, then you can skip all mainline files listed in second part of the error message. Your add-on file names are started from: ~add-ons/Add-on_Name/scenarios/01_Scenario.cfg and ends with ~add-ons/Add-on_Name/_main.cfg

In each file, go to the line, which number is written after the name of the file. For ~add-ons/Add-on_Name/scenarios/01_Scenario.cfg you need to go to line 62. Then start looking upwards. If you haven't found the source of the problem in this file, then check the next file in similar manner.

To fix this error you need to add a closing quote for string, which produced the problem. For first example in this tutorial it will look like:

 caption= _"Welcome to Wesnoth!"
 speaker = narrator

Pay attention to the closing quote at the end of the string.

 message = _"For this tutorial, you are playing Konrad.
 You are standing in the keep, and your mentor Delfador is on the east side of the river."
 speaker = narrator

The closing quote should be at the end of second string. If you add a double quote at the end of the first string of "message" value, then you produce the other error.

This page was last edited on 2 November 2014, at 07:51.