Nested quoted string, can someone help me ?

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
nexusrebirth
Posts: 14
Joined: November 15th, 2019, 8:54 pm

Nested quoted string, can someone help me ?

Post by nexusrebirth »

so i got this error. First thing i do is check absolutely every string of my main_cfg and my first scenario. But they all seems good...
I should precise that i started WML 2 days ago. Every piece of code worked fine until i tried to add a [story] tagset in my first scenario. However it doesn't seem to be the problem...

here is the error
Details :

Nested quoted string
at ~add-ons/simple_start/scenarios/a_simple_start.cfg:5
included from ~add-ons/simple_start/_main.cfg:35

my _main.cfg :

Code: Select all

[textdomain]
    name="wesnoth-simple_start"
    path="data/add-ons/simple_start/translations"
[/textdomain]

#textdomain wesnoth-simple_start

[campaign]
    #wesnoth-simple_start
    id=simple_start
    name= _ "Lydéric, le Prologue"
    abbrev= _ "LlP"
    define=SIMPLE_START
    icon="units/human-loyalists/lieutenant-die-1.png~RC(magenta>red)"
    image="data/add-ons/simple_start/images/Lieutenant.png"
    first_scenario=a_simple_start
    description= _ "Suivez le lieutenant templier Lydéric dans sa quête pour tuer une liche. (2 scénarios)"
    difficulties=EASY

    {CAMPAIGN_DIFFICULTY EASY   "units/human-peasants/peasant.png~RC(magenta>red)" ( _ "Civilian") ( _ "Beginner")}
    {CAMPAIGN_DIFFICULTY NORMAL "units/human-loyalists/spearman.png~RC(magenta>red)" ( _ "Recruit") ( _ "Easy")} {DEFAULT_DIFFICULTY}
    {CAMPAIGN_DIFFICULTY HARD   "units/human-loyalists/javelineer.png~RC(magenta>red)" ( _ "Soldier") ( _ "Normal")}
   
[/campaign]

#ifdef SIMPLE_START

[binary_path]
    path=data/add-ons/simple_start
[/binary_path]

{~add-ons/simple_start/macros}
{~add-ons/simple_start/utils}

{~add-ons/simple_start/scenarios}

#endif
my first scenario (difficulty is not actually implemented yet) :

Code: Select all

#textdomain wesnoth-simple_start
[scenario]
    [story]
        [part]
            background="{~add-ons/simple_start/images/wesnoth-map.png"}"
            story= _ "Depuis des siècles, le rôle de l'inquisition est de purifier les terres de wesnoth des infamies qui y existe..."
        [/part]
        [background_layer]
            image="{~add-ons/simple_start/images/wooden background.jpg}"
        [/background_layer]
        [part]
            background="{~add-ons/simple_start/images/Lieutenant.png}"
            story= _ "Ceci est la courte histoire du jeune lieutenant templier, Lydéric qui doit nettoyer une valée d'une menace mort-vivante"
        [/part]
    [/story]
    {DEFAULT_SCHEDULE}
    id=a_simple_start
    next_scenario=a_simple_escape
    name= _ "Fiat Lux"
    map_data="{~add-ons/simple_start/maps/simple_start_map.map}"
    turns=30
    [side]
        side=1
        controller=human
        team_name="good"
        user_team_name= _ "Inquisition"
        id="MyLeader"
        name= _ "Lydéric"
        type="Lieutenant"
        unrenameable=yes
        canrecrcuit=yes
        recruit="Horseman, Spearman, Bowman"
        gold=250
    [/side]
    [side]
        side=2
        controller=ai
        team_name="bad"
        user_team_name= _ "Morts-vivants"
        id="EnnemyLeader"
        name= _ "Kalshar"
        type="Lich"
        unrenameable=yes
        canrecruit=yes
        recruit="Skeleton Archer, Skeleton, Ghost"
        gold=100
    [/side]
    [event]
        name=start
        [message]
            speaker=MyLeader
            message= _ "Enfin je vous trouves, ville créature ! Préparez-vous à mourir "
        [/message]
        [message]
            speaker=EnnemyLeader
            message= _ "Tu es bien présomptueux, mortel..."
        [/message]
        [objectives]
            [objective]
                description= _ "Tuez Kalshar"
                condition=win
            [/objective]
            [objective]
                description= _ "Mort de Lydéric"
                condition=lose
            [/objective]
            [objective]
                description= _ "Limite de tours atteinte"
                condition=lose
            [/objective]
        [/objectives]
    [/event]
    [event]
        name="last breath"
        [filter]
            id=MyLeader
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Alors c'est comme ça que... je... finis... *soupir*"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    [event]
        name=die
        [filter]
            id=EnnemyLeader
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Il est... mort ?"
        [/message]
        [message]
            speaker=MyLeader
            message= _ "Il est mort depuis longtemps mais au moins il ne causera plus de mal aux innocents. Puisse dieu avoir pitié de lui."
        [/message]
        [message]
            speaker=narrator
            message= _ "La menace étant étiente, il était temps pour le lieutenant Lydéric et ses hommes de rentrer."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=time over
        [message]
            speaker=MyLeader
            message= _ "Nous perdons trop d'hommes et cette bataille dure depuis des jours, replions-nous !"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
[/scenario]
there's another scenario but its isn't linked in anyway to the error code. I'll put it just in case :

Code: Select all

#textdomain wesnoth-simple_start
[scenario]
    {MIDNIGHT}
    id=a_simple_escape
    next_scenario=null
    name= _ "Le col d'outre-vent"
    map_data="{~add-ons/simple_start/maps/simple_escape.map}"
    turns=15
    [side]
        side=1
        controller=human
        team_name="good"
        user_team_name= _ "Inquisition"
        id="MyLeader"
        name= _ "Lydéric"
        type="Lieutenant"
        recruit="Horseman, Spearman, Bowman"
        gold=300
        shroud=yes
    [/side]
    [side]
        side=2
        controller=ai
        team_name="bad"
        user_team_name= _ "Orcs"
        id="OrcLeader"
        name= _ "Gurush"
        type="Orcish Ruler"
        unrenameable=yes
        canrecruit=yes
        recruit="Orcish Archer,Orcish Grunt"
        gold=400
    [/side]
    [side]
        side=3
        controller=ai
        team_name="bad"
        user_team_name= _ "Trolls"
        id="TrollLeader"
        name= _ "Grog"
        type="Troll Hero"
        unrenameable=yes
        canrecruit=yes
        recruit="Troll Whelp"
        gold=150
    [/side]
    [event]
        name=start
        [message]
            speaker=narrator
            message= _ "En pleine nuit, dans leur bivouac au col d'Outre-vent, les forces de Lydéric sont révéillées par les sons lourds d'une armée en marche..."
        [/message]
        [message]
            speaker=MyLeader
            message= _ "Des orcs !"
        [/message]
        [message]
            speaker=OrcLeader
            message= _ "Les humains sont là, massacrez-les !"
        [/message]
        [message]
            speaker=MyLeader
            message= _ "Ils sont trop nombreux, vite passons le gouffre et sa barrière magique ! HARDI LES GARS!"
        [/message]
        [objectives]
            [objective]
                description= _ "Lydéric traverse le gouffre"
                condition=win
            [/objective]
            [objective]
                description= _ "Mort de lydéric"
                condition=lose
            [/objective]
        [/objectives]
    [/event]
    [event]
        name=sighted
        first_time_only="yes"
        [filter]
            side=3
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=second_unit
            message= _ "Des trolls ! Qu'allons nous faire ??!"
        [/message]
        [message]
            speaker=MyLeader
            message= _ "Gardez votre calme soldat!, nous serons en sécurité après avoir passé le gouffre !" 
        [/message]
    [/event]
    [event]
        name="last breath"
        [filter]
            id=MyLeader
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Traversez le gouffre sans moi, et vengez-moi..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=25,5
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=24,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=24,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=24,2
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=25,2
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=26,1
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=27,1
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=25,6
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=26,6
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=27,6
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=28,6
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=29,6
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=30,5
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=31,5
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=31.4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=30,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=29,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=27,2
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=28,2
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=26,6
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=25,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=26,2
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=25,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=26,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=27,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=26,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=27,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=28,3
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=27,5
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=28,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=29,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=28,5
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=29,5
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
    [event]
        name=moveto
        [filter]
            id=MyLeader
            x,y=30,4
        [/filter]
        [message]
            speaker=MyLeader
            message= _ "Nous avons réussi! La mort de nos camarades n'aura pas été vaine..."
        [/message]
        [message]
            speaker=narrator
            message= _ "Et ainsi, Lydéric finit sa mission et rentra rendre son rapport à l'inquisition..."
        [/message]
        [endlevel]
            result=victory
        [/endlevel]
    [/event]
[/scenario]
I try my best to understand everything but i never did coding before and i don't know anything :/ i'm learning tho so i hope i can get this sorted. Thanxs in advance guys.
User avatar
octalot
Developer
Posts: 496
Joined: July 17th, 2010, 7:40 pm

Re: Nested quoted string, can someone help me ?

Post by octalot »

Looks like you have an extra double-quote in the line background="{~add-ons/simple_start/images/wesnoth-map.png"}".
User avatar
MoonyDragon
Posts: 87
Joined: November 29th, 2017, 5:46 pm

Re: Nested quoted string, can someone help me ?

Post by MoonyDragon »

What Wesnoth tells you is that you have a " too many in the 5th line of your a_simple_start.cfg file. If you take a closer look at that line, you will see the error pretty quickly:
background="{~add-ons/simple_start/images/wesnoth-map.png"}"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Such errors are glaringly obvious if you use a syntax highlighter. You can find SH's for WML here.
Default L0 Era - Level 1 leaders with level 0 recruits!
nexusrebirth
Posts: 14
Joined: November 15th, 2019, 8:54 pm

Re: Nested quoted string, can someone help me ?

Post by nexusrebirth »

MoonyDragon wrote: August 6th, 2020, 2:22 pm What Wesnoth tells you is that you have a " too many in the 5th line of your a_simple_start.cfg file. If you take a closer look at that line, you will see the error pretty quickly:
background="{~add-ons/simple_start/images/wesnoth-map.png"}"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
Such errors are glaringly obvious if you use a syntax highlighter. You can find SH's for WML here.
Hi, thanks highlighter sounds like a big help :D
i changed the line to "{~add-ons/simple_start/images/wesnoth-map.png}"
and got a different error message:

Détails :

Nested quoted string
at ~add-ons/simple_start/images/wesnoth-map.png:3
included from ~add-ons/simple_start/scenarios/a_simple_start.cfg:5
included from ~add-ons/simple_start/_main.cfg:35

any idea ?
User avatar
octalot
Developer
Posts: 496
Joined: July 17th, 2010, 7:40 pm

Re: Nested quoted string, can someone help me ?

Post by octalot »

The [background] should just have a filename, without curly brackets. The curly brackets trigger the preprocessor, which inserts the contents of the .png file as if it were cut-and-pasted into the text file.

For example:

Code: Select all

        [part]
            story= _ "Eldred was a brave and courageous warrior"
            background=story/httt_story2.jpg
        [/part]
The directory to find that file is set by using [binary_path] elsewhere in your add-on. Double-quotes are optional around the filename.
nexusrebirth
Posts: 14
Joined: November 15th, 2019, 8:54 pm

Re: Nested quoted string, can someone help me ?

Post by nexusrebirth »

octalot wrote: August 6th, 2020, 3:17 pm The [background] should just have a filename, without curly brackets. The curly brackets trigger the preprocessor, which inserts the contents of the .png file as if it were cut-and-pasted into the text file.

For example:

Code: Select all

        [part]
            story= _ "Eldred was a brave and courageous warrior"
            background=story/httt_story2.jpg
        [/part]
The directory to find that file is set by using [binary_path] elsewhere in your add-on. Double-quotes are optional around the filename.
Hi, thanks for the help ! so my code should look like this? :

Code: Select all

    [story]
        [part]
            background=images/wesnoth-map.png
            story= _ "Depuis des siècles, le rôle de l'inquisition est de purifier les terres de wesnoth des infamies qui y existe..."
        [/part]
        [background_layer]
            image=images/wooden background.jpg
        [/background_layer]
        [part]
            background="{~add-ons/simple_start/images/Lieutenant.png}"
            story= _ "Ceci est la courte histoire du jeune lieutenant templier, Lydéric qui doit nettoyer une valée d'une menace mort-vivante"
        [/part]
    [/story]
i've tried it but when launching the campaign the game crahes :(
User avatar
WhiteWolf
Forum Moderator
Posts: 640
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Nested quoted string, can someone help me ?

Post by WhiteWolf »

Almost there.
  • Firstly, you still have curly brackets in your second [part]. Your addon should have a [binary_path] in its definiton, so that {~add-ons/simple_start/images/} is accessible, and then you should just input the image location from there, see example below.
  • Secondly, you have a space in your filename in the [background_layer] image=images/wooden background.jpg. That is incorrect, filenames are never allowed to have spaces in them, use an underscore (_).
  • Thirdly, [background_layer] also goes into the respective [part]'s. Also, I don't know how an explicit background= and [background_layer]'s work together. The former is for just loading a single, pre-created image, and the second is obviously for layering images "within the game." So in this case I'd stick to using just layers, labeling what you used as the base layer, and adding what you used in "background=" on top of it (scaling parameters in the example are of course optional, but it'll help with different screen resolutions once your addon is published):

Code: Select all

    [story]
        [part]
            story= _ "Depuis des siècles, le rôle de l'inquisition est de purifier les terres de wesnoth des infamies qui y existe..."
            [background_layer]
                image=wesnoth-map.png
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
            [/background_layer]
            [background_layer]
                image=wooden_background.jpg
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
                base_layer=yes
            [/background_layer]
        [/part]
        [part]
            story= _ "Ceci est la courte histoire du jeune lieutenant templier, Lydéric qui doit nettoyer une valée d'une menace mort-vivante"
            [background_layer]
                image=Lieutenant.png
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
            [/background_layer]
            [background_layer]
                image=wooden_background.jpg
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
                base_layer=yes
            [/background_layer]
        [/part]
    [/story]
I don't know what your "wooden_background.jpg" and "wesnoth-map.png" are, however if they are the same as in the main menu screen, they are available without you having to copy it into your addon, just use "maps/background.jpg" and "maps/titlescreen.png" instead, respectively.
(Also, if "Lieutenant.png" is the vanilla leutenant portait, then it's just "portraits/humans/lieutenant.png". Don't use capital letters.)

If you're that new to WML, and are not yet very familiar with the syntax of the tags or how they work, then I highly recommend getting familiar with the wiki :) You'll find everything there in clear, easy to follow articles.
Author of the Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
MoonyDragon
Posts: 87
Joined: November 29th, 2017, 5:46 pm

Re: Nested quoted string, can someone help me ?

Post by MoonyDragon »

When you write...

Code: Select all

[binary_path]
    path=data/add-ons/simple_start/
[/binary_path]
... in your _main.cfg file, this means that you can use images within data/add-ons/simple_start/images/ without writing out the full path.
In short, this: data/add-ons/simple_start/images/my_cool_folder/my_awesome_image.png becomes this: my_cool_folder/my_awesome_image.png.
Conversely, change all instances of background="{~add-ons/simple_start/images/Lieutenant.png}", to background=Lieutenant.png.
Default L0 Era - Level 1 leaders with level 0 recruits!
nexusrebirth
Posts: 14
Joined: November 15th, 2019, 8:54 pm

Re: Nested quoted string, can someone help me ?

Post by nexusrebirth »

WhiteWolf wrote: August 6th, 2020, 3:50 pm Almost there.
  • Firstly, you still have curly brackets in your second [part]. Your addon should have a [binary_path] in its definiton, so that {~add-ons/simple_start/images/} is accessible, and then you should just input the image location from there, see example below.
  • Secondly, you have a space in your filename in the [background_layer] image=images/wooden background.jpg. That is incorrect, filenames are never allowed to have spaces in them, use an underscore (_).
  • Thirdly, [background_layer] also goes into the respective [part]'s. Also, I don't know how an explicit background= and [background_layer]'s work together. The former is for just loading a single, pre-created image, and the second is obviously for layering images "within the game." So in this case I'd stick to using just layers, labeling what you used as the base layer, and adding what you used in "background=" on top of it (scaling parameters in the example are of course optional, but it'll help with different screen resolutions once your addon is published):

Code: Select all

    [story]
        [part]
            story= _ "Depuis des siècles, le rôle de l'inquisition est de purifier les terres de wesnoth des infamies qui y existe..."
            [background_layer]
                image=wesnoth-map.png
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
            [/background_layer]
            [background_layer]
                image=wooden_background.jpg
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
                base_layer=yes
            [/background_layer]
        [/part]
        [part]
            story= _ "Ceci est la courte histoire du jeune lieutenant templier, Lydéric qui doit nettoyer une valée d'une menace mort-vivante"
            [background_layer]
                image=Lieutenant.png
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
            [/background_layer]
            [background_layer]
                image=wooden_background.jpg
                scale_vertically=yes
                scale_horizontally=no
                keep_aspect_ratio=yes
                base_layer=yes
            [/background_layer]
        [/part]
    [/story]
I don't know what your "wooden_background.jpg" and "wesnoth-map.png" are, however if they are the same as in the main menu screen, they are available without you having to copy it into your addon, just use "maps/background.jpg" and "maps/titlescreen.png" instead, respectively.
(Also, if "Lieutenant.png" is the vanilla leutenant portait, then it's just "portraits/humans/lieutenant.png". Don't use capital letters.)

If you're that new to WML, and are not yet very familiar with the syntax of the tags or how they work, then I highly recommend getting familiar with the wiki :) You'll find everything there in clear, easy to follow articles.
Hi, thank you very much ! Your message helped me a lot in understanding what i was doing. Also no more errors! however it seems i'm yet to understand how layering works since i'm only getting maps/background.jpg in the screen (wich already is an improvement). i'll try and tweak with that and search on the wiki. Thanks again ! :)
User avatar
WhiteWolf
Forum Moderator
Posts: 640
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Nested quoted string, can someone help me ?

Post by WhiteWolf »

nexusrebirth wrote: August 6th, 2020, 4:04 pm i'm only getting maps/background.jpg in the screen
It's because I made a small mistake, sorry for that, I confused the order of the layers. They are put onto each other from top to bottom, so in the example code in my previous post, background.jpg is the top layer, completely hiding the map which is just behind it. My other mistake is that base_layer should also be the map and not the background, because we want to align the other images to that one. Here's the correct code:

Code: Select all

[part]
    story= _ "..."
    [background_layer]                          # first layer - the background
        image=maps/background.jpg
        scale_vertically=yes
        scale_horizontally=no
        keep_aspect_ratio=yes
    [/background_layer]
    [background_layer]                          # second layer, the map
        image=maps/titlescreen.png
        scale_vertically=yes
        scale_horizontally=no
        keep_aspect_ratio=yes
        base_layer=yes                          # which is also the base layer, to which the other images are aligned
    [/background_layer]
[/part]
Same order goes for the lieutenant image.
Author of the Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
Standalone works: The Ravagers - now for 1.14, with new bugs!
nexusrebirth
Posts: 14
Joined: November 15th, 2019, 8:54 pm

Re: Nested quoted string, can someone help me ?

Post by nexusrebirth »

WhiteWolf wrote: August 7th, 2020, 12:26 pm
nexusrebirth wrote: August 6th, 2020, 4:04 pm i'm only getting maps/background.jpg in the screen
It's because I made a small mistake, sorry for that, I confused the order of the layers. They are put onto each other from top to bottom, so in the example code in my previous post, background.jpg is the top layer, completely hiding the map which is just behind it. My other mistake is that base_layer should also be the map and not the background, because we want to align the other images to that one. Here's the correct code:

Code: Select all

[part]
    story= _ "..."
    [background_layer]                          # first layer - the background
        image=maps/background.jpg
        scale_vertically=yes
        scale_horizontally=no
        keep_aspect_ratio=yes
    [/background_layer]
    [background_layer]                          # second layer, the map
        image=maps/titlescreen.png
        scale_vertically=yes
        scale_horizontally=no
        keep_aspect_ratio=yes
        base_layer=yes                          # which is also the base layer, to which the other images are aligned
    [/background_layer]
[/part]
Same order goes for the lieutenant image.
Hi, sorry for the late reply :(. I will try that, thank you :)
Post Reply