replacing some [while] with [repeat] or [random_placement]
Adding terrain= attribute to the variable generated by [random_placement] this mkaes it easier to use [random_placement] as a replacement for [store_locations] + [while] since [store_locations] also generates the [terrain] attribute:
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.
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.
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.
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.
This is more about adding Lua API for things that should have it than porting WML tags to Lua.
The following new Lua API functions have been added to the wesnoth table:
- add_fog, remove_fog
- add_sound_source, remove_sound_source, get_sound_source
- log
- ~LEFT() does the opposite of ~RIGHT(), but takes higher priority;
use it to force an image to the left that's normally on the right
(eg female silver mage)
- image=~RIGHT() means "use normal portrait, but on the right"
name= has no effect but can be used to delete the item. I also changed
[item] to automatically create an id (in case no id was given) and
return that (only usable if called from lua).
I used the id= field from overlay class for this, it was previously only
used by the editor. Not sure if it is a good idea to reuse the id field.