This accomplishes two main things:
- Creates a mapgen_helper.lua module containing functions useful for Lua map generators
- Paves the way for allowing the cave generator to produce scenarios and accept user configuration
No need to deselect when it was already done.
While this is the fix for the specific complaint, it does not address the larger issue of [message] being generally slow.
Adds the keys: mirror, second_image, second_mirror. These allow a portrait to be displayed on the right and left of a message simultaneously as well as to mirror them.
This map generator is used in HttT 17 and SoF 4. which needed to be updated aswell.
With this we finally have a lua generator that is used in mainline and that
can be used an an example by wml authors who want to write other map generators.
Unfortunateley there are still umc add ons in 1.12 that use
scenario_generation=cave so i didn't remove the cpp implementation yet.
Missing role for [role] caused runtime errors. Do NOT report an error on this; using an empty string is intentional. It allows type-prioritized recalls!
"I want to recall the two highest-level bowmen and, if needed, will recruit them. They don't have a role, and won't need one later."
[repeat]
times=2
[do]
[role]
search_recall_list=only
type=Master Bowman,Longbowman,Bowman
[auto_recall][/auto_recall]
[else]
[unit]
placement=leader
side=1
type=Bowman
[/unit]
[/else]
[/role]
[/do]
[/repeat]
When specified, replace rather than merge the [unit] sub-tags. Does not effect [object], [trait], [effect] or [advancement].
For example:
[modify_unit]
[filter]
id=Deoran
[/filter]
mode=replace
[filter_recall]
[not]
id="Sir Gerrick"
[/not]
[/filter_recall]
[/modify_unit]
will replace the current contents of [filter_recall] with the given contents. Without mode=replace, the contents would be appended to the previous contents.
Add search_recall_list=only to search the recall list, but not the map
This is intended as a more clear way of doing 'x,y=recall,recall' and omitting search_recall_list. Note that search_recall_list=no with x,y=recall,recall produces a useless [role] which only runs the [else] block(s).
Add reassign attribute
Optional attribute, default 'yes'. If 'no' then do not re-assign the role if a unit already has the role. If 'no' and no unit has the role, the role is still assigned.
Refactor auto_recall as a sub-tag
Instead of a yes|no attribute, if there is an [auto_recall] sub-tag then recall the unit from the recall list. This acts as a [recall] tag without any StandardUnitFilterto which we add id=$unit.id and issue the recall.
This is meant to replace ~RIGHT() and also the newer ~LEFT(),
with one exception: ~RIGHT() will still be the standard way to
make a unit's portrait go on the right by default.
victory is an unsynced event to its potentially unsafe to change the
gamestate in it, this mostly effects LoW (which can be played as a mp
campaign) where i replaced most victory events.
But it also effects sp becasue it can casue bugs to create units in
unsynced events which are used later (here: in later scenarios), so i
replaced also all sp victory events that do that.
Note that the 'scenario_end event'+'proceed_to_next_scenario filter' has
a slightly different meaning than 'victory event': the second gets fired
when there is a local human side who won the scneario while the first
gets fired if there is any human side who on the scenario. In sp this
is the same since there are no remote human sides, but in mp this is the
reason why the first is synced and the second is not.
We could add a seperate event for this case ("before next scenario" or
similar) for easier use, but i didn't find a good name for
that yet.
- search_recall_list=yes|no (default yes)
- [else] tag which is run if no unit matches
- auto_recall=yes|no (default no) which recalls the unit if it's on the recall list