1131 Commits

Author SHA1 Message Date
Celtic Minstrel
1e0bab4a04 Address review comment about API function parameter name 2025-01-15 09:46:42 -05:00
Celtic Minstrel
2fe080d968 Lua API: Plugins can now execute gamestate code once they are in the game context. 2025-01-15 09:46:42 -05:00
Celtic Minstrel
0f05094933 Lua API: Add a new plugin module with some useful functions for plugins 2025-01-15 09:46:42 -05:00
ZombieKnight
9b0430e1f7 Update message.lua 2024-12-20 20:57:48 -05:00
gfgtdf
06d1fade32 split gold_carryover into smaller functions
this way the functions can easily be reused for alternative
carryover implementations.
2024-12-15 05:17:57 +01:00
gfgtdf
f29f8fb368 move the carryover gold handling and dialog to lua
The idea is to make it easier for umc devs to implement
their own carryover / early finish bonus mechanics. Maybe
we can also make use of it in Worls Conquest.
2024-12-15 05:17:57 +01:00
Gunter Labes
b905c1aa4a
Allow accessing the old value in [set_var] formula= 2024-11-08 09:35:43 +01:00
Tóth Kornél
76f20a6149
Better action WML error handling 2024-10-12 22:23:52 +02:00
Celtic Minstrel
4062f579e3
Fix #9360 2024-10-02 09:05:24 -04:00
Celtic Minstrel
c7ad093ac5 Lua API: Avoid trying to iterate a userdata in location_set.of_pairs
Fixes #9345
2024-09-15 15:27:39 -04:00
Celtic Minstrel
ab022c09ae Lua API: Add unit:rebuild
Fixes #9314
2024-09-15 15:27:39 -04:00
Celtic Minstrel
6d8a17aa8d Lua API: Add mathx.lerp_index and wesnoth.game_config.palettes 2024-09-15 15:27:39 -04:00
Celtic Minstrel
fc86cb0b93 WFL: Add replace_all, starts_with, and ends_with string functions.
The latter two are also added to the Lua stringx module.
2024-09-15 15:27:39 -04:00
Celtic Minstrel
2a26a68025 Some updates to Lua map location operations
* Rename the vector operations to hex_vector (to emphasize that they are NOT standard vector ops) and document them as official API
* Add new get_hexes_at_radius, which returns an unfilled ring (as opposed to get_hexes_in_radius which returns a filled circle)
* Expose the new cubic coordinate conversions
2024-09-15 15:27:39 -04:00
Gunter Labes
41729833c8
Include the unknown condition in the error message 2024-09-13 21:50:17 +02:00
Celtic Minstrel
8baf95601d [LuaDoc] Mark filesystem.asset_type as an enumerator 2024-08-13 08:54:04 -04:00
Celtic Minstrel
faaeaadaa1 [Lua] Avoid missing field warning by reversing the order of the check 2024-08-13 08:54:04 -04:00
Celtic Minstrel
9e79a627c3 [Lua] Fix some accidental global warnings 2024-08-13 08:54:04 -04:00
Celtic Minstrel
dd24051c17 [Lua] Mark location_set.values as private 2024-08-13 08:54:04 -04:00
Celtic Minstrel
b6da8a705f [Lua] Avoid variable reuse as a different type 2024-08-13 08:54:04 -04:00
Celtic Minstrel
542581916f [Lua] Suppress some diagnostics and also recommend suppressing certain diagnostics globally 2024-08-13 08:54:04 -04:00
Toom
31658e2587
Set unit hitpoints to 0 during [kill] (#9164) 2024-08-10 09:20:12 -05:00
Tahsin Jahin Khalid
d467632398
[objectives.lua] improve clarity of error message (#8780) 2024-08-03 11:24:41 -05:00
Pentarctagon
5c3188581b
update CI to Ubuntu 24.04 (#9139) 2024-07-28 13:07:59 -05:00
Celtic Minstrel
a9948d3fff [Lua.MapGen] Accept both comma-separated lists and arrays for f.adjacent 2024-07-21 19:58:03 -04:00
Celtic Minstrel
19f3682bdf [Lua.Mapgen] Add a few more ways to pass a location set to f.find_in
These may be less efficient in some cases, and there's even a couple of degenerate cases, but it's definitely easier to use like this.

This also adds an example of the original method, using a string to reference a separate list.
2024-07-21 19:58:03 -04:00
Celtic Minstrel
a72ec39f79 [Lua] Make f.is_loc work either with a location object or with separate x,y parameters 2024-07-21 19:58:03 -04:00
Celtic Minstrel
95bfd07286 [Lua.MapGen] Exposed previously-unused wesnoth.map.filter_tags.onborder filter since it seems useful 2024-07-21 19:58:03 -04:00
Celtic Minstrel
ab008161f1 [Lua.MapGen] Add wesnoth.map.filter_tags.formula that takes a WFL formula to match against locations 2024-07-21 19:58:03 -04:00
Toom
dbbee82d9c validate [screen_fade] required parameters 2024-07-21 17:48:45 -05:00
Celtic Minstrel
c96196cd4d [Lua] Use game_events.add for feeding instead of add_repeating 2024-07-20 11:09:33 +02:00
Gunter Labes
944ed026a2 Use same default id in [remove_unit_overlay] as [unit_overlay] 2024-06-13 18:02:05 +02:00
Toom
9e08a78bf5
Reject [terrain] with unknown terrain type 2024-05-21 11:34:41 +02:00
Celtic Minstrel
058d0502e5 [Lua] Update obsolete use of [1],[2] to refer to locations, and simplify some code by leveraging the fact that any object with x,y qualifies as a location; also use moves_left for reachmaps instead of [3] 2024-05-19 12:54:35 -04:00
Celtic Minstrel
f5c4f2e841 [Lua] Update obsolete usage of [1],[2] to refer to a tag's name and contents 2024-05-19 12:54:35 -04:00
Celtic Minstrel
0f6fe67477 [Lua] Use wml.tag to construct WML tables 2024-05-19 12:54:35 -04:00
Celtic Minstrel
7aa5450a41 [Lua] Replace gui.show_inspector's undocumented config parameter with a string parameter that does the same thing.
It's still supported to pass a config, just in case anything relied on that.

This also updates the LuaDoc documentation at the same time.
2024-04-11 23:49:15 -04:00
Celtic Minstrel
d734bfb9e2 [Lua] Make wesnoth.read_location return its result in standard named tuple format 2024-04-11 23:48:21 -04:00
Celtic Minstrel
bb3c95ebbc [Lua] Remove nonexistent parameter 2024-02-26 13:24:38 -05:00
Celtic Minstrel
1fd17d94ba [Lua] Fix missing parameter warning when passing empty filter 2024-02-26 13:24:37 -05:00
Celtic Minstrel
1efc2fbe4d [Lua] Avoid reusing no-longer-needed variables for different meanings
This raises Lua warnings about mismatched types
2024-02-26 13:24:36 -05:00
Celtic Minstrel
f19b7829c7 [Lua] Fix call of nonexistent function 2024-02-26 13:24:36 -05:00
Celtic Minstrel
b506010a8f [LuaDoc] Correct some dumb errors 2024-02-13 19:29:21 -05:00
Celtic Minstrel
4b5a8e25e8 [LuaDoc] Suppress some diagnostics 2024-02-13 19:29:21 -05:00
Celtic Minstrel
6145c48d35 [LuaDoc] Fix incorrect declaration of unit.variables and side.variables - make them consistent with wml.variables 2024-02-13 19:29:20 -05:00
Celtic Minstrel
e644613cae [LuaDoc] mathx.random_choice can return nil if the input list is empty 2024-02-06 19:04:02 -05:00
Celtic Minstrel
a38e67da45 [LuaDoc] Title is optional for alert/confirm 2024-02-06 19:04:02 -05:00
Celtic Minstrel
f9c7336f1a [LuaDoc] Document location_set operators 2024-02-06 19:04:01 -05:00
Celtic Minstrel
c7741907c2 [LuaDoc] Fix several errors in the inline documentation 2024-02-06 19:04:00 -05:00
Celtic Minstrel
5a51a309a4 [LuaDoc] Fix several minor errors in the specification of API 2024-02-06 19:04:00 -05:00