Duplicate entries in unit encyclopedia

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
The_Gnat
Posts: 2165
Joined: October 10th, 2016, 3:06 am
Contact:

Duplicate entries in unit encyclopedia

Post by The_Gnat »

Hi! (I haven't posted for a while so sry if this is the wrong forum)

My Reign of the Lords add-on duplicates alot of units (using [base_unit] code to make slight modifications, usually to who the unit advances to).

However, this fills the encyclopedia with twice as many entries.

Is there a way to hide the new units created with [base_unit] so that they dont show up when browsing the encyclopedia?

(Note I do still want them to have unit descriptions when right clicked on) :)

Thank you!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon
Co-designer of the (not-wesnoth) space combat video game Planet Bounce.
User avatar
MoonyDragon
Posts: 126
Joined: November 29th, 2017, 5:46 pm

Re: Duplicate entries in unit encyclopedia

Post by MoonyDragon »

The_Gnat wrote: February 10th, 2021, 11:13 pm Is there a way to hide the new units created with [base_unit] so that they dont show up when browsing the encyclopedia?

(Note I do still want them to have unit descriptions when right clicked on) :)
I'd recommend you to hide the base/core units and to show the modified units instead. You can accomplish that via [hide_help].
Default L0 Era - Level 1 leaders with level 0 recruits!
User avatar
The_Gnat
Posts: 2165
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Duplicate entries in unit encyclopedia

Post by The_Gnat »

MoonyDragon wrote: February 11th, 2021, 9:00 am I'd recommend you to hide the base/core units and to show the modified units instead. You can accomplish that via [hide_help].
That's a good idea! I'll do that! :D
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon
Co-designer of the (not-wesnoth) space combat video game Planet Bounce.
User avatar
The_Gnat
Posts: 2165
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Duplicate entries in unit encyclopedia

Post by The_Gnat »

This feels very straight forward, so I apologize for being dumb.

I've tried:

Code: Select all

[unit_type]
    [base_unit]
		id=Dune Paragon
    [/base_unit]
    id=ROLDune Paragon
    experience=285

	[hide_help]
		type=Dune Paragon
	[/hide_help]

...
[/unit_type]
However, both Paragon's were still in the menu system. I also tried type_adv_tree=Mage but that didn't do anything either.

Only things I can think of:

A) Will this also affect the help in the main menu (I didn't actually load a game just looked at the unit trees from mainmenu, I assume that should be modified) EDIT: Tested in game to the same outcome

B) Am I supposed to include this inside the [unit_type] like I am currently?
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon
Co-designer of the (not-wesnoth) space combat video game Planet Bounce.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 1362
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Duplicate entries in unit encyclopedia

Post by Lord-Knightmare »


Only things I can think of:

A) Will this also affect the help in the main menu (I didn't actually load a game just looked at the unit trees from mainmenu, I assume that should be modified) EDIT: Tested in game to the same outcome

B) Am I supposed to include this inside the [unit_type] like I am currently?
This [hide_help] tag belongs inside the [units][/units] of your #ifdef MULTIPLAYER

This example was from UtBS (which is also the only example of the tag I remember in mainline):
(Past tense since this was removed after quenoth was made a subrace of elf)

Code: Select all

[units]
    [hide_help]
        type_adv_tree=Elvish Fighter,Elvish Shaman,Elvish Archer,Elvish Scout,Elvish Lord,Wose
        type=Elvish Lady
    [/hide_help]
[/units]
vghetto
Posts: 399
Joined: November 2nd, 2019, 5:12 pm

Re: Duplicate entries in unit encyclopedia

Post by vghetto »

I think adding the line hide_help=yes would also work.

Example:

Code: Select all

[unit_type]
    [base_unit]
        id=Peasant
    [/base_unit]
    id=WF_Peasant
    advances_to=Spearman,Bowman,Sergeant
    hide_help=yes
    do_not_list=yes
[/unit_type]
Ignore this post if you meant to hide the original and not the derivative.
User avatar
The_Gnat
Posts: 2165
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Duplicate entries in unit encyclopedia

Post by The_Gnat »

Ah thank you Lord_Kniightmare I figured that it was going in the wrong place but haven't coded wml for a long time haha!
Creator of: The Reign of The Lords Era,The Gnats Franken Dungeon
Co-designer of the (not-wesnoth) space combat video game Planet Bounce.
Post Reply