WML [+tag] question

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
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

WML [+tag] question

Post by bruno »

The wiki suggests that by using [+tag]data[/tag] I can override existing WML data. However my testing doesn't seem to be going to well.
I expected the following snippet of code to modify the existing defintion for a Lich, but it doesn't seem to effect the definition of Liches that are recruited. I tried not enclosing the code in a campaign specific ifdef and not including the original Lich definition and got the same non-result. I also tried using a different value for the id key, but that resulted in an incomplete Lich King unit being available.

Code: Select all

[+units]
        {@data/units/Lich.cfg}
        [+unit]
                id=Lich
                name= _ "Lich King"
                level=4
                ability=leadership
        [/unit]
[/units]
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

The game does not allow you to override existing units. So, you will have to completely redefine your new unit, with all of the necessary values, and give it a distinct ID.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

turin wrote:The game does not allow you to override existing units. So, you will have to completely redefine your new unit, with all of the necessary values, and give it a distinct ID.
I tried using a different id value as well. I will have expected that to have overridden the one in the Lich file when the WML was read in, before any check to prevent overriding existing units.
You don't happen to know what source files cover reading in WML and checking for ovcerriding existing units?
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

I found some more on this. When the same key is used twice the values are concatenated instead of replaced by the latest value. Once I knew this, I could set the proper recruit value so that I could see the unit. This allowed me to find that I shouldn't have used 'data/' in the path above.
However, the behavior of concatenation instead of replacement conflicts with what the wiki says and I am going to see if I can find out what the intended behavior is and get the wiki in sync with the code.
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

After checking around I confirmed that the Wiki did correctly indicate how this was supposed to work and that the 1.0.1 behavior was broken. I have committed fixes to the 1.0 and 1.1 branches and it should be available generally when 1.0.2 is released.

While this isn't generally useful, I will be able to use it to have balancing changes to units that I am basing Gwiti off of in TDH get propagated to the special units.
Post Reply