v1.15.18 [side] leader not being created

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
User avatar
Spannerbag
Posts: 505
Joined: December 18th, 2016, 6:14 pm
Location: Yes

v1.15.18 [side] leader not being created

Post by Spannerbag »

Hello to what is becoming a series...

I've ported my work-in-progress UMC from 1.14 to 1.15 and am currently (re)playesting the existing (worked in 1.14) code.
Now I have another fun query.

In the first instance I'd just like a fresh pair of eyes to check my WML and ensure I'm not doing something stupid.

The problem
Side 3's leader (Cobblenog) does not appear. I cannot sensibly test this scenario until this is fixed but am running out of ideas.
There are 7 sides in all but I've only included the top 3 here for brevity and clarity.

Code: Select all

[scenario]
  id=09_medley
  name=_"Medley"
  next_scenario=10_slaughter
  map_data="{~add-ons/LSB/maps/09_medley.map}"
  turns={HEW_ARRIVE_TURN}
  victory_when_enemies_defeated=no

  [side]
    team_name=woses
    user_team_name= _ "Elves"
    side_name=_"Alacritous"
    side=1
    {ALACRITOUS}
    x,y=9,22
    save_id=Greenstock
    recruit=
    controller=human
    {GOLD 160 150 140}			# No carryover.
    color=brightgreen
    {FLAG_VARIANT wood-elvish}
    fog=yes
    shroud=yes
  [/side]

# Dwarves (arrive later)
  [side]
    team_name=woses
    user_team_name= _ "Dwarves"
    side_name=_"Hew"
    side=2
    no_leader=yes
    recruit=
    controller=null
    gold=0
    {NO_INCOME}
    color=gold
    {FLAG_VARIANT knalgan}
    fog=yes
    shroud=yes
    hidden=yes
  [/side]

# Dwarvish Civilians
  [side]
    team_name=woses
    user_team_name= _ "Dwarvish Civilians"
    side_name=_"Cobblenog"
    side=3
    type=Dwarvish Miner
    x,y=3,8
    id=Cobblenog
    name=_"Cobblenog"
    unrenamable=yes
    canrecruit=yes
    [modifications]
      {TRAIT_STRONG}
      {TRAIT_HEALTHY}
    [/modifications]
    recruit=Dwarvish Mason,Dwarvish Tinker	# Cobblenog only recruits *regular* civilians
    controller=ai
    gold=60					# Recruit a full keep at start
    income=20					# Should recruit at least 1 civ each turn (even with a few levelled up units)
    [ai]
      grouping=offensive
      passive_leader=yes			# Cobblenog stays put (until Hew arrives)
    [/ai]
    color=gold
    {FLAG_VARIANT knalgan}
    hidden=no
  [/side]
Note: when side 2 units appear, the side changes thus:

Code: Select all

    [modify_side]
      side=2
      controller=human
      income=2
      hidden=no
    [/modify_side]
and elsewhere amount={ON_DIFFICULTY 160 150 140}

This is why side 2 has fog=yes and shroud=yes. I did comment these out but it made no difference.

Interestingly, sides with no_leader=yes start the scenario with lost=yes and side 3 is the same, despite having a leader.
Here's an inspect snippet (scroll to end for relevant setting):

Code: Select all

action_bonus_count=0
allow_player=yes
auto_shroud=yes
carryover_add=no
carryover_bonus=1
carryover_gold=0
carryover_percentage=80
chose_random=no
color="gold"
controller="ai"
countdown_time=0
current_player=""
defeat_condition="no_leader_left"
disallow_observers=no
faction="Custom"
faction_name=_"Custom"
flag="flags/knalgan-flag-[1~4].png:150"
flag_icon="flags/knalgan-flag-icon.png"
fog=no
fog_data=""
gold=60
hidden=no
id="Cobblenog"
income=20
lost=yes
no_leader=no
There are no errors in-game, the unit simply does not appear.
Everything else (as far as I can test) seems fine: side 1, music, schedule and story.

What I've tried that hasn't worked
Explicitly set no_leader=no
Removed side 2 and made side 3 into side 2
Made side 2 controller=human (with side 3 as above)
Made side 3 controller=human (with side 2 as above)
Used starting position in map rather than x,y=3,8
As mentioned previously, commented out side 2 fog=yes and shroud=yes.
The logfile complains about custom terrain (ignored because custom terrain works fine in game and I cannot find any fix?) but does not mention anything relevant to this issue.

The errors below probably have nothing to do with the problem here - but are included in case I'm wrong...

This may not be relevant but the logs usually contain the "standard" custom terrain error of:

Code: Select all

20211012 18:16:14 error config: Error while loading the map: Unknown tile in map: (Aa^Vlwy) 'Aa^Vlwy'
20211012 18:16:14 error config: Error while loading the map: Unknown tile in map: (Aa^Vlwy) 'Aa^Vlwy'
20211012 18:16:16 error config: Error while loading the map: Unknown tile in map: (Aa^Vlwy) 'Aa^Vlwy'
20211012 18:16:16 error config: Error while loading the map: Unknown tile in map: (Aa^Vlwy) 'Aa^Vlwy'
20211012 18:16:19 error config: Error while loading the map: Unknown tile in map: (Aa^Vlwy) 'Aa^Vlwy'
Even though this terrain works fine?

However sometimes it instead reports:

Code: Select all

20211012 18:18:24 warning filesystem: Conflicting files in binary_path: 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\LSB\images\terrain\snowbits\snowbits3.png' and 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\stub\images\terrain\snowbits\snowbits3.png'
20211012 18:18:24 warning filesystem: Conflicting files in binary_path: 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\LSB\images\terrain\snowbits\snowbits.png' and 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\stub\images\terrain\snowbits\snowbits.png'
20211012 18:18:24 warning filesystem: Conflicting files in binary_path: 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\LSB\images\terrain\snowbits\snowbits4.png' and 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\stub\images\terrain\snowbits\snowbits4.png'
20211012 18:18:24 warning filesystem: Conflicting files in binary_path: 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\LSB\images\terrain\snowbits\snowbits2.png' and 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\stub\images\terrain\snowbits\snowbits2.png'
20211012 18:18:24 warning filesystem: Conflicting files in binary_path: 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\LSB\images\terrain\ci\ci.png' and 'C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\stub\images\terrain\ci\ci.png'
Just to clarify this last I've split one of the lines up, so that the path conflict is clearer:

Code: Select all

C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\LSB\images\terrain\snowbits\snowbits3.png
C:\Users\USER\Documents\My Games\Wesnoth1.15\data\add-ons\stub\images\terrain\snowbits\snowbits3.png
I tried to fix this in various ways but the old settings seemed to be expected (makes sense I suppose, the game won't expect terrain to change mid-campaign). Having said that I didn't try everything (e.g. delete the conflicting files in stub).
I'm surprised that the game complains because yes, the actual terrain images share the same name but the filepaths are different and the campaigns have different namespaces...

Anyway, if anyone has any ideas or suggestions I'd be very grateful.

Otherwise I'll just keep trying random stuff in the hope that something works or remove chunks of code until what's left works (could be a long job hence I hope I have done something wrong)...

Cheers!
--Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Pentarctagon
Project Manager
Posts: 5526
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: v1.15.18 [side] leader not being created

Post by Pentarctagon »

I'd suggest trying the [leader] tag.

The warning is there because Wesnoth doesn't reference images by their absolute path, it references them by the path relative to images. Thus terrain\snowbits\snowbits3.png is identical to terrain\snowbits\snowbits3.png and it then has to choose which image to use and which image to ignore. Wesnoth has also always worked this way - the only new thing here is that it's now warning when this situation occurs.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
vghetto
Posts: 755
Joined: November 2nd, 2019, 5:12 pm

Re: v1.15.18 [side] leader not being created

Post by vghetto »

Maybe change the side defeat condition like so:

Code: Select all

[modify_side]
side=3
defeat_condition=never
[/modify_side]
and then change it back after they appear.
User avatar
Spannerbag
Posts: 505
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: v1.15.18 [side] leader not being created

Post by Spannerbag »

Pentarctagon wrote: October 12th, 2021, 6:50 pm I'd suggest trying the [leader] tag.
Many thanks for the suggestion - but sadly no change :(
I can't find any info regarding the lost value within side but if I could discover how/why that is being set to yes I rather suspect that would greatly enlighten me. Any idea where I might find any background on this?

Pentarctagon wrote: October 12th, 2021, 6:50 pm The warning is there because Wesnoth doesn't reference images by their absolute path, it references them by the path relative to images. Thus terrain\snowbits\snowbits3.png is identical to terrain\snowbits\snowbits3.png and it then has to choose which image to use and which image to ignore. Wesnoth has also always worked this way - the only new thing here is that it's now warning when this situation occurs.
OK - changed subdirectory names so they now have a namespace-like prefix.
Should, I hope, stop the binary path conflicts but haven't rigorously tested this yet (map editor still finds all the terrains).

Ah well, will probably start with a minimalist setup and see if that works...
If it does I'll add stuff until something breaks it.

If that doesn't work, I'll try and replicate the behaviour in my test campaign.

Thanks again for your explanation and suggestion!

Cheers!
--Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 505
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: v1.15.18 [side] leader not being created ***FIXED***

Post by Spannerbag »

vghetto wrote: October 12th, 2021, 10:24 pm Maybe change the side defeat condition like so:

Code: Select all

[modify_side]
side=3
defeat_condition=never
[/modify_side]
and then change it back after they appear.
Many thanks for the suggestion - that wasn't the problem but it forced the system to report what the fault was.
As I'd rather suspected I had done something daft - I'd got the unittype wrong :doh: :augh: :doh: :augh: :doh:

Funny thing is the same typo was in the v1.14 code and a) I never spotted it and b) it worked... so it must've got a unittype from somewhere...
Anyway, fixed the leader unittype and it works fine, so many thanks for the suggestion.

I must've reviewed that code a dozen times over the last few days and never noticed the typo.
I'm going senile.
Put me in a home.
I'll just drool quietly in a corner...

Very annoyed with myself and sorry I wasted your time.

Only another 3 scenarios (including this one) to test on v15 then I can resume code/test of new stuff.

Cheers,
--Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Post Reply