Strange problem with comma-delimited multi-line lists

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Can-ned_Food
Posts: 217
Joined: December 17th, 2015, 10:27 pm

Strange problem with comma-delimited multi-line lists

Post by Can-ned_Food »

OS: GNU-Linux (3.16 Debian 8 and all that)
Wesnoth: 1.12.6 English, via jessie-backports a.p.t. — 1:1.12.6-1~bpo8+1

I noticed this problem when i upgraded to 1.12 from 1.10.
The problem occurs here:

Code: Select all

[multiplayer]
    [side]
        recruit = "Wose,
          Lich"
    [/side]
[/multiplayer]
Try it with no indentation and with 0x2B catenating the lines, i.e.

Code: Select all

        recruit = Wose,+
Lich
et c., and I receive the same result:

That [side] and any subsequent [side], until a single-line or unmodified recruit= is encountered (see below), will appear . . .
  • with the name “Custom” for their faction;
  • with the leaders from each other afflicted [side] appended, in order as defined in the pertinent [era], to the drop-down list of available leaders;
  • the units available for recruiting with any sampled participant are as would be expected if there were no problem — i.e. not pooled together, and e.g. with the above I would have both the Lich and the Wose available
There do not seem to be any concerns for stability thus far, and the glitch seems quite local to that one such multiplayer session. It is rather strange, though, that having the same format with my

Code: Select all

[era]
    [multiplayer_side]
        recruit = "Wose,
          Lich"
    [/multiplayer_side]
[/era]
definitions causes no such problems or indeed any noticable peculiarities.
Supposably the problem then is not concerned with parsing but with storage or retrieval of the values.

Here is a full example for your experimentation:

Code: Select all

[era]
    [multiplayer_side]
        id =    faction_Merfolk
        name =    _ "Merfolk"
        flag_rgb =    purple
        leader =    "Merman Triton,
            Mermaid Diviner"
        recruit =    "Merman Fighter,
            Merman Hunter,
            Mermaid Initiate"
        [ai]
            recruitment_pattern =    "fighter,
                mixed fighter,
                mixed fighter,
                mixed fighter,
                fighter"
        [/ai]
    [/multiplayer_side]
    [multiplayer_side]
        id =    faction_GameKeepers
        name =    _ "the GameKeepers"
        flag_rgb =    black
        leader =    Drake Flameheart
        recruit =    Naga Fighter
    [/multiplayer_side]
[/era]
[multiplayer]
    [side]
        faction =    faction_Merfolk
        type =    random
#       recruit =    "Merman Fighter,Merman Hunter,Mermaid Initiate,Merman Warrior,Merman Spearman,Merman Netcaster,Mermaid Enchantress"
        recruit =    "Merman Fighter,
            Merman Hunter,
            Mermaid Initiate,
            Merman Warrior,
            Merman Spearman,
            Merman Netcaster,
            Mermaid Enchantress"
    [/side]
    [side]
        faction =    faction_GameKeepers
        type =    Drake Flameheart
    [/side]
[/multiplayer]
User avatar
Celtic_Minstrel
Developer
Posts: 1759
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: Strange problem with comma-delimited multi-line lists

Post by Celtic_Minstrel »

This does seem quite strange... now that I see the full info, I'm not sure what the problem could be. Maybe someone else will have an idea.
Author of The Black Cross of Aleron campaign and Default++ era.
Maintainer of Steelhive.
gfgtdf
General Code Maintainer
Posts: 1344
Joined: February 10th, 2013, 2:25 pm

Re: Strange problem with comma-delimited multi-line lists

Post by gfgtdf »

Are you sure this is related to the newline in th recruitlist? does it also hapen if you use the commented out rectuilist line of your last code?
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Tad_Carlucci
Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Strange problem with comma-delimited multi-line lists

Post by Tad_Carlucci »

There may be non-space whitespace in there.

I find it best to use quoted strings when concatenating, especially across lines. ie

Code: Select all

[era]
    [multiplayer_side]
        recruit = "Wose," +
            "Lich"
    [/multiplayer_side]
[/era]
If in doubt, if possible I will sometimes copy the offending section into a tiny testbed campaign I keep around just for this purpose, load it, and peek at the results with debug/inspect. Just hang it inside an event and see what it shows there. My goal, there, is a 'proper' string with no excess spaces at all.
I forked real life and now I'm getting merge conflicts.
Can-ned_Food
Posts: 217
Joined: December 17th, 2015, 10:27 pm

Problem is not with the multi-line tag

Post by Can-ned_Food »

Well, I tried to replicate it a few more times and even a single-line [side]recruit= would cause the glitch. I guess that's what happens when you don't retain all your test case data. Moron. :oops:

Anyways, so now the problem is relieved if I have no [side]recruit= declarations whatsoever. Any [side]leader= is, of course, cleanly ignored.
gfgtdf
General Code Maintainer
Posts: 1344
Joined: February 10th, 2013, 2:25 pm

Re: Strange problem with comma-delimited multi-line lists

Post by gfgtdf »

I think that what you describe here is the expected, behaviour the a [side] has a non-empty recruit= then this recuitlist is used to create a "Cusom" faction for hat side with all leaders in the era avaiable, you can add a fr to use leader= in [side] in such a case too but in any case this will can only be added in wesnoth 1.13/1.14 then
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Tad_Carlucci
Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: Strange problem with comma-delimited multi-line lists

Post by Tad_Carlucci »

I ran across this examining DM S11 'Wasteland' where I was examining the fact that Delfador could recruit Elves before having actually met and joined up with them.

My first attempt was to simply remove the recruit list from the [side]. Then to set recruit empty (both = and =""). Neither worked since, for the era in use, the default recruitment is those same Elves. To solve the issue, I added a [disallow_recruit] for the side during prestart, omitting recruit=. Then, later, [set_recruit] provided the desired list.

The issue is what is the meaning of "not specified" and "specified as empty" and that varies by tag. When it comes to [side] and (implicitly) [unit] the wiki does not appear to list recruit= as an option, so, perhaps, we can understand the confusion.
I forked real life and now I'm getting merge conflicts.
Post Reply