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
Added some features:
1) on_event now supports a comma separated list of event names in its first parameter
2) on_event now supports a number as second parameter that specifies in which order the event handlers are called.
3) on_event now passes wesnoth.current.event_context to the handler function, since the handler function will most likeley need it.
Firstly, there was a typo in the parse_fog_cfg utility function.
Secondly, wesnoth.get_sides returns a table of side proxy tables, not a
list of side numbers. I changed [lift_fog] and [reset_fog] to iterate through
the table returned by parse_fog_cfg.
this has 2 advantages:
1) It decreased savefile size since the event is no longer sotred in
each savefile.
2) The ABILITY_FEEDING no longer assumes its used from within
[abilities]
This means [object], [advancement], and [trait] tags within [modify_unit]
can now use delayed_variable_substitution=yes.
This is currently needed for adding teleport, backstab, and leadership abilities.