And related commits.
This reverts commit 545253ec2b.
This reverts commit 1215f65eb8.
This reverts commit 11664f4024.
This reverts commit e948df3424.
This reverts commit 3781e7839f.
This commits were reverted to exclude them from wesnoth 1.13.2 release because:
1) We are still unsure about the best name oftthese attributes
2) This breaks multiple campaigns, including LoW and the tutorial.
Feel free to revert this revert after 1.13.2 when thse issues can be solved..
And also other commits that used that function.
This reverts commit 0d8c008018.
This reverts commit 956e5f9322.
This reverts commit 8f35c4bfcf.
This reverts commit dcb265ae70.
This commit just contained too many bugs, including:
1) string_to_color not parsing any input correctly
2) string_to_color segfaulting on some input strings
3) missing backwards compability in [unstore_unit]
This means the Lua code implementing the WML tags are now solely
responsible for parsing the comma-separated id list. It just so happens
that I added code for that without realizing that I was duplicating
existing functionality on the C++ side.
As a result:
* wesnoth.add_time_area and wesnoth.remove_time_area can operate on
time area ids that contain commas (if someone feels this is needed
for some weird reason)
* [time_area] no longer warns about adding time areas with commas in
their ids (actually adding the first id of the list instead)
* [time_area] remove=yes and [remove_time_area] still handle
comma-separated lists of ids, in the Lua side instead of C++.
This makes the Lua API for this consistent with [event]/[remove_event].
Since the Lua API functions in question are undocumented at this moment,
it's unlikely this impacts anyone, really.
http://gna.org/bugs/?23490
This makes it possible to store variables inside the side with the lua
functions get/set_side_variable. These variables are carried over along
other side specific data(units, gold)
unit.variables now uses the same functionality as
wesnoth.get/set_variable (just for the unit variable instead of the game
variables) which makes it possible to access table values. Its also
posible to access subvariables as
unit.variables["list1[2].list2.length"]
Note that is not possible to use untore_unit/put unit inside those
effects becasue it will casue infinite recirsion.
Intead you can eigher use direct lua unit modification or use reuse
effects with wesnoth.add_modification(u, ..., , ..., false)
The main problem here was, that [effect]s are often applied in unit's
constructor where is was previously not possible to create a lua_unit
refering to that unit, to fix that i had to change lua_unit, luaW_checkunit
and luaW_getunit.
- Removes 1-argument form accepting an integer ID
- Adds 1-argument form accepting a string ID
- Now accepts locations either as 2 arguments or as {i,j} or {x=i,y=j}
previously there was one function which sometimes returned a wml table
and sometimes a map integer to wml tables dependent on its parameters.
Now there are 2 different functions: wesnoth.synchronize_choice and
wesnoth.synchronize_choices. the first one handles the case where you just
want to get a choice from one side and thus it returns just one wml
table. The second function handles the case where you want to get
choices from multiple sides. that function retruns a table of wml
tables.
I also added an optional string parameter to that function specifying
the type of that choice (this is useful to make replays more robust and
readable)
This can be used like in the following example (note that without the
[unsynced] it would cause OOS becasue rand= might or might not be
called.):
[unsynced]
[store_side]
variable = "side"
side = "$side_number"
[/store_side]
[if]
[variable]
name = "side.controller"
equals = "human"
[/variable]
[then]
[set_variable]
name = "num"
rand = _ "two,four,seven"
[/set_variable]
[message]
message = _ "I want $num stones"
[/message]
[/then]
[/if]
[unsynced]
This change maintains backwards compatibility
- [advance] will still work if present
- attempts to add [advance] via Lua will instead add [advancement].
- The "category" property is mainly for use by scenario designers; players will be able to hide labels based on this
- The "creator" property is meant to allow players to hide labels placed by specific other players
- Map editor allows setting the "category" property
previously there were 2 flags share_view=yes/no and share_maps=yes/no,
but only 3 possible settings (share both, share none, only share shroud)
(so share_maps= was ignored if share_viewv=yes). This made the wml code and
the c++ code needlessly complicated.
Now these 2 flags are replaced by share_vision=all/shroud/none
http://gna.org/bugs/?23677
units advancements is an array of wml tables.
This also adds template lua_push/lua_check functions wich also accept
vectors or similar. The file scripting/push_check.hpp was written using msvc
which implements look-up in template functions differently so it might be
necessary to fix it for other compilers by adding forward declarations of
those template functions.