Robertdebrus / ANLEra

ANLEra add-on for Battle for Wesnoth
GNU General Public License v2.0
2 stars 2 forks source link

Added macros to many things. #32

Closed Lukc closed 6 years ago

Lukc commented 6 years ago
Lukc commented 6 years ago

The last commit modifies how AI players get new recruits. The new recruits are now based on their side’s faction instead of their side’s number. All factions also have at least two additional recruits to gain, at turn 6 and 15 respectively (exactly as before).

This should probably be adapted to match vanilla ANL’s AI recruits (for orcs and undeads) and new units added for the other factions (preferably, adding those units at the same turns). If we did that, we could probably let the players choose their enemies on the A New Land scenario, but that’s another story.

sevu commented 6 years ago

I think you didn't see my last comment above.

Also, as you work a lot with marcos, I want to point out another new feature of 1.13 – optional macro arguments. https://wiki.wesnoth.org/PreprocessorRef#.23arg_and_.23endarg

They can also be used with multiline blocks, though in this case – in difference to the rest of wesnoth – one must start the parenthesis not after the equals sign, but before the arguments name. The Colosseum add-on has some examples.

Lukc commented 6 years ago

I have indeed missed it.

So, I should store the content of the macro parameter to a variable so that it can be used in the string? Or would you recommend something else?

I have seen the optional arguments for macros, but found them impractical for what I was working on. Maybe I missed something. I am keeping it in mind in case it becomes useful though.

sevu commented 6 years ago

Variables are one way to deal with that problem, though, here you would have the problem that you would need a different variable for different prices... you can split the string instead as I showed above, so that the macro is not part of a translatable string. Just be sure that _"g" will have a translators hint, as otherwise nobody would know how he should translate it.

Lukc commented 6 years ago

I think this should be ok. The translator hint thing is missing though, and I have no idea how to do it

Robertdebrus commented 6 years ago

Looks good! Thank you so much for working on this!

sevu commented 6 years ago

With the change of the University type, one is offered to build an university when standing on one, somewhere the terrain codes must be adjusted.

And another thing, do you as well get this for the Dwarvish Annalist (lvl1 mage) help With the unit files itself nothing looks wrong… The UNLTB part is usually shown if one uses another range or type than the default ones, and did not define it with the [language] tag. The … it looks like a translation mark. When regeneration the translation files I also do not get all strings (e.g. the `"g"` one is missing).

While it appears to be working, my first guess at troubleshooting this would be to always place the translation mark in front of the string, and to not add it in an macro somewhere else. Between the translation mark and the "string" can, but does not have to be a space – if one leaves it out one can easily add it to _"strings" which are given to a macro.

Lukc commented 6 years ago

I also noticed I broke the AI extra recruits in one of the following commits.

Lukc commented 6 years ago

The offer to build universities on university tiles should be fixed in b74dd2c80e617f4fe34ec144a9d872b4235aaddf.