menu_button doesn't even actually inherit from clickable_item. The only reason
[dis]connect_click_handler was declared in this class is the original implementation
was copied extensively from the Button widget.
Using NOTIFY_MODIFIED also means callbacks can fire if set_value/set_selected is used
on a menu_button.
The [dis]connect_click_handler functions were also removed from multimenu_button. All
callbacks for this widget type already used NOTIFY_MODIFIED signals.
Retvals are only relevant for widgets that are supposed to trigger something
like a window closure, and that makes sense for neither of these widgets. The
only reason the Menu Button widget has it is its original implementation was
largely copied from the Button widget, and the Multimenu Button widget copied
from the Menu Button widget.
This commit excludes changes to S05 Tirigaz, I think changing the dialogue
there is going to be more complicated, and it's better for that to have a
separate PR.
The problem was introduced by commit 1e7c25a139 due to the [modify_unit] tag apparently causing prisoners to disappear because technically they were duplicates as they had merely been unstored and still existed on the recall list as well.
Fixes#3092 - Updates objectives if orc leader is killed first, and gives additional dialogue
Fixes#3903 - Gold event doesn't fire if ghosts kill the orc leader
[ci skip]
This was due to the change in the MP initialization process wherein the lobby wouldn't
show up until the initial gamelist was received. Since the admin auth message is sent
after [join_game] and before the initial gamelist, and the chatbox widget handled parsing
the auth message, the client was never marked as authenticated and therefor couldn't
observe private games. This fixes that by adding auth parsing to the MP initialization
process.
Note this doesn't fix the issue of the auth confirmation not showing up in the lobby chat
(issue #2920). I'll have to think of a way to fix that separately.
This is a script to take a changelog section (provided in the command
line as such: `steam-changelog changelog.md X.Y.Z`) and convert it to
BBCode for posting on Steam.
[ci skip]
Makes it easier for translators to do something specific with this label if needs
be. I remember the reason the count (NUMx) label was moved prior to the name had
to do with language conventions too, so this should alleviate any other such issues.
Also made the name label default size instead of small.
Automatically checking the path relative to a maps/ directory without binary
path support results in an invalid path almost every single time. If I remember
correctly from my testing, the only time that worked was if I added a data/maps
folder.
ee50171d13 broke some codes that relied on
unique save ids, that is in particular the statistic code and
scoped_recall_unit, so now these codes fallback to the side number if
the save id is empty.
The variable **always** changed when event handlers were run, and thus the
optimizations to avoid updating some status after WML/Lua has run weren't
doing anything. In addition, commit 62ec3b3951 removed the most
important optimization that relied on wml_tracking().
Resolves#2578.
Since there were weapons included that weren't shown, it was possible for the best
weapon selection to be a hidden one (in which case, the initial selection would be
wrong, and it was possible for the returned index to point to a hidden, disabled
weapon.
This resolves both issues by excluding these disabled attacks from the weapon choices
list altogether. They aren't considered when calculating the best attack either.
mouse_handler::fill_weapon_choices is also used in mouse_handler::attack_enemy_, but
I don't foresee this change should cause any issues there, since you aren't supposed
to be able to actually attack with disabled weapons anyway.
* UtBS 5: changes to scenario locations
From #3077:
* Moved AI leader spawns to keeps
* Changed spawn of trolls that were spawning in walls
* Sanity-checked village ownership in cavern
From #3078:
* Changed spawn of Eastern Troll Flamecaster
* Fixed entry routes of Troll Flamecasters
From author notes:
* Made 'Wounded Dwarf' a wounded unit
There were two overlapping problems: 1) the branching was written incorrectly (due to combining top-level and [if] filters) and 2) the first [defend] tag getting merged with the base WC/Soulless defense animation.
Another efficiency improvement. This ensures that the side of the unit
is checked first before the potentially complex rest of the filter is
evaluated.
The old method is very slightly faster in some circumstances (e.g. for
simple filters and when all units have moves/attacks/etc. left), but we
are talking fractions of micro seconds. By contrast, depending on the
filter used, the new method can save large amounts of evaluation time
once some units have move or attacked.
If dc happens during asio read that would call server::add_player
then a "ghost" player will appear in games_and_users_list_. Fix works by
moving the list update into the handler, it will be called only if read is
successful.
This is a debug mode-only dialog. If I want to spawn a unit, the game
had better allow me to spawn any unit I want. do_not_list was created
for use by wmlunits anyway.
This time I added an option to disable the feature to allow the currently
playing track to finish when changing the playlist. This allows more
fine-grained control of distinct use cases.
In wesnoth.cpp:do_gameloop(), I reversed the order of the title screen
music and default music because otherwise adding the default music would
enable play_once for the title screen music and prevent instant music
change when the player loads a save. I play title screen music with
immediate=yes, so it's still played first.
This reverts commit 1fb9378df1.
The commit caused the music to change even when the player loaded a save
from the same scenario. A different fix is needed.
* now the situation can appear that spiders can attack Malifor,
this handles it.
* add *^Xo Terrain to the filter. While there is no bug to fix,
it looks like it belongs there too.
* work around a tile glitching with an [item] at 22,4
* remove code referring to removed variables
[ci skip]
* Fixes#3117 - Malifor damage event now occurs on defence as well as on attack
* Fixes#3116 - Doors to the study can now be opened from inside
[ci skip]
* new TSG translation
* dropped German campaign abbreviations - stick with English ones
As of 1.14 the English campaign names are as well shown in brackets
in the load game dialogue
* removed cases of double whitespaces
* replaced — by – (If you read this commit message with a monospace
font you won't see the difference)
[ci skip]
This reverts commit 0eb27e246b. Turns out there's
a better way to fix this problem without using mutexes, which have a noticeable
performance hit (5.2% of the execution time of game_display::draw_invalidated()
according to @jyrkive).
This is workaround for windows style path confusing scons if they appear
in CPPATH etc. Paths without prefix still happen to be valid and they
start with "/", not "c:".
One_strike_fight() assumed that if HP distribution hadn't been calculated,
the unit is alive. It would normally be a valid assumption, but the Wesnoth
engine allows units with negative HP (although things aren't guaranteed to
work correctly in the presence of such units).
The assumption, together with a completely wrong calculation for the
probability that the opponent will counterattack, resulted in badly
incorrect results. That, in turn, caused the calculated probability that
the opponent to kill us to become negative (I observed -75 % when
debugging), making the calculated probability to be poisoned/slowed to
exceed 100 %, and that finally caused an assert if the AI simulated another
fight for the same unit.
I have now fixed those issues. I also noticed that rounding error allowed
the probability to be killed to still become slightly negative, and thus
changed std::min() to utils::clamp() to limit the value to the allowed
range.
This reverts commit 3c344e8da5.
@ln-zookeeper pointed out that units with negative HP are documented in the wiki, and thus disallowing them is an API
change.
This list in the connect engine was passed to each of its side engine's flg managers,
where it was then sorted by update_choosable_factions(). Basically, a whole bunch of
unnecessary sorting. This makes it so the list is already sorted when it's passed to
each side engine.
None of the post-processing of the faction list (in populating available_leaders_)
should mess with the order, as far as I can tell.
the line above does exactly the same as the line inside that if(){..} so it has no effect.
Also, what the comment says is wrong. We do not want to keep the old recall cost if it is different from the original recall cost because doing that would break removing objects that change recall cost.
* to enable playing the path in debug mode
* set the betrayed friend variable in S5
* overwrite redruits and gold
* use lua for unit transformations
* clean up code in S5
* fix ellipse change having no effect (probably since 1.12)
* work around bug #3172
[ci skip]
It didn't make much sense to have these since there's really no situation you'd want
the "default" sorting order, which is however the server decided to send the list.
This has the advantage that they use the same help page as newwly
recruited ons, and their advancement options are correctly shown there.
The transformation code is taken from SotA S18
[ci_skip]
this removes a hack in connect_engine.cpp that set save_id to a value to make sure that other connect_engine.cpp code does not chnge it later to the plyers id, (it did so at some point iirc).
Instead we update carryover.cpp to make sure that a side with no save_id (or id since save_id defaults to id) is not carried over to the next scenario,
fixes#3152
This will make enemies recruit equally many lvl1 and lvl2 units, thus decreasing the amount of units overall and making it less feasible to last indefinitely due to hordes of lvl1 units blocking better damage-dealers from reaching player units.
This merely patches the worst problems (multiple successive [endlevel] calls, inconsistent [endlevel] contents, recursive elf die event, lava fills visually broken); ideally the whole scenario should be rewritten and redesigned.
The mask changes only consist of re-sizing them to match the map size.
This reverts commit a3ef80853c.
Vector reallocation cost is logarithmic. Assuming that a vector
starts at a size of one and doubles its size in each allocation, the
result is 11 allocations - completely negligible compared with, you
know, loading 20 000 images from disk.
without this a line break occurs in the middle of the string for
neutral units who have a portrait (alignment matters because all
other strings in that line don't change in length)
[ci skip]
[color_adjust] needs to be able to use absolute values as large as
2*255 in certain edge cases to set the screen a single solid colour when
interacting with time of day colour shifts.
Fixes#3144.
Leaving theme= unspecified ought to have the same effect as providing it
and setting it to an empty string. Without the check for a nil value,
however, it would result in a crash like this:
20180519 22:31:54 error scripting/lua: lua/wml-tags.lua:922: bad argument #3 to '__newindex' (string expected, got nil)
stack traceback:
[C]: in metamethod '__newindex'
lua/wml-tags.lua:922: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
With this, EI is as clean of schema errors as it's going to get.
There yet remain a number of unsolvable schema errors (due to multi-use macros).
Regarding {LOYAL_UNIT}, specifying the side here is redundant;
however, an empty side key raises an error, and it doesn't hurt
to specify the redundant information.
- Passing () as the side to the unit util macros results in an empty side key
There's no reason not to just pass 1 instead though.
- [modify_side] does not support [filter]; instead it uses [filter_side]
However, it also supports inline side which is sufficient here,
so just use that instead.
This covers both difficulty levels; TB is now clean of schema issues.
The playlist macros set the music list twice, once before the
story screen and again in prestart, but the order of tracks is different.
This means that the track order at the titlescreen and in the lobby is now the same
as the track order in a scenario using the default playlist, which previously was not the case.
Similarly, the track order in the editor is now the same as the track order
in a scenario using the full playlist.
Whether that actually matters? I have no idea. I doubt it.
In any case, as of this commit, there are no schema validation errors
at the title screen, when entering the MP Create screen, or in the map editor.
this fixes require_scenario=yes for scenarios that use map_generation or
scenario_generation, the problem was that create_engine does not call
saved_game::expand_scenario for random maps, (which is the function that
checks require_scenario=yes)
fixes#3105
Instead of throwing a WML error. This allows the UMC author to get a stack
trace if the unit creation was triggered from Lua.
Requested by @gfgtdf in a comment of #3042.
* castle of the southwestern leader has been moved down a bit
* fixup for gate event and troll die event not properly working
* give dwarves more gold if they are in trouble, increased income of trolls
* added micro AIs, currently not working as expected
* other minor map edits
* removed patch 9b9aa13 for #3073, the village had been moved down one hex
for visual reasons
[ci skip]
This allows player 3 to send more enemies against the human player sooner.
If this is an issue, may be necessary to consider changing the scenario wml
to delay this player spawning by a turn.
* removing horses from text strings - replaced with dustboks
* adding a riderless dustbok to monsters race, needs description and probably other adjustments
* removing disengage ability and translation mark from dustbok unit file
* adding #po translation hint for name
* make north gate obvious to players
* mitigate bridges transition
* use less human castles
* don't break northern train line
* move the bridges in the Trolls keep farther behind, to be less
vulnerabe to the northern leader
[ci skip]
The specific case that brought this to our attention was color=100. In case such values
are used, the color reverts back to the default color for that side, as before.
The new codepath (team::get_side_color_id_from_config) is essentially the same as the old
one but more robust (range checking, for example, the lack of which was causing the crash
before).
This reverts commit 5fd833a91a. It was causing the lobby to
lag up to *three minutes* behind current activity due to multiple data packets being queued
(see #3046). It seems 100 ms was enough to mask this issue.
We don't want to risk translations falling below the minimum string
count because of the additions in 1.14.1, since it's supposed to be an
emergency release.
There's extra formatting in the string that isn't there in the English
original, and there's no mention of the 'deprecation' log domain.
Furthermore, broken formatting around the 'none' log level was rendering
the manpage unbuildable.
[ci skip]
for the 1.14.1 release, intended to be included after tagging
again.
This reverts commit 00cccd19f5.
(a.k.a. Update text to match game-play changes, fixing #2950)
[ci skip]
If a unit had for example 3 other formation units adjacent but only needed 1 to reach 70% defense, it didn't receive any benefit at all (as the corresponding [chance_to_hit] tag remained inactive).
Spotted and fix provided by beetlenaut.
Several reports on Steam and our forums point at std::bad_cast being
thrown when accessing Preferences and the Multiplayer menu amongst
others. It's possible that the locale configuration on those systems is
not quite right, and compare() and icompare() are able to throw
std::bad_cast when this happens as they both use std::use_facet().
Note that much like the macOS/iOS version of icompare(), this stopgap
patch doesn't attempt to provide any form of case-insensitive fallback
and just uses a case-sensitive comparison instead.
We don't want to risk translations falling below the minimum string
count because of the additions in 1.14.1, since it's supposed to be an
emergency release.
There isn't much point in doing more expensive ban look ups first.
(Also, yes, I am aware that as it is there's still two SELECT queries
that could be coalesced into a single one -- namely, the ones for the
user_email and user_id columns.)
This enables reporting back to the client the specific type of ban that
affects the account. This information is already normally provided by
phpBB when trying to view a page while banned, so we are not leaking any
new information here.
There isn't an API to retrieve the (user-visible) ban reason from the
ban list yet. It's probably not worth worrying about it since affected
users can see it when navigating to forums.wesnoth.org anyway.
This adds a user_is_banned() method to the user_handler classes that
returns whether a given username (and optionally IP address) is banned
by the user_handler platform. Obviously right now this is only intended
to work with forum_user_handler and phpBB.
Forum bans are checked against entries in the banlist table using
username (actually user id), IP address, and email address where
applicable. A user matching a ban on any of those three items will not
be permitted into the server *unless* they have the moderator flag set.
It might be worth making an exception for board founders as well,
although that is probably orthogonal to this patchset.
Right now there are a few missing items:
* The server sends clients an error that allows them to try again with
a different username/password combination immediately. Nothing stops
them from causing noise in the server logs this way, so we probably
need to ensure this counts as an authentication failure for the
purpose of temporarily and automatically banning the IP address.
* The user handler doesn't allow retrieving details about the ban, so
all that the main server code can do is report back to the client as
their nickname being banned, when this is not necessarily the case
(email or IP address bans). I need to figure out a better API for
retrieving this info.
* Likewise, the server does not log the specifics about the matched ban
yet unless the mp_user_handler log domain is set to the info log
level.
* There's no i18n support on the client side for the error message sent
by the server -- which is going to change anyway.
* Testing this patch uncovered an issue with the MP client not
displaying messages sent during the login sequence, including the mod
authentication notice.
This fixes issues reported on the forums where the weapons list now
includes weapon specials even when they aren't active, a regression from
1.12.x.
Closes#3033.
the wb recruit actions store temp units with fake ids and live longer
than a turn, so resetting the underlying id counter between turns might
result in dublicate id errors in wb recruit actions ( #1517 ), which
might lead to errors later.
With this it is of course possible to get erros when more than 2^31 (or
2^63 on a 64 bit wesnoth version.) fake units are generated during a
game, but that is less likely.
previously having a planned recall action could change the order of
units in the recall list, which might for example change which unit is
recalled by a [recall].
The firstproblem was that:
apply_temp_modifier adds the temp_unit_ to the map, then
remove_temp_modifier adds the temp_unit_ from the map to the recall
list, which resulted in the original recall unit beeing replaced by the
temp_unit_ of the recall_action We fix that by making sure that
temp_unit_ is always the same as athe recall unti not just a copy.
The second problem was that remove_temp_modifier reset the unit mp/ap to
a value differnt form the original mp/ap which could casue OOS later
since the ap/mp might be changed form that unsynced context, we fix that
by resetting the mp/ap in remove_temp_modifier
turned out 8bdccca7 was not enough because the mapbuilder erroneously
reset the units movement to full directly before it was applied. Since
the `resetters_` code in mapbuilder.cpp does not apply to
recruited/recalled units, we also have to reset the units mp in
remove_temp_modifier.
[ci skip]
Height isn't the problem. The default lobby can display fine even at 600 px h. Width is
the problem the default layout faces at low resolutions, and it was quite odd to have a
really wide window use the low resolution layout, despite there obviously being enough
horizontal space to fit the sidebar.
This is similar to the change made for spacers in da5f00c2b6.
It also fixes an issue with the MP Lobby chat box (and other such widgets that use formulas
for their fixed dimensions) where it would stay too small after a window resize (the chat
box formulas in all three dialogs it appears in are a percentage of window height).
as is done in rest of wesnothd. This also fixes crash from self-kick
due to it trying to continue processing looking for further tags
after /query kick kicked the user in quesion.
Besides replacing the "End of file" error when getting disconnected from
the server under unexpected circumstances (e.g. because the server died)
with a translatable and more intuitive message, this also makes it so
other network error messages ("Connection refused", "Host not found",
etcetera) are displayed in the UI in a slightly clearer fashion, and in
an error dialog that must be dismissed with a click on a button, instead
of a transient message that can be easily missed due to an accidental
misclick.
Closes#3005.
the for those moves get_unit() might return nullptr when it is
when the future map is not applied and some codes deduced from
that that the action is invalid. So we make sure that code does
not rely on get_unit().
These are only the ones were it's sufficiently unambiguous that the
description is referring to the merfolk race at whole. There are a few
instances I didn't touch were it's possible that the text refers
exclusively to mermen fighters (e.g. "the mermen armies").
See issue #2940.
[ci skip]
This restores the changes from the following commits:
* "SotA S2: fixed inconsistency between unit name and dialog (fixes#2844)" - commit ab9f29a7a4
* "SotA S8: fixed inconsistent Ghost name (fixes#2846)" - commit fc6c3ac04b
This commit does a few things:
First, it moves the hotkey category names out of the preferences dialog and into
the more appropriate hotkey file. Each name is now properly mapped to its corresponding
category enum, so we don't have to worry about that anymore.
Second, it adds a new mapping of hotkey categories to commands so one can easily fetch
a list of hotkeys in a given category.
Third, it excludes categories with no hotkeys from the filter dropdown in the Prefs
dialog (this is the part that actually fixes the bug above).
This also includes a slight behavior change to hotkey type filtering. Previously, if a
hotkey's category didn't match any of the ones listed in the dropdown, that hotkey's
row visibility would be set to the toggle state of the first row in the filter dropdown.
Now it gets set to false.
since he can't move onto deep water.
There is no deep water in the relevant scenario either.
Aim of this change is to improve the help entry.
[ci skip]
[ci skip]
This is currently only the case on the 1.14 server, but it's easiest just to
remove the line completely rather than constantly adding or re-adding it based
on whether you're using a or dev series.
i don't really know why the old code had a special case for
`get_turn(next) != turn_of_position`, from what i see `turn_end(0)`
would basicially return the same value as `next`. The new code removes
that special case which resulted in assertion failures before (#1841)
and also consiers the case where `position` appears multiple times in
`turn_beginnings_`
the assumption
(turn_beginnings_[num] == it) => (get_turn(it) == num)
might be wrong in case that we have a turn with no actions, in which
case turn_beginnings_ contains duplicates and we actually want the upper
bound of (x <= it) in turn_beginnings_
previously, if people wanted to make use of mp leader selection in mp
campaign they had to sxplicitly set no_leader=no and faction_lock=no,
with the new code its clear that no_leader= is just an alias for
faction_lock with type
Because updating and sending messages to lobby in staging screen hasn't
been implemented, showing lobby history there would be confusing
(it would look as if everyone had stopped talking).
Reported in https://forums.wesnoth.org/viewtopic.php?p=626344#p626344
Regression from commit a3d5b9d603.
The crash occurred when
* the attacker had only one weapon
* the said weapon was disabled, and
- the defender had no weapons
- the defender had only one weapon, or
- all defender's weapons were disabled
The comment at the start of 01_Tutorial_part_1.cfg wasn't immediately
before a string, so the hint for translators wasn't in the file that
goes to the translators. Fix it so that the tutorial shows working
usage of "# po:" style comments; this is probably more help to people
using the tutorial as a reference for WML, rather than the translators
themselves.
Closes#2914.
This doesn't break the string freeze since it reuses a format string
from the same textdomain required by gui2/game_version for the exact
same purpose.
These are used to hide an add-on from listings and deny the author the
ability to upload or delete it or change its passphrase. This is
meant to be used when enforcing add-ons server rules that do not justify
deleting all of the add-on's metadata (for example, issues with icons or
descriptions).
This changes the order in which the hook_post_erase hook (currently
unused in production and fully untested) is fired so it will be run
*before* displaying the confirmation message to clients. This might need
to be changed at a later point if the hook functionality ever gets used
again, but for now it'll do.
Turns out that commit broke TC on unit images in messages since it broke the equality
check in lua_unit.cpp. Added the XBRZ IPF as part of the Lua unit portrait attribute
instead.
I *think* this is the proper place to do it.
This reverts the following commits:
* "SotA S2: fixed inconsistency between unit name and dialog (fixes#2844)" - commit ab9f29a7a4
* "SotA S8: fixed inconsistent Ghost name (fixes#2846)" - commit fc6c3ac04b
It was broken by b95c9996bf because
ignoring SIGCHLD makes it impossible to query exit status of wesnothd
subprocess. Fix this by spawning a thread to wait for the browser
instead of ignoring SIGCHLD.
Units on the recall list are treated as recruits by the AI. The code
previously did not check whether a unit it worth being recalled until
after it makes the decision which unit type to recruit/recall. If it
then can only recall, but not recruit units of that type and all of
them are deemed not worth it, the entire recruitment CA is disabled
(via black listing), meaning recruiting is abandoned also.
This commit fixes this by checking the unit value vs. the recall cost
before putting recalls on the recruitment list.
With this, the WML unit tests are as clean of schema errors as they can get
The two remaining errors are unit tests for dealing with invalid input,
so they are intentionally violating the schema.
We should really use a custom unit type to get the desired effect;
however, that could cause out-of-sync errors, so for the 1.14 branch
we instead replace the image via an [object]
It does support id though, which is used as a sort of caching mechanism
in case the same effect is applied many times, so use that instead of name.
For good measure, also use an id on the sceptre of fire animation
[modify_side] does not support [filter]; instead it uses [filter_side]
However, it also supports inline side which is sufficient here,
so just use that instead.
This doesn't quite produce what is presumed to be the intended result.
It does at least preserve the differing recruitment patterns though.
Includes the following recommendations from mattsc:
- Drop {AI_NO_SCOUTS} since the recruitment pattern contradicts it
- Drop attack_depth and grouping
- Keep the night-only aggression and caution change, even for the nagas
We use both SDL_KEYDOWN and SDL_TEXTINPUT events for hotkeys. It's possible
for both events (caused by the same keypress) to trigger the hotkey command
and we don't want that. Hence, let's drop duplicate commands.
Fixes#1736.
In scenarios 06 and 14 I turned the opening narrator message into story text instead. The image for 03 isn't used yet as there's no text to accompany it.
This reverts commit f80bc42621.
As @CelticMinstrel pointed out, that commit made it impossible to input characters which require
AltGr to type (e.g. @, € and $ in Finnish keyboard).
Reopens#1736.
This reverts afaa75842c and replaces it with a more general
no-assert-during-events check. This is because there are other instances besides [inspect]
where this function can be called mid-event, and it wouldn't be convenient to add nested
'strict' parameters to multiple functions just to handle them.
Fixes#2750.
I also updated the filenames for the images, changed the recommended
format for screenshots other than "fullscreen" screenshots to PNG,
and removed the (no longer true) claim that the example places to create
the screenshots match where the English screenshots were taken.
Resolves#2856.
[ci skip]
Two of these strings were not a fix, just a removed string, so no need for pofix.
The other was not specific enough for pofix to match unambiguously.
Also, someone forgot a comma somewhere, causing a syntax error.
I had been unconditionally selecting the first entry after setting the active
sorting option. This overrode the previous unit selection.
Regression from 6b52d16fae.
See https://forums.wesnoth.org/viewtopic.php?p=625159#p625159
Since this problem can also be solved with make_neutral_surface, and is_neutral already
check a surface's alpha mask, I moved the is-not-indexed check to is_neutral and made use
of it for the on-load standardization check.
The problem was that the specials_context was not set during those
two get_special_bool calls
This removes what seems to be a rather useless optimisation in
battle_context::battle_context since choose_attacker_weapon would
just return 0 in that case.
fixes#2801
The problm was that the old code tried to use `undo_stack().can_undo()`
to check whether the current action can be undone. But
`undo_stack().can_undo()` uses the undo stack which is only updated at
the end of each action, so it cannot be used to check whether the action
that is currently executed can be undone.
This code removes some assertion that were wrong due to the
justmentioned.
The change itself should cherry-pick without conflicts to the master
branch, but as this starts the 1.13.13+dev changelog, the changelog
update will need a manual merge.
Taking the chest south of the start hid the door and chest that are
north of the start.
The sneak-door opened much earlier in the level, allowing the undead
from the south-east lich to go north to the spider room. The ghosts
and nightstalkers that are supposed to ambush the player's forces in
the south (after opening the 3-hex door) instead go north and end up
joining the spider fight. The slower-moving undead also go north,
and are easily fought one-by-one in the sneak passage instead of the
south-east.
[ci skip]
At no point is "generated" checked for as value of that key (the only valid value is "yes").
"generated" is a valid value for sort_topics, however. As for whether we want sorting or not
for Eras, I don't think so. The era order as displayed seems logical enough since it groups
each era and Age of Heroes variant together.
This matches with the "Another old caved-in passageway..." event
around line 835, the trigger is on 55,33 and the walls that open are
[terrain]
x=55,55
y=34,35
terrain=Uu
[/terrain]
Debian bug #483893, for which the original fix in
4c473187e6 changed the wrong digit.
we now only call redraw_everything() when the gui actually needs
updating. In particular this fixes an annoing flickering in some cases
where a gui2 dialog is shown while a [change_controller] is received.
Again, someone forgot to make this translatable. Fortunately, for 1.14
we can rely on a very simple hack to borrow the same string from the
wesnoth-help textdomain, which is actually supposed to be used for the
same purpose as it is the top-level section's title there, which is also
supposed to be the heading for the section's index.
This kind of thing just goes to show how badly organized the whole help
system is code-wise.
this mainly effects wesnoth.synchronize_choices:
previously the client would not process incoming choices from other
players while it was exeucting its own local choice (usually a dialog).
The problem this commit fixes is that with the old behaviour any choice
from another player would block the incoming queue, in particular
chatmessages after that command would be delayed until the
wesnoth.synchronize_choices is finished.
* sun-shyde standing animations, draft
* additions to sun-shyde floating animation
* singer defense animation
* defense animations for sun-singer and sun-shyde
* try to make scout less leaning backwards
* champion defense animation
* fixing and rounding out basic animations (esp. wrt to floating/standing) for sun_shyde
This makes it simpler in the future to have branches that have dependencies that are different from master, rather than having a single image with all necessary dependencies installed, which may at some point end up not being possible to do.
Commit dfc42e8a8d removed said code since
Wesnoth can use IMG_SavePNG() from SDL_image 2.0 instead. However, the
author left the build-time configuration options intact, and also part
of the necessary code for CMake to link Wesnoth against libpng.
Note that this change also eliminates an unnecessary direct link-time
dependency on libpng when using both CMake and SCons.
Since the entry was entirely missing in master, I just added it to 1.14
without reading the Miscellaneous section. Probably best to keep it
hidden there anyway.
[ci skip]
We just found out that it is possible for the player name to not be set
when loading a singleplayer start-of-scenario save for the first time
right after launching Wesnoth. It's best to have an actual $player value
for that case instead of spurting 100% syntactically invalid statements
like "The :lua command was used during 's turn" because of the empty
variable.
Otherwise there are too many repetitive strings for translators to work
with, which is rather unfair for an exception like this during the 1.14
RC phase. It also makes for better code.
Also added an article "The" at the start of the strings for :command
notifications.
Storing it in a regular string results in issues with the game getting
stuck with the translation for the locale that was set during GUI2
initialization and not reflecting changes when switching languages later
on.
There's a gettext call but there was nothing to mark the strings as
translatable in xgettext's view. Additionally, fixed a minor case of
missing the colon before the command name, replaced ASCII apostrophes,
and rewrote a notification with awkward wording.
Previously, I had implemented the hint text ("Search)" and image (the magnifying glass)
as a custom text box definition. This caused some problems, though. Since the string was
hard-coded as part of a WFL formula, it couldn't be translated (see #2709 and #2732). It
also wasn't expandable to any other usecase.
Instead, I've added two new hint_text= and hint_image= keys to [text_box], wrapped the
"Search" text and magnifying image path in a helper macro, and refactored the default
definition to display the hint text and image when appropriate.
This also fixes a minor issue where selected text wouldn't remain highlighted when the
box wasn't focused when using the filter definition (it did with the default one).
This should fix the untranslatable "Search" text issue mentioned in both issues above.
The new string is in the wesnoth-lib textdomain.
Resolves#2748.
Essentially, all this did was tell users to go use the forum, so it wasn't worth
it to keep it and solve the infinite loading screen issues it was causing.
The server backend still needs to be cleaned up.
Also removed a dead reference to some "Change Username" button in the Login dialog's
code.
in linger mode.
playmp_controller::play_linger_turn calls play_slice after processing
end_linger/[notify_next_scenario] which would (after 'fix chat in
[delay]' commit) then read more data from the network in particular data
for the next scenario which will then be lost.
with the 'fix chat not working during delay/animation' it could happen
that play_slice_catch would process a incoming controller change in
which case that while loop would end without the code inside that 'if
(player_type_changed_)' being executed, which woudl lead to oos errors
since that client woudl have made moves that other players don't have.
[ci skip]
Source: https://dejavu-fonts.github.io/Download.html
I haven't done any codepoint list updates in data/hardwired/fonts.cfg. Unlikely
to cause issues, though, I think. The legacy TTF rendering system that uses it
is mostly just used for the Help browser here on the 1.14 branch (on master it's
completely unused and will be removed).
[ci skip]
Source: http://arkandis.tuxfamily.org/adffonts.html. Previous version was 1.006 (FFEdit).
Also includes the italic and bold variants we didn't have before.
Thanks to @sevu for finding this updated version. :)
This is caused by a broken assumption on wmlxgettext's part. Because the
files did not have a textdomain directive anywhere, the translatable
strings in them were assigned to the wesnoth textdomain. The game engine
seems to have a different idea though, and includes them in an
unidentified textdomain that may or may not be wesnoth-lib, as per the
last #textdomain directive seen in the combined WML for the
data/gui/macros directory substitution.
This merits further examination of the preprocessor's code (and
wmlxgettext's logic), but for now this is a simple patch that fixes the
issue without breaking the string freeze or introducing any potential
regressions.
This fixes two particular strings mentioned in issue #2709:
* "There are no custom options available for the selected era, game, or modification."
* "Connected Players"
Vultraz made a similar fix in commit
8d1ec6216b in master, but it breaks the
string freeze by virtue of moving the strings across textdomains.
[ci skip]
This drops a preprocessor conditional branch that is dead code now that
the file pulls gettext.hpp and the GETTEXT_DOMAIN defaults with it.
See also PR #2711.
There are cases (deprecation.cpp for one) where string_utils.hpp is
included first, which causes the VGETTEXT/VNGETTEXT definition to use
the textdomain-less (a.k.a. forced wesnoth-lib textdomain) overloads of
vgettext() and vngettext(), because GETTEXT_DOMAIN has not yet been
defined by anything. This again results in strings being looked up in
catalogues where xgettext is not adding them.
This is a companion for PR #2711 I should've noticed sooner. Without it,
there were still cases where interpolated strings would not be
translated due to vgettext() using the wrong textdomain for them.
I ran a quick scan on the codebase to make sure there aren't any files
including formula/string_utils.hpp before defining their own
GETTEXT_DOMAIN instead of the gettext.hpp default.
The vgettext() function, while declared in src/formula/string_utils.hpp,
actually has its implementation out-of-line in
src/formula/string_utils.cpp where GETTEXT_TEXTDOMAIN is defined to
"wesnoth-lib". Because vgettext() is implemented in terms of the _()
function (an inline wrapper around translation::dsgettext()), it passes
the textdomain defined in the file where it was implemented as a
parameter.
This means that every case of vgettext() being used in other code units
where GETTEXT_TEXTDOMAIN is not defined to "wesnoth-lib", is broken if
the string being looked upon doesn't coincidentally exist in the
wesnoth-lib textdomain.
Ages ago, to work around this limitation, an overload of vgettext() that
takes the textdomain name as a parameter was introduced (see commit
0ba3d05204). Since this form of vgettext()
is rather unwieldy to use (and in particular, the xgettext message
extraction tool mistakes the first argument for the msgid, see below), a
VGETTEXT() macro was also added that uses the GETTEXT_TEXTDOMAIN symbol
defined in the file where the call is made, and thus we get the correct
string from the correct textdomain.
Switching all cases of naked vgettext() in mainline to VGETTEXT() fixes
a myriad of situations where an interpolated string that has an extant
translation does not actually get translated in practice because of the
mismatched textdomain reference (see issue #2709 for an example with MP
game titles). I couldn't find any cases of the companion vngettext()
function (which handles plurals) being used in the wild naked, but for
future reference it also has a companion VNGETTEXT() macro to pass the
correct textdomain to its textdomain-parameter overload.
One caveat is that this commit DOES break the string freeze in one
particular case -- src/units/unit.cpp has a case where the
textdomain-parameter version of naked vgettext() was in use with
"wesnoth" as the first parameter, and xgettext misidentified this as a
translation entry for a "wesnoth" string in the file's assigned
textdomain (which is the default textdomain, wesnoth). So this will
result in the next pot-update both removing the spurious "wesnoth"
string AND adding the correct string to the relevant catalogue template
("<span color=\"$color\">$number_or_percent</span> HP").
to that textdomain.
Other than that, I believe this does not break the string freeze in any
other fashion and it shouldn't result in any regressions for i18n.
It might be worth considering in the future renaming vgettext() and
vngettext() to names that make people less likely to misidentify them as
functions they can freely call directly without regard to the textdomain
assignment issue.
This is the first commit on the 1.14 stable series branch. 1.13.12 is 1.14 RC 1,
so we're just bumping to 1.13.12+dev/1.13.13 here. If the next release is 1.14.0,
we'll set the versions accordingly.
2018-03-18 18:47:52 +11:00
3140 changed files with 612637 additions and 794311 deletions
[*][set_menu_item] no longer fires repeatedly if the player holds the hotkey (bug #1711). If you were relying on repeated firing, add repeat_on_hold=yes to [default_hotkey].
[*][tt]ai.synced_command[/tt] was removed
[/list]
[/rawarn]
[rasection="New Lua/WML features"]
[list]
[*]Add-on creators can now specify a comma-separated list of tags in the .pbl file, which are used by the Add-ons Manager when filtering add-ons by typing key words into the Filter box. This may be used to make it easier for people to find add-ons, e.g. by including their acronym among the tags. See [wiki]PblWML[/wiki] for details.
[/list]
[/rasection]
@ -41,7 +38,7 @@ CHANGES
KNOWN BUGS
==========
[raissue="Newly introduced in 1.13.x"]
[raissue="Newly introduced in 1.14.x"]
[b]General bugs:[/b]
[list]
@ -57,7 +54,6 @@ KNOWN BUGS
[b]General bugs:[/b]
[list]
[*]The game can crash when planning recruits in Planning Mode.
('extra_flags_profile', 'Extra compiler and linker flags to use for profile builds', ""),
BoolVariable('enable_lto', 'Whether to enable Link Time Optimization for build=release', False),
('arch', 'What -march option to use for build=release, will default to pentiumpro on Windows', ""),
BoolVariable('harden', 'Whether to enable options to harden the executables', True),
BoolVariable('glibcxx_debug', 'Whether to define _GLIBCXX_DEBUG and _GLIBCXX_DEBUG_PEDANTIC for build=debug', False),
EnumVariable('profiler', 'profiler to be used for build=profile', "gprof", ["gprof", "gcov", "gperftools", "perf"]),
EnumVariable('pgo_data', 'whether to generate profiling data for PGO, or use existing profiling data', "", ["", "generate", "use"]),
@ -79,7 +80,6 @@ opts.AddVariables(
PathVariable('python_site_packages_dir', 'sets the directory where python modules are installed', "lib/python/site-packages/wesnoth", PathVariable.PathAccept),
BoolVariable('notifications', 'Enable support for desktop notifications', True),
BoolVariable('nls','enable compile/install of gettext message catalogs',True),
BoolVariable('png', 'Clear to disable writing png files for screenshots, images', True),
description=_ "Number of seconds to wait for a ping reply before timing out. Set to 0 to disable"
type=int
default=0
min=0
max=60
step=5
[/advanced_preference]
[advanced_preference]
field=lobby_auto_open_whisper_windows
name=_ "Auto-open whisper windows in lobby"
@ -184,16 +173,25 @@
default=yes
[/advanced_preference]
#ifdef __UNUSED__
[advanced_preference]
field=show_deprecation
# TODO: Add translation marks and enable this after 1.14
name="Show deprecation messages in-game"
description="Show warnings about deprecated API in the in-game chat area. These messages will still be shown in the log, even if this is disabled. In addition, the deprecation log-domain controls how many messages are printed."
name=_ "Show deprecation messages in-game"
description=_ "Show warnings about deprecated API in the in-game chat area. These messages will still be shown in the log, even if this is disabled. In addition, the deprecation log-domain controls how many messages are printed."
type=boolean
default=no
[/advanced_preference]
[advanced_preference]
field=use_prng
name=_ "Use experimental PRNG combat"
description=_ "Enables more determinstic chance-to-hit calculations. This is an experimental feature designed to bring the observed hit/miss rate more in line with the displayed percentages.
Note: this option only affects singleplayer, and the 'Save random seed' option must also be enabled when creating a game for this to work."
W.message {speaker=hunter.id,message='I made it home - resting now until the end of Turn '..hunter_vars.resting_until..' or until fully healed.'}
wesnoth.wml_actions.message {speaker=hunter.id,message='I made it home - resting now until the end of Turn '..hunter_vars.resting_until..' or until fully healed.'}
end
end
@ -185,7 +184,7 @@ function ca_hunter:execution(cfg)
message=_ "There are too many to fight, far too many. We must escape!"
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This is a reenactment of scenario The Elves Besieged of the mainline campaign Heir to the Throne, just that the AI is playing Konrad's side here. The goal is to move Konrad to the signpost in the northwest, while keeping both Konrad and Delfador alive. The same AI as in scenario Protect Unit is used.
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "This is a reenactment of scenario The Elves Besieged of the mainline campaign Heir to the Throne, just that the AI is playing Konrad's side here. The goal is to move Konrad to the signpost in the northwest, while keeping both Konrad and Delfador alive. The same AI as in scenario Protect Unit is used.
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "Well, that was that."
[/message]
[endlevel]
result=victory
@ -335,14 +339,27 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "Important Note" _"<span color='#A00000'>Important:</span> The animal Micro AIs in this scenario are written for a number of animal unit types that do not exist in Wesnoth mainline, such as bears, sheep and sheep dogs, or deer. In this test scenario, these units have been replaced by mainline units."}
[message]
speaker=narrator
image=wesnoth-icon.png
caption="Important Note"
message=_ "<span color='#A00000'>Important:</span> The animal Micro AIs in this scenario are written for a number of animal unit types that do not exist in Wesnoth mainline, such as bears, sheep and sheep dogs, or deer. In this test scenario, these units have been replaced by mainline units."
[/message]
# wmlindent: start ignoring
{MESSAGE narrator "wesnoth-icon.png" "" _"This is a fun little scenario with a bunch of different animal AIs, mostly for watching only. The animal AIs behave as follows:
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "This is a fun little scenario with a bunch of different animal AIs, mostly for watching only. The animal AIs behave as follows:
{MESSAGE LuaAI "" "" _"All right, chaps. Those orcs need to be stopped."}
[message]
speaker=LuaAI
message=_ "All right, chaps. Those orcs need to be stopped."
[/message]
{STORE_UNIT_VAR (id=Big Bad Orc) profile profile}
{MESSAGE (Big Bad Orc) "$profile~FL()~RIGHT()" "" _"They there! We them get!"}
[message]
speaker=Big Bad Orc
image=$profile~FL()~RIGHT()
message=_ "They there! We them get!"
[/message]
{CLEAR_VARIABLE profile}
# wmllint: unbalanced-on
{MESSAGE LuaAI "" "" _"We need to hold that pass for as long as we can. Let's put our strongest fighters on the front line and bring injured units to the back for healing. If we're careful enough, we might even win this battle. I'll join you as soon as I'm done recruiting and do my share of the fighting.
[message]
speaker=LuaAI
message=_ "We need to hold that pass for as long as we can. Let's put our strongest fighters on the front line and bring injured units to the back for healing. If we're careful enough, we might even win this battle. I'll join you as soon as I'm done recruiting and do my share of the fighting.
Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
# wmllint: local spellings AIs RCA
@ -148,7 +158,10 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
side=1
[/have_unit]
[then]
{MESSAGE LuaAI "" "" _"I may have fallen, but we will continue to defend the pass to the last man!"}
[message]
speaker=LuaAI
message=_ "I may have fallen, but we will continue to defend the pass to the last man!"
[/message]
[/then]
[/if]
[/event]
@ -181,7 +194,11 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
{MESSAGE (Dreadful Bat) "" "" _"Be careful to stay out of the way of that dragon. He's a mean one."}
[message]
speaker=Dreadful Bat
message=_ "Be careful to stay out of the way of that dragon. He's a mean one."
[/message]
{CLEAR_VARIABLE profile}
# wmllint: unbalanced-on
{MESSAGE Rowck "" "" _"Hi there. I am Rowck and here is what I do:
[message]
speaker=Rowck
message=_ "Hi there. I am Rowck and here is what I do:
When hungry, I move around part of the map in a random wander until I get into range of an enemy. If enemies are within range, I attack and devour the weakest of them. After that, I retreat to my rest location, where I stay for a certain number of turns or until fully healed.
A few details (features, not bugs, but can be changed if desired):
- If my way home is blocked on the return, the normal RCA AI takes over my behavior.
@ -89,7 +96,8 @@ A few details (features, not bugs, but can be changed if desired):
- A kill only makes me go home when I am the attacker, not as defender.
- Occasionally I will not move at all while wandering (a dragon has to rest sometimes!)
Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -136,7 +144,10 @@ Note: The Hunter AI is coded as a Micro AI. A Micro AI can be added and adapted
[event]
name=end_scenario
{MESSAGE (Dreadful Bat) "" "" _"I'm out of here."}
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario presents a situation with so many units on the map, that there is a noticeable delay (a few seconds or so) before each move by the default AI. By contrast, the Fast Micro AI has a much shorter delay. To demonstrate the difference, side 1 is played by the Fast Micro AI and side 2 by the default (RCA) AI.
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "This scenario presents a situation with so many units on the map, that there is a noticeable delay (a few seconds or so) before each move by the default AI. By contrast, the Fast Micro AI has a much shorter delay. To demonstrate the difference, side 1 is played by the Fast Micro AI and side 2 by the default (RCA) AI.
There is nothing to do here, just watch or use this scenario as a template or for your own tests."}
There is nothing to do here, just watch or use this scenario as a template or for your own tests."
# wmllint: local spellings Minry Aethubry Gadoc Senvan AIs
@ -391,7 +391,11 @@
controller=human
[/modify_side]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "Well, that was that."
[/message]
[endlevel]
result=victory
@ -407,14 +411,17 @@
[event]
name=start
#{MESSAGE narrator "wesnoth-icon.png" "" _"Text"}
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario demonstrates a variety of different uses of the Goto Micro AI. All AI sides are controlled by this MAI in one way or another (except for the saurians, which are run by the Lurkers Micro AI). Messages will be displayed throughout the scenario to point out what the units are doing.
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "This scenario demonstrates a variety of different uses of the Goto Micro AI. All AI sides are controlled by this MAI in one way or another (except for the saurians, which are run by the Lurkers Micro AI). Messages will be displayed throughout the scenario to point out what the units are doing.
The player controls Side 1. There are right-click context menu options for adding Side 1 units to the map and for taking them off again. This is useful mostly for testing how the Side 3 guardians react.
Note: The Goto AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Goto AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -472,10 +479,18 @@ Note: This is a demonstration of how the Goto Micro AI can be used to code guard
name=side 8 turn
{UNIT 8 Ghost 29 1 id=ghost1}
{MESSAGE ghost1 "" "" _"Aaiiieeeeeee !!!"}
{MESSAGE messenger2 "" "" _"O no, a ghost!"}
{MESSAGE messenger1 "" "" _"Don't worry, those are really shy ghosts. Nobody knows why, but they always appear in the north this time of year and move through to the south. Also, very unusually for ghosts, they seem to be scared of everybody and avoid other units as much as possible -- except for the bats and saurians, with which they seem to get along just fine for some reason. So as long as we don't corner them, they'll leave us alone."}
[message]
speaker=ghost1
message=_ "Aaiiieeeeeee !!!"
[/message]
[message]
speaker=messenger2
message=_ "O no, a ghost!"
[/message]
[message]
speaker=messenger1
message=_ "Don't worry, those are really shy ghosts. Nobody knows why, but they always appear in the north this time of year and move through to the south. Also, very unusually for ghosts, they seem to be scared of everybody and avoid other units as much as possible -- except for the bats and saurians, with which they seem to get along just fine for some reason. So as long as we don't corner them, they'll leave us alone."
[/message]
[event]
name=side 8 turn
first_time_only=no
@ -566,7 +581,9 @@ Note: The messengers are controlled by Goto Micro AI definitions that differ by
{MESSAGE narrator "portraits/dwarves/guard.png" _"Standard WML Guardian" _"This is the built-in WML guardian coded using 'ai_special=guardian'. These guardians attack if there is an enemy within their movement range, otherwise they do nothing (except maybe retreating to a village for healing)."}
[message]
speaker=narrator
image=portraits/dwarves/guard.png
caption=_ "Standard WML Guardian"
message=_ "This is the built-in WML guardian coded using 'ai_special=guardian'. These guardians attack if there is an enemy within their movement range, otherwise they do nothing (except maybe retreating to a village for healing)."
{MESSAGE narrator "portraits/trolls/troll.png" _"Return Guardian" _"A 'return guardian' is a variation of the standard Wesnoth guardian. It has an assigned guard position (GP) to which it returns after attacks on approaching enemies:
[message]
speaker=narrator
image=portraits/trolls/troll.png
caption=_ "Return Guardian"
message=_ "A 'return guardian' is a variation of the standard Wesnoth guardian. It has an assigned guard position (GP) to which it returns after attacks on approaching enemies:
- If at GP with no enemy in reach, do nothing.
- If at GP with enemy in reach, leave attack to default AI (note that this may include not attacking if the enemy is deemed too strong).
- If not at GP, return there, no matter whether an enemy is in reach or not.
- If enemies are blocking your way back, do your best to get there anyway.
- If you end up next to an enemy on the way back, attack after the move."}
- If you end up next to an enemy on the way back, attack after the move."
{MESSAGE narrator "portraits/trolls/troll.png" _"Home Guard" _"A 'home guard' is a variant on the 'guardian' AI special. With this variant, the unit has an assigned 'home' location, and will return there if not involved in combat and if not going to a village, whether for healing or to capture it this turn. (By contrast, the standard guardian AI will cause the unit to stay where it last attacked.) This differs from 'return guardian' in that a home guard will press the attack, possibly getting drawn quite far from 'home', rather than returning after each attack. (It can also be lured away by a string of closely-placed villages, but that is something a map builder can control.)
This also demonstrates how to combine candidate actions from Formula AI and Lua AI in one side. The home guard is written in Formula AI, while the return and stationed guardians and the cowards are written in Lua AI. In addition the non-guardian units of the side follow the default AI behavior."}
[message]
speaker=narrator
image=portraits/trolls/troll.png
caption=_ "Home Guard"
message=_ "A 'home guard' is a variant on the 'guardian' AI special. With this variant, the unit has an assigned 'home' location, and will return there if not involved in combat and if not going to a village, whether for healing or to capture it this turn. (By contrast, the standard guardian AI will cause the unit to stay where it last attacked.) This differs from 'return guardian' in that a home guard will press the attack, possibly getting drawn quite far from 'home', rather than returning after each attack. (It can also be lured away by a string of closely-placed villages, but that is something a map builder can control.)
This also demonstrates how to combine candidate actions from Formula AI and Lua AI in one side. The home guard is written in Formula AI, while the return and stationed guardians and the cowards are written in Lua AI. In addition the non-guardian units of the side follow the default AI behavior."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -467,13 +504,18 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{MESSAGE narrator "portraits/undead/archer.png" _"Stationed Guardian" _"A 'stationed guardian' is another variation of the standard Wesnoth guardian with a somewhat more complex behavior than that of the 'return guardian'. Two positions are defined for it, a 'station' and a 'guarded location', as well as a 'distance'. The behavior is as follows:
[message]
speaker=narrator
image=portraits/undead/archer.png
caption=_ "Stationed Guardian"
message=_ "A 'stationed guardian' is another variation of the standard Wesnoth guardian with a somewhat more complex behavior than that of the 'return guardian'. Two positions are defined for it, a 'station' and a 'guarded location', as well as a 'distance'. The behavior is as follows:
- If no enemy is within 'distance' of the guard's current position, do nothing.
- Otherwise: If an enemy is within 'distance' of the guard, but not also within the same distance of the guarded location and the station (all of this simultaneously), move the guard in the direction of the station.
- Otherwise:
- Pick the enemy unit that is closest to the guarded location.
- If we can reach it, pick the adjacent hex with the highest defense rating and attack from there.
- If not in reach, move toward this unit."}
- If not in reach, move toward this unit."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -484,11 +526,16 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{MESSAGE narrator "units/monsters/giant-rat.png" _"Coward" _"Cowards are units that, like guardians, sit around doing nothing until an enemy comes into range. Unlike guardians, however, they run away once enemies approach. Applications might be wild animals, unarmed civilians getting in the way of a battle, etc. The coward macro can be called with two optional locations, 'seek' and 'avoid':
[message]
speaker=narrator
image=units/monsters/giant-rat.png
caption=_ "Coward"
message=_ "Cowards are units that, like guardians, sit around doing nothing until an enemy comes into range. Unlike guardians, however, they run away once enemies approach. Applications might be wild animals, unarmed civilians getting in the way of a battle, etc. The coward macro can be called with two optional locations, 'seek' and 'avoid':
- If neither is given, the coward retreats to the position farthest away from the approaching enemies.
- If 'seek' is given, it preferentially goes toward that location (but getting away from enemies takes priority).
- If 'avoid' is given, it in addition tries to avoid that location (with both maximizing distance from enemies and going toward 'seek' taking priority).
- Both 'seek' and 'avoid' may consist of only one coordinate ('x' or 'y'), in which case not a single hex, but a line of hexes is sought or avoided."}
- Both 'seek' and 'avoid' may consist of only one coordinate ('x' or 'y'), in which case not a single hex, but a line of hexes is sought or avoided."
[/message]
[/command]
[/set_menu_item]
[set_menu_item]
@ -499,9 +546,14 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{MESSAGE narrator "portraits/nagas/fighter.png" _"Zone Guardian" _"A zone guardian is a unit that, as the name says, guards a zone. It moves randomly inside this zone until an enemy enters it (or a separately defined enemy zone, see below). Applications might be the defense of a castle or a nesting area. The zone macro can be called with an optional enemy zone:
[message]
speaker=narrator
image=portraits/nagas/fighter.png
caption=_ "Zone Guardian"
message=_ "A zone guardian is a unit that, as the name says, guards a zone. It moves randomly inside this zone until an enemy enters it (or a separately defined enemy zone, see below). Applications might be the defense of a castle or a nesting area. The zone macro can be called with an optional enemy zone:
- If not specified, the zone guard attacks any enemy coming inside its guard zone.
- Otherwise, it attacks any enemy entering the enemy zone and once there are no more enemies, it goes back to patrol in its basic zone."}
- Otherwise, it attacks any enemy entering the enemy zone and once there are no more enemies, it goes back to patrol in its basic zone."
[/message]
[/command]
[/set_menu_item]
[/event]
@ -510,14 +562,25 @@ This also demonstrates how to combine candidate actions from Formula AI and Lua
{MESSAGE (Another Bad Orc) "" "" _"They there! We them get!"}
[message]
speaker=Kraa
image=$profile~FL()~RIGHT()
message=_ "Kraahhh!!!!"
[/message]
[message]
speaker=Another Bad Orc
message=_ "They there! We them get!"
[/message]
# wmllint: unbalanced-on
{MESSAGE Kraa "$profile~FL()~RIGHT()" "" _"Gryphons of the High Plains, look at all these enemies. They don't behave normally. Most of them don't move at all unless we get close. Let's check out how they react to us.
[message]
speaker=Kraa
image=$profile~FL()~RIGHT()
message=_ "Gryphons of the High Plains, look at all these enemies. They don't behave normally. Most of them don't move at all unless we get close. Let's check out how they react to us.
Note to the player: the right-click context menu provides information about each of the units' behavior.
Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
{CLEAR_VARIABLE profile}
@ -591,7 +654,10 @@ Another note: Most of the Guardian AIs are coded as Micro AIs. A Micro AI can be
[event]
name=end_scenario
{MESSAGE Kraa "" "" _"Gryphons of the High Plains, it is time to return to said plains. Follow me."}
[message]
speaker=Kraa
message=_ "Gryphons of the High Plains, it is time to return to said plains. Follow me."
{MESSAGE (Good Bandit) "" "" _"That outlaw over there is going to run for the keep in the southeast. He's only going to recruit for three rounds before he'll start moving and he and his footpads are much faster than we are. Let's make haste or we'll never catch him.
[message]
speaker=Good Bandit
message=_ "That outlaw over there is going to run for the keep in the southeast. He's only going to recruit for three rounds before he'll start moving and he and his footpads are much faster than we are. Let's make haste or we'll never catch him.
Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI which makes the Side 2 units remain around the keep for two turns (while moving off castle tiles to allow for recruiting) and the Messenger Escort AI which takes over after that. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI which makes the Side 2 units remain around the keep for two turns (while moving off castle tiles to allow for recruiting) and the Messenger Escort AI which takes over after that. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -141,7 +146,10 @@ Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI w
id=Bad Outlaw
[/filter]
{MESSAGE (Good Bandit) "" "" _"We got him! Now whatever it is we are fighting for is safe."}
[message]
speaker=Good Bandit
message=_ "We got him! Now whatever it is we are fighting for is safe."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -165,7 +173,10 @@ Note: This scenario uses a combination of two Micro AIs, the Hang Out Micro AI w
x,y=36,19
[/filter]
{MESSAGE (Bad Outlaw) "" "" _"I made it! Now we can keep fighting for whatever it is that we are fighting for."}
[message]
speaker=Bad Outlaw
message=_ "I made it! Now we can keep fighting for whatever it is that we are fighting for."
{MESSAGE Rebels1 "" "" _"In this scenario, we demonstrate the use of the Healer Support Micro AI. This AI configures the healers of a side to stay behind the battle lines and heal injured and/or threatened units rather than participate in the attacks under all circumstances. It includes several configurable options (which are set differently for the two sides in this scenario) that determine how aggressive/careful the healers are, whether they also attack, how much risk they are willing to take, etc.
[message]
speaker=Rebels1
message=_ "In this scenario, we demonstrate the use of the Healer Support Micro AI. This AI configures the healers of a side to stay behind the battle lines and heal injured and/or threatened units rather than participate in the attacks under all circumstances. It includes several configurable options (which are set differently for the two sides in this scenario) that determine how aggressive/careful the healers are, whether they also attack, how much risk they are willing to take, etc.
For clarity, each healer announces her upcoming support move. If you don't want to see that each time, just hit 'esc' when it happens the first time.
Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[/event]
@ -92,7 +95,10 @@ Note: The Healer Support AI is coded as a Micro AI. A Micro AI can be added and
{MESSAGE Pekzs "" "" _"In this scenario we demonstrate the Lurker Micro AI. A lurker is a unit that is capable of moving across most terrains, but that only stops on and attacks from specific terrain. It might also have the ability to hide on this terrain (which is the reason why this is called the Lurker AI).
[message]
speaker=Pekzs
message=_ "In this scenario we demonstrate the Lurker Micro AI. A lurker is a unit that is capable of moving across most terrains, but that only stops on and attacks from specific terrain. It might also have the ability to hide on this terrain (which is the reason why this is called the Lurker AI).
Lurkers move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead - or it just sits and waits (lurks)."}
Lurkers move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead - or it just sits and waits (lurks)."
[/message]
# wmllint: unbalanced-on
{MESSAGE Pekzs "" "" _"Three different lurker behaviors are set up here using the [micro_ai] tag with different parameters:
[message]
speaker=Pekzs
message=_ "Three different lurker behaviors are set up here using the [micro_ai] tag with different parameters:
Side 2 (blue): saurians attacking only from swamp. If no enemy is in range, they do not move.
@ -460,13 +465,19 @@ Side 3 (green): saurians attacking only from swamp. If no enemy is in range, the
Side 4 (purple): nagas wandering only on water terrain, but attacking from both water and swamp.
We also added two other sides, which demonstrate lurker behavior coded in WML (Side 5, gray) and Formula AI (Side 6, brown)."}
We also added two other sides, which demonstrate lurker behavior coded in WML (Side 5, gray) and Formula AI (Side 6, brown)."
[/message]
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"You can use the right-click context menu to add additional lurkers.
[message]
speaker=narrator
image="wesnoth-icon.png"
caption=_ "Notes"
message=_ "You can use the right-click context menu to add additional lurkers.
Any unit not adjacent to swamp (and water, for the nagas) is safe from the lurkers, thus it is easy to keep Pekzs from being attacked.
The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -530,7 +541,10 @@ The Lua Lurker AI is coded as a Micro AI. A Micro AI can be added and adapted to
[event]
name=end_scenario
{MESSAGE Pekzs "" "" _"Zzanksss for helping me wizz zzossse lurkerss. Hope to sssee you again ssometime."}
[message]
speaker=Pekzs
message=_ "Zzanksss for helping me wizz zzossse lurkerss. Hope to sssee you again ssometime."
{MESSAGE Vanak "$profile~FL()~RIGHT()" "" _"They there! We them get!"}
[message]
speaker=Vanak
image=$profile~FL()~RIGHT()
message=_ "They there! We them get!"
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE messenger "" "" _"Men, I need to get to that signpost in the north, to get the message to our leader. Let's head up there as quickly as we can."}
[message]
speaker=messenger
message=_ "Men, I need to get to that signpost in the north, to get the message to our leader. Let's head up there as quickly as we can."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"The Messenger Escort AI will try to move the dragoon messenger to the signpost in the north, while protecting him as well as possible with the other units. Vanak's orcs need to stop him.
[message]
speaker=narrator
image=wesnoth-icon.png
caption=_ "Notes"
message=_ "The Messenger Escort AI will try to move the dragoon messenger to the signpost in the north, while protecting him as well as possible with the other units. Vanak's orcs need to stop him.
Note that the messenger route is set up through a series of waypoints here simply to demonstrate how to use waypoints. On this map, using only a single waypoint at the end of the route would work just as well (or probably even better).
Also note that the messenger does not have to get exactly to each signpost (except for the last one), getting close is good enough.
The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -170,7 +184,10 @@ The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adap
x,y=28,1
[/filter]
{MESSAGE messenger "" "" _"I made it! Now our people will be safe."}
[message]
speaker=messenger
message=_ "I made it! Now our people will be safe."
[/message]
[endlevel]
result=defeat
[/endlevel]
@ -182,7 +199,10 @@ The Messenger Escort AI is coded as a Micro AI. A Micro AI can be added and adap
[filter]
id=messenger
[/filter]
{MESSAGE messenger "" "" _"Nooo! All is lost. We will never stop the orcs now!"}
[message]
speaker=messenger
message=_ "Nooo! All is lost. We will never stop the orcs now!"
{MESSAGE Konrad "$profile~FL()~RIGHT()" "" _"Hello! I'm a Konrad impostor. We are going to demonstrate the Patrol AI to you in this scenario.
[message]
speaker=Konrad
image=$profile~FL()~RIGHT()
message=_ "Hello! I'm a Konrad impostor. We are going to demonstrate the Patrol AI to you in this scenario.
I am heading for the keep east of the central mountain via a couple waypoints in the south. I will stay there once I get there. By contrast, those two fellas in the center are perpetually circling the mountain, one of them always in the same direction, the other changing directions after every lap.
All of this is implemented by use of the Patrol [micro_ai] tag."}
All of this is implemented by use of the Patrol [micro_ai] tag."
[/message]
# wmllint: unbalanced-off
{CLEAR_VARIABLE profile}
{MESSAGE guard1 "" "" _"By contrast, I am a zone guardian patrolling, in a way, the southernmost part of the map. This AI is implemented via the Guardian [micro_ai] tag. It is here mostly to demonstrate how to set up different Micro AIs for the same side. For more details on different types of guardian AIs, there is a separate test scenario specializing on those."}
{MESSAGE Urudin "" "" _"And I am Urudin. I will attack my enemies for a few turns, but will retreat toward the right edge of the map if my hitpoints are below half of maximum or by Turn 5, whatever happens first.
[message]
speaker=guard1
message=_ "By contrast, I am a zone guardian patrolling, in a way, the southernmost part of the map. This AI is implemented via the Guardian [micro_ai] tag. It is here mostly to demonstrate how to set up different Micro AIs for the same side. For more details on different types of guardian AIs, there is a separate test scenario specializing on those."}
[/message]
[message]
speaker=Urudin
message=_ "And I am Urudin. I will attack my enemies for a few turns, but will retreat toward the right edge of the map if my hitpoints are below half of maximum or by Turn 5, whatever happens first.
This is an AI separate from the Patrols of Side 2."}
This is an AI separate from the Patrols of Side 2."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" _"Notes" _"You, as the player, are in charge of Gertburt's bandits in this scenario. You can either simply watch the patrols move around, or you can move units into their way. The three patrol units are instructed to behave differently when facing enemy units:
[message]
speaker=narrator
image=wesnoth-icon.png
caption=_ "Notes"
message=_ "You, as the player, are in charge of Gertburt's bandits in this scenario. You can either simply watch the patrols move around, or you can move units into their way. The three patrol units are instructed to behave differently when facing enemy units:
Konrad only attacks Gertburt, or any enemy unit that blocks his final waypoint.
@ -224,7 +246,8 @@ The Longbowman attacks any enemy unit he ends up next to at the end of his move.
They all have in common, however, that getting to their next waypoint takes priority over attacking. They will thus prefer to move around enemies rather than straight for them. Also, if a waypoint is occupied by a unit they are not instructed to attack, they will (eventually) abandon that waypoint once they get close enough and move on to the next one.
The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -253,7 +276,10 @@ The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI ca
x,y=25,15
[/filter]
{MESSAGE Konrad "" "" _"Well, that was fun! I'll just hang out here now and watch those two guys walk and walk and ..."}
[message]
speaker=Konrad
message=_ "Well, that was fun! I'll just hang out here now and watch those two guys walk and walk and ..."
[/message]
[/event]
# The events finishing the scenario
@ -294,7 +320,10 @@ The Patrol AI controlling all Side 2 units is coded as a Micro AI. A Micro AI ca
{MESSAGE Koorzhar "$profile~FL()~RIGHT()" "" _"There's that traitor wizard. Let's get him."}
[message]
speaker=Koorzhar
image="$profile~FL()~RIGHT()"
message=_ "There's that traitor wizard. Let's get him."
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE Langzhar "" "" _"Men, you know the deal. We must protect Rossauba under all circumstances. Even my survival is not as important."}
{MESSAGE Rossauba "" "" _"That's very kind of you, but ..."}
{MESSAGE Langzhar "" "" _"No buts! You stay behind the lines and do not engage in battle unless there is no risk to your life, is that understood? And get to that signpost in the northwest if it is safe."}
[message]
speaker=Langzhar
message=_ "Men, you know the deal. We must protect Rossauba under all circumstances. Even my survival is not as important."
[/message]
[message]
speaker=Rossauba
message=_ "That's very kind of you, but ..."
[/message]
[message]
speaker=Langzhar
message=_ "No buts! You stay behind the lines and do not engage in battle unless there is no risk to your life, is that understood? And get to that signpost in the northwest if it is safe."
[/message]
[message]
speaker=narrator
@ -213,7 +225,11 @@ Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and ad
id=Rossauba
[/filter]
{MESSAGE Rossauba "" "" _"I held out for as long as I could."}
[message]
speaker=Rossauba
message=_ "I held out for as long as I could."
[/message]
[fire_event]
name=end_scenario
[/fire_event]
@ -227,7 +243,10 @@ Note: The Protect Unit AI is coded as a Micro AI. A Micro AI can be added and ad
{MESSAGE Koorzhar "$profile~FL()~RIGHT()" "" _"This is a very simple scenario that can be used to test out different recruiting patterns."}
[message]
speaker=Koorzhar
image=$profile~FL()~RIGHT()
message=_ "This is a very simple scenario that can be used to test out different recruiting patterns."
[/message]
{CLEAR_VARIABLE profile}
{MESSAGE Langzhar "" "" _"Just watch the recruiting of both sides and see if it is what you would expect. The recruitment lists cover level 0 to level 2 units, in order to make differences more obvious."}
[message]
speaker=Langzhar
message=_ "Just watch the recruiting of both sides and see if it is what you would expect. The recruitment lists cover level 0 to level 2 units, in order to make differences more obvious."
[/message]
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "Notes" _"If you have not changed anything in the scenario code, Side 1 uses the Random Recruitment Micro AI, with swordsmen and peasants having been given higher probability than the other units, and mages a middling probability. This is not meant as a good recruitment pattern, it simply serves as a demonstration how to use the AI.
[message]
speaker=narrator
image=wesnoth-icon.png
caption=_ "Notes"
message=_ "If you have not changed anything in the scenario code, Side 1 uses the Random Recruitment Micro AI, with swordsmen and peasants having been given higher probability than the other units, and mages a middling probability. This is not meant as a good recruitment pattern, it simply serves as a demonstration how to use the AI.
Side 2 uses the Rush Recruitment Micro AI (which is also used in the Experimental AI).
A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[/event]
@ -108,7 +120,11 @@ A Micro AI can be added and adapted to the need of a scenario easily using only
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
{MESSAGE Grnk "" _"Bottleneck Defense Micro AI Demo" _"In the Bottleneck Defense Micro AI scenario, a small group of human soldiers is instructed to hold a pass against a large horde of orcs. You can either watch them fight it out against the standard RCA AI or take over the orc side."}
[message]
speaker=Grnk
caption=_ "Bottleneck Defense Micro AI Demo"
message=_ "In the Bottleneck Defense Micro AI scenario, a small group of human soldiers is instructed to hold a pass against a large horde of orcs. You can either watch them fight it out against the standard RCA AI or take over the orc side."
{MESSAGE Grnk "" _"Swamp Lurker Micro AI demo" _"Swamp lurkers are dumb, impulse-driven creatures which can move across most terrain, but only stop on swamp. They move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead."}
[message]
speaker=Grnk
caption=_ "Swamp Lurker Micro AI demo"
message=_ "Swamp lurkers are dumb, impulse-driven creatures which can move across most terrain, but only stop on swamp. They move individually without any strategy and always attack the weakest enemy within their reach. If no enemy is in reach, the lurker does a random move instead."
{MESSAGE Grnk "" _"Guardian Micro AI demo" _"In 'Guardians', several variations of the standard Wesnoth guardian are shown, including a ""coward"" unit that runs away from any approaching unit (an ""inverse guardian"", in a way)."}
[message]
speaker=Grnk
caption=_ "Guardian Micro AI demo"
message=_ "In 'Guardians', several variations of the standard Wesnoth guardian are shown, including a ""coward"" unit that runs away from any approaching unit (an ""inverse guardian"", in a way)."
{MESSAGE Grnk "" _"Protect Unit Micro AI Demo" _"This scenario demonstrates one side protecting a wizard while moving him to a goal location. At the same time, the other side is modified to do priority attacks on the wizard, even if a better target (by the default AI criteria) is available. You can watch the two AIs fight it out, or take control of either side to explore how the opposing AI behaves."}
[message]
speaker=Grnk
caption=_ "Protect Unit Micro AI Demo"
message=_ "This scenario demonstrates one side protecting a wizard while moving him to a goal location. At the same time, the other side is modified to do priority attacks on the wizard, even if a better target (by the default AI criteria) is available. You can watch the two AIs fight it out, or take control of either side to explore how the opposing AI behaves."
{MESSAGE Grnk "" _"HttT: The Elves Besieged Micro AI demo" _"This is a reenactment of scenario ""The Elves Besieged"" of the mainline campaign ""Heir to the Throne"", just that the AI is playing Konrad's side here. The same algorithm as for scenario ""Protect Unit"" is used."}
[message]
speaker=Grnk
caption=_ "HttT: The Elves Besieged Micro AI demo"
message=_ "This is a reenactment of scenario ""The Elves Besieged"" of the mainline campaign ""Heir to the Throne"", just that the AI is playing Konrad's side here. The same algorithm as for scenario ""Protect Unit"" is used."
{MESSAGE Grnk "" _"Messenger Escort Micro AI demo" _"'Messenger Escort' has the AI actively protect a messenger while he makes his way to the edge of the map. The escort will also try to open the path for the messenger if there are enemies in the way."}
[message]
speaker=Grnk
caption=_ "Messenger Escort Micro AI demo"
message=_ "'Messenger Escort' has the AI actively protect a messenger while he makes his way to the edge of the map. The escort will also try to open the path for the messenger if there are enemies in the way."
{MESSAGE Grnk "" _"Animals Micro AI demo" _"This scenario demonstrates a number of different animals following customized AI behavior, including wolves hunting deer in packs; dogs herding sheep; bears, spiders, yetis, boar and rabbits wandering and hunting/avoiding each other."}
[message]
speaker=Grnk
caption=_ "Animals Micro AI demo"
message=_ "This scenario demonstrates a number of different animals following customized AI behavior, including wolves hunting deer in packs; dogs herding sheep; bears, spiders, yetis, boar and rabbits wandering and hunting/avoiding each other."
{MESSAGE Grnk "" _"Wolves Micro AI demo" _"Another demonstration of wolves wandering and attacking in packs, with a different behavior from that in 'Animals'."}
[message]
speaker=Grnk
caption=_ "Wolves Micro AI demo"
message=_ "Another demonstration of wolves wandering and attacking in packs, with a different behavior from that in 'Animals'."
{MESSAGE Grnk "" _"Healer Support Micro AI demo" _"This scenario contains a simple demonstration of setting up the Healer Support Micro AI, which uses the healers of a side to back up injured or threatened units rather than having them participate in combat under all circumstances."}
[message]
speaker=Grnk
caption=_ "Healer Support Micro AI demo"
message=_ "This scenario contains a simple demonstration of setting up the Healer Support Micro AI, which uses the healers of a side to back up injured or threatened units rather than having them participate in combat under all circumstances."
{MESSAGE Grnk "" _"Goto Micro AI demo" _"This scenario contains several example usages of the Goto Micro AI, which is a highly configurable method of sending a unit (or units) to a location or set of locations. The units to be moved are defined using a Standard Unit Filter, while the goto locations are given in a Standard Location Filter."}
[message]
speaker=Grnk
caption=_ "Goto Micro AI demo"
message=_ "This scenario contains several example usages of the Goto Micro AI, which is a highly configurable method of sending a unit (or units) to a location or set of locations. The units to be moved are defined using a Standard Unit Filter, while the goto locations are given in a Standard Location Filter."
{MESSAGE Grnk "" _"Combined Hang Out and Messenger Escort Micro AI demo" _"This scenario is a demonstration of the Hang Out Micro AI which keeps units around a (customizable) location until a (customizable) condition is met. After that the units are released to follow other AI behavior. The scenario also shows how to combine two Micro AIs on the same side by having the Messenger Escort Micro AI take over at that point."}
[message]
speaker=Grnk
caption=_ "Combined Hang Out and Messenger Escort Micro AI demo"
message=_ "This scenario is a demonstration of the Hang Out Micro AI which keeps units around a (customizable) location until a (customizable) condition is met. After that the units are released to follow other AI behavior. The scenario also shows how to combine two Micro AIs on the same side by having the Messenger Escort Micro AI take over at that point."
{MESSAGE Grnk "" _"Simple Attack Micro AI demo" _"This scenario demonstrates how certain attacks can be executed with higher priority than the standard Wesnoth attacks and how the AI can be forced to do attacks that it would otherwise avoid."}
[message]
speaker=Grnk
caption=_ "Simple Attack Micro AI demo"
message=_ "This scenario demonstrates how certain attacks can be executed with higher priority than the standard Wesnoth attacks and how the AI can be forced to do attacks that it would otherwise avoid."
{MESSAGE Grnk "" _"Fast Micro AI demo" _"A simple demonstration of the calculation time advantage of the Fast Micro AI over the default AI in scenarios with many units."}
[message]
speaker=Grnk
caption=_ "Fast Micro AI demo"
message=_ "A simple demonstration of the calculation time advantage of the Fast Micro AI over the default AI in scenarios with many units."
[/message]
[/command]
[/set_menu_item]
[/event]
@ -357,9 +425,12 @@
{SCROLL_TO 13 11}
{MESSAGE Grnk "" "" _"Move me to any of the signposts to go to a Micro AI demonstration.
[message]
speaker=Grnk
message=_ "Move me to any of the signposts to go to a Micro AI demonstration.
Information about each demonstration can be accessed by right-clicking on the respective signpost."}
Information about each demonstration can be accessed by right-clicking on the respective signpost."
{MESSAGE sergeant "" "" _"General Grospur, what do we do? These undead will surely wipe us out."}
{MESSAGE Grospur "" "" _"Don't be such a chicken, Sergeant! I have placed units with lots of experience around the perimeter. The undead will not dare to attack them. And those few that sneak through... we can easily dispose of them once they make it inside.
[message]
speaker=sergeant
message=_ "General Grospur, what do we do? These undead will surely wipe us out."
[/message]
[message]
speaker=Grospur
message=_ "Don't be such a chicken, Sergeant! I have placed units with lots of experience around the perimeter. The undead will not dare to attack them. And those few that sneak through... we can easily dispose of them once they make it inside.
<i>In other words, the Wesnoth AI does generally not attack units one XP from leveling if there is no chance of killing the unit with a single attack. However, some of the attacks by the undead are handled by the Simple Attack Micro AI in this scenario. General Grospur might be in for a surprise.</i>"}
<i>In other words, the Wesnoth AI does generally not attack units one XP from leveling if there is no chance of killing the unit with a single attack. However, some of the attacks by the undead are handled by the Simple Attack Micro AI in this scenario. General Grospur might be in for a surprise.</i>"
[/message]
[objectives]
summary=_ "Watch the undead take care of business"
@ -161,10 +167,16 @@
lua_function="close_to_advancing"
[/filter_second]
{MESSAGE $second_unit.id "" "" _"What the ... ?!? They are not supposed to attack me. That just doesn't happen in Wesnoth!"}
{MESSAGE Uralt "" "" _"Hahahahaha !! I have given special instruction to my Soulless to attack all you almost-advanced units first. Also watch how those same Soulless will throw themselves mercilessly at your pitiful soldiers after that, saving my more valuable skeleton minions for later. I have taken the term 'disposable units' to a whole new level. Watch in awe !!
[message]
speaker=$second_unit.id
message=_ "What the ... ?!? They are not supposed to attack me. That just doesn't happen in Wesnoth!"
[/message]
[message]
speaker=Uralt
message=_ "Hahahahaha !! I have given special instruction to my Soulless to attack all you almost-advanced units first. Also watch how those same Soulless will throw themselves mercilessly at your pitiful soldiers after that, saving my more valuable skeleton minions for later. I have taken the term 'disposable units' to a whole new level. Watch in awe !!
<i>Translation: The undead side includes two instances of the Simple Attack Micro AI. The first makes the Soulless attack all units 1 XP from leveling up, such that they can be eliminated afterward. The second executes all remaining attacks possible by Soulless (and Walking Corpses), without regard for their own safety. Only after that does the default Wesnoth attack mechanism kick in to attack with the remaining units (skeletons).</i>"}
<i>Translation: The undead side includes two instances of the Simple Attack Micro AI. The first makes the Soulless attack all units 1 XP from leveling up, such that they can be eliminated afterward. The second executes all remaining attacks possible by Soulless (and Walking Corpses), without regard for their own safety. Only after that does the default Wesnoth attack mechanism kick in to attack with the remaining units (skeletons).</i>"
[/message]
[/event]
# Put more undead out there when less than 25 left
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -134,11 +138,15 @@
name=start
# wmllint: unbalanced-on
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario features bats moving around in a swarm. Without adjacent enemies, they simply try to stay together and at a certain distance from enemies. However, if an enemy unit is close to any bat, the swarm scatters. This is particular fun to watch when one places an enemy unit in the middle of the swarm. After being scattered, the swarm members slowly rejoin, but not in a very organized way. Sub-swarms or individual bats might roam around for quite some time before they find their way back. It is also possible that individual bats (or small groups) split off from the larger swarm at times.
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "This scenario features bats moving around in a swarm. Without adjacent enemies, they simply try to stay together and at a certain distance from enemies. However, if an enemy unit is close to any bat, the swarm scatters. This is particular fun to watch when one places an enemy unit in the middle of the swarm. After being scattered, the swarm members slowly rejoin, but not in a very organized way. Sub-swarms or individual bats might roam around for quite some time before they find their way back. It is also possible that individual bats (or small groups) split off from the larger swarm at times.
The player controls a side of gryphons, each of which is given 99 moves so that the reaction of the swarm to enemies can be tested easily. There are also several right-click options, for example for adding bats or gryphons or for taking units off the map.
Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."}
Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted to the need of a scenario easily using only WML and the [micro_ai] tag. Check out the <span color='#00A000'>Micro AI wiki page</span> at http://wiki.wesnoth.org/Micro_AIs for more information."
[/message]
# wmllint: unbalanced-off
[objectives]
@ -174,7 +182,11 @@ Note: The Swarm AI is coded as a Micro AI. A Micro AI can be added and adapted t
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "Well, that was that."
[/message]
# So that game goes on to next scenario
[modify_side]
@ -185,11 +189,15 @@
[event]
name=start
{MESSAGE narrator "wesnoth-icon.png" "" _"This scenario features a different kind of wolf behavior from 'Animals'. First, there can be an arbitrary number of wolf packs and the pack size on each side is a free parameter (set to 3 for Side 2 and 4 for Side 3 in this scenario). At the beginning of the scenario, close wolves are grouped into packs in a semi-methodical way. Wolves of the same pack begin by joining each other on the map. After that, they stay together until only one wolf is left, which then tries to join up with an incomplete pack or with other single wolves. Individual wolves entering the map during the scenario behave in that way as well.
[message]
speaker=narrator
image=wesnoth-icon.png
message=_ "This scenario features a different kind of wolf behavior from 'Animals'. First, there can be an arbitrary number of wolf packs and the pack size on each side is a free parameter (set to 3 for Side 2 and 4 for Side 3 in this scenario). At the beginning of the scenario, close wolves are grouped into packs in a semi-methodical way. Wolves of the same pack begin by joining each other on the map. After that, they stay together until only one wolf is left, which then tries to join up with an incomplete pack or with other single wolves. Individual wolves entering the map during the scenario behave in that way as well.
Second, wolves do not actively hunt here. For the most part they just wander (often long distance). However, the pack ferociously (and without regard for its own health) attacks any enemy units that come into range, as long as that does not mean separating the pack by more than a few hexes. Staying together, or joining with a new wolf assigned to the pack, is the only thing that takes priority over satisfying the wolves' thirst for blood.
To emphasize which wolf belongs to which pack, the pack number will be displayed below each wolf in this scenario once the AI takes control of a side the first time."}
To emphasize which wolf belongs to which pack, the pack number will be displayed below each wolf in this scenario once the AI takes control of a side the first time."
[/message]
[message]
speaker=narrator
@ -259,7 +267,11 @@ Also note that the wolves AI is coded as a Micro AI. A Micro AI can be added and
[/have_unit]
[/not]
[then]
{MESSAGE narrator "wesnoth-icon.png" "" _"Well, that was that."}
message=_ "Kai Krellis saw that it was so. The refugee merfolk, sore in their pride from fleeing their enemies, cheered his ultimatum and made ready to fight with a will."
@ -431,7 +430,6 @@
[/if]
[message]
duration=30
speaker=narrator
image=wesnoth-icon.png
message=_ "You can choose when the slaves come out of their villages and attack their captors. When you are ready, right click anywhere and select the slave revolt."
story=_ "The tribe that had fled Jotha unable to fight returned as an army stiffened by veteran fighters and led by a warrior king. Though they were tired from their journey, weariness fell from them as they neared home. The mermen arrived during the night, and found the mouth of their bay guarded, so they headed south along the coast to some outlying villages to gather news of the invaders."
story=_ "The tribe that had fled Jotha unable to fight returned as an army stiffened by veteran fighters and led by a warrior king. Though they were tired from their journey, weariness fell from them as they neared home. The merfolk arrived during the night, and found the mouth of their bay guarded, so they headed south along the coast to some outlying villages to gather news of the invaders."
[/part]
[/story]
{DW_TRACK {JOURNEY_12_NEW} }
{DEFAULT_SCHEDULE_SECOND_WATCH}
turns=-1
turns=unlimited
[side]
{SIDE_1}
@ -149,7 +149,7 @@
{RING_OF_STRENGTH_EVENTS}
#The mermen have no villages left when they return (but a few are
#The merfolk have no villages left when they return (but a few are
#still unclaimed):
{STARTING_VILLAGES 2 15}
{STARTING_VILLAGES_AREA 2 28 24 4}
@ -488,7 +488,7 @@
name=turn 2
[message]
speaker=narrator
message=_ "At dawn, the mermen got a good look at their opponents."
message=_ "At dawn, the merfolk got a good look at their opponents."
message=_ "After destroying Mal-Ravanal’s henchmen, Kai Krellis awaited another attack. But it never came. Krellis sent some messengers south to discover what they could. The news that came back was better than good. Mal-Ravanal was dead! Soldiers of Wesnoth had defeated him at about the same time the mermen had defeated the undead at Jotha. With the evil wizard gone, the mermen relaxed and began rebuilding in earnest, and soon Jotha was restored."
message=_ "After destroying Mal-Ravanal’s henchmen, Kai Krellis awaited another attack. But it never came. Krellis sent some messengers south to discover what they could. The news that came back was better than good. Mal-Ravanal was dead! Soldiers of Wesnoth had defeated him at about the same time the merfolk had defeated the undead at Jotha. With the evil wizard gone, the merfolk relaxed and began rebuilding in earnest, and soon Jotha was restored."
image=wesnoth-icon.png
[/message]
Some files were not shown because too many files have changed in this diff
Show more