79480 Commits

Author SHA1 Message Date
Celtic Minstrel
2d95c0f7d3 AI: Convert the FormulaAI example scenario to do all the same things using Lua
- Unit formulas are replaced by inline MicroAIs or candidate actions placed in the unit's [ai] tag.
  - The stationed_guardian MicroAI was chosen as the closest match to the guardian FormulaAI. It's not a perfect fit, but it's pretty close.
  - The goto and patrol MicroAIs are fairly obvious substitutes for the respective unit formulas.
  - The priority test in unit formulas is replaced by fairly basic inline non-external CAs with differing scores.
- The side formulas (opening.fai) have been converted to a separate Lua stage using a new opening.lua. However, that's only a partial conversion. The move and attack functionalities of opening.fai are missing from opening.lua; instead the built-in move, move leader to keep, and combat CAs are used.
- The scouting FormulaAI CA has been ported to Lua. It remains a very basic AI, probably not well-suited to genera use.
- The level up attack FormulaAI CA has been ported to Lua. Like the new scouting CA, this is mostly intended to serve as an example.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
98b91c9d0f AI: [micro_ai]side= can now take a list
Closes #6023
2021-09-04 22:20:28 -04:00
Celtic Minstrel
5d70dd9aca Lua: Add a new ai_helper debug function to print a simulate_combat HP distribution more succinctly 2021-09-04 22:20:28 -04:00
Celtic Minstrel
ff6894cee8 Lua API: Add a wesnoth.type() function
This checks both the Lua type and the metatable type to return a single unified result.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
e9465fa03e Lua API: Add alternative version of map function to be used on arrays 2021-09-04 22:20:28 -04:00
Celtic Minstrel
b22c3b595c Lua API: Fix functional.map returning the wrong answer if used on a table that contains numeric keys but is not strictly an array 2021-09-04 22:20:28 -04:00
Celtic Minstrel
bedc25fb56 Lua API: location_set:to_pairs now returns named tuples 2021-09-04 22:20:28 -04:00
Celtic Minstrel
35fce3fa3b Lua API: Fix an error in the terrain hex API
Attempting to access a non-string key was an error.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
fd8d11d42b Lua API: Fix an incorrect error message 2021-09-04 22:20:28 -04:00
Celtic Minstrel
28d2ffae6a AI: Fix assertion when trying to move to an off-map location
This could, for example, be triggered using ai.move().
2021-09-04 22:20:28 -04:00
Celtic Minstrel
644f5735da Lua AI: Fix non-integer candidate evaluation scores being treated as 0 2021-09-04 22:20:28 -04:00
Celtic Minstrel
4837452dd7 Lua API: Add new location_set function to convert to or from a Lua map
This enables a location set to be passed to map functions in the functional module.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
440dbbd0ad Lua API: The value function is now optional in functional.choose[_map]
By default, the functions now use the value taken directly from the map or array.
In addition, if a string or other non-functional value is passed, it's used as a key on the value.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
2c040ecaa7 Lua: Fix console pretty-print output not showing zero or negative keys in tables 2021-09-04 22:20:28 -04:00
Celtic Minstrel
9ad9833789 AI: Support [unit][ai][candidate_action]
This is essentially a syntax sugar for adding a candidate action filtered to only run for that single unit.
2021-09-04 22:20:28 -04:00
Celtic Minstrel
880ef29075 AI: Support [unit][ai][micro_ai] 2021-09-04 22:20:28 -04:00
Celtic Minstrel
a205e80845 AI: Fix missing serialization code for sticky candidate actions 2021-09-04 22:20:28 -04:00
Celtic Minstrel
6bfe2647f5 AI: Support [modify_side][ai][modify_ai]/[micro_ai]
Although there is little reason to do this in practice, there is merit in supporting all the same syntax in both places.

For example, if AI setup is defined as a macro, it could contain [modify_ai] tags.
This change means that placing that macro in [modify_side][ai] has the same effect as placing it in [side][ai].
2021-09-04 22:20:28 -04:00
Celtic Minstrel
477a871c21 AI: Support [side][ai][micro_ai]
Closes #5910
2021-09-04 22:20:28 -04:00
Celtic Minstrel
9fdaea5893 AI: Fix error in stationed_guardian 2021-09-04 22:20:28 -04:00
Celtic Minstrel
59c9be1238 Schema: Add [candidate_action][filter_own] 2021-09-04 22:20:28 -04:00
Nils Kneuper
fc36971d6c updated Portuguese (Brazil) translation 2021-09-04 13:18:41 +02:00
Pentarctagon
5431810b62
Also re-enable WC on the master branch. 2021-09-02 14:52:56 -05:00
nemaara
ef0da66ec9
SotBE S13: rebalance scenario 2021-09-02 02:52:10 -04:00
Pentarctagon
545e5ffa29
Fixup WC schema validation failures. 2021-09-01 19:41:53 -05:00
mattsc
b73078884c Messenger MAI: fix bug of own units blocking waypoint
ignore_own_units=true was accidentally dropped when adding [avoid] tag functionality to the Micro AI in a60736b6c7
2021-09-01 08:49:54 -07:00
Steve Cotton
551357f48b Fix an off-by-one in mapgen's x and y filters, and add unit tests
Fixes the currently suspected root cause of #5108, but requires further testing
to confirm that it fixes that issue.

Closes #6501 (the question of how to test the mapgen filter).

(cherry picked from commit 30f50bac681fda1566f5cee5aad7be6b65cb0fdb)
2021-09-01 15:48:32 +02:00
Tahsin Jahin Khalid
19b38fe249
[world conquest] [master] [lua] Check for wc2_scenario value before executing wc2_start_units function (#6052)
What this does is just checks the value of wc2_scenario before executing the function, and executes it for the first scenario only as intended.
2021-08-31 10:36:19 -05:00
Celtic Minstrel
47bff304fc Revert "When writing WML, output preprocessor-safe strings"
This reverts commit 20551f4dfc3c4a8687cb32e793426d84d46f145b.

It turns out that this breaks simple_wml, so even though it's an improvement for
offline serialization, it can't be done at this time.
2021-08-29 19:15:35 -04:00
Nils Kneuper
fe2fba1e2f updated Polish translation 2021-08-28 14:44:21 +02:00
Steve Cotton
6ad33af556 UtBS S02: Don't move Nym if she's already adjacent to the bottle
(cherry picked from commit 8919c2e9482b6068db3f16b708628d7c5ba89ecd)
2021-08-26 14:21:13 +02:00
Steve Cotton
6b6eb8a35b WC: End the campaign at the end of the final scenario
Fixes the campaign part of #5891.

(cherry picked from commit 9d32c7703577e9afa86e75e4e1f3b4646a3ec17a)
2021-08-24 10:43:19 +02:00
Celtic Minstrel
9daa10a9f2
Lua: Fix deprecated end_text references in core 2021-08-23 09:22:08 -04:00
kabachuha
536d6a226c HttT: add gendered variants to item pickup prompts
Should help to address the issue with gendered verb forms or noun cases in some languages as described in #4436 . This reuses the same preexisting mechanism as in the latter part of httt_utils.cfg.
2021-08-21 13:11:47 +03:00
Nils Kneuper
2b5d36e832 updated Turkish translation 2021-08-21 10:55:06 +02:00
Nils Kneuper
3116ee4314 updated Russian translation 2021-08-21 10:54:13 +02:00
Nils Kneuper
056fa5eddc updated Indonesian translation 2021-08-21 10:53:14 +02:00
Nils Kneuper
1d80a3e8b8 updated Finnish translation 2021-08-21 10:51:59 +02:00
Tahsin Jahin Khalid
1dd447ce5d [world conquest] replaced khalifate unit types with dunefolk unit types
I have also removed one mention of "Dune Piercer", which is non-existent unit, and substituted it with "Dune Rider".
2021-08-17 17:19:39 -05:00
kabachuha
959f534d19 Update Russian translation credits 2021-08-17 22:41:32 +03:00
kabachuha
e7f3899541 Updated my (kabachuha's) entry in the credits 2021-08-17 22:38:22 +03:00
Hejnewar
5a316bc5ca
Update Polish translation credits 2021-08-17 16:03:56 +02:00
Steve Cotton
1d8225d6b6 UtBS S09: Reveal the boss of the scenario at the end of part 1
This foreshadows that the player will need to attack the north-west after
defeating the north-east enemy, which is a bit fairer to anyone playing this
scenario for the first time.

Removes a now-unused string (Darius' pre-sacrifice speech). There are no new
strings here, the others are just being moved around.

For clearing shroud, change to using radius= because clearing a circle looks
better than clearing a square.

There's no significance to whether the new plan is "Plan B" or "Plan C" - back
in Wesnoth 1.10 it seems to have been dependent on whether all the merfolk had
been rescued.

Fixes issue #5540 about Hekuba spawning on a water hex.

(cherry picked from commit 25163c06a258b2a9f4627a1345a83f52447165dd)
2021-08-17 15:32:27 +02:00
Tahsin Jahin Khalid
d19c137d65
[world conquest] World Conquest Era is only available for the WC campaign
Until a proper solution is found for #5228 , this will have to do. It suppresses the appearance of the era in the era selection list for other scenarios.
Hmm, I guess the [campaign] tag should support the allow_era= key in future but for the moment, this will do.
2021-08-16 23:05:18 -05:00
Charles Dang
6ca865c8c2 Addon Manager: refined details section design 2021-08-16 17:16:01 -04:00
Charles Dang
95893489f2 GUI2: added default_italic label and scroll_label definitions
This is not optimal, but I'll implement a better way of handling formatting later.
2021-08-16 17:15:31 -04:00
Charles Dang
743323414f Addon Manager: fixed erroneous 2px horizontal offset in Update button images 2021-08-16 17:14:24 -04:00
Wedge009
89a5319006 Resolve #6019 - allied side not triggering failure condition when sighted 2021-08-16 20:00:24 +10:00
Steve Cotton
18a234594a Remove a leading space from the Silver Mage's [special_note]
The strings in special-notes.cfg don't have a leading space,
and this one causes a warning in poedit.
2021-08-16 11:02:24 +02:00
Celtic Minstrel
64d3392b36 fix whitespace 2021-08-15 23:48:18 -04:00