Micro AIs: minor grammar fixes
This commit is contained in:
parent
ec21fad877
commit
f06daf98fd
9 changed files with 22 additions and 22 deletions
|
@ -182,7 +182,7 @@ return {
|
|||
unit.variables.hunting_status = nil
|
||||
unit.variables.resting_until = nil
|
||||
if cfg.show_messages then
|
||||
W.message { speaker = unit.id, message = 'I am done resting. It is time to go hunting again next turn.' }
|
||||
W.message { speaker = unit.id, message = 'I am done resting. It is time to go hunting again next turn.' }
|
||||
end
|
||||
end
|
||||
return
|
||||
|
@ -362,8 +362,8 @@ return {
|
|||
local unit_type = cfg.type or "Wolf"
|
||||
local pack_size = cfg.pack_size or 3
|
||||
|
||||
-- Assign the pack numbers to each wolf. Keeps numbers of existing packs
|
||||
-- (unless pack size is down to one). Pack number is stored in wolf unit variables
|
||||
-- Assign the pack numbers to each wolf. Keeps numbers of existing packs
|
||||
-- (unless pack size is down to one). Pack number is stored in wolf unit variables
|
||||
-- Also returns a table with the packs (locations and id's of each wolf in a pack)
|
||||
local wolves = wesnoth.get_units { side = wesnoth.current.side, type = unit_type }
|
||||
--print('#wolves:', #wolves)
|
||||
|
@ -783,7 +783,7 @@ return {
|
|||
return -H.distance_between(x, y, cg[1], cg[2])
|
||||
end)
|
||||
-- We could move this wolf right here, but for convenience all the actual moves are
|
||||
-- grouped together below. Speed wise that should not really make a difference, but could be optimized
|
||||
-- grouped together below. Speed wise that should not really make a difference, but could be optimized
|
||||
end
|
||||
--print('goto_hex', goto_hex[1], goto_hex[2])
|
||||
--AH.put_labels(reach_map)
|
||||
|
|
|
@ -88,7 +88,7 @@ return {
|
|||
|
||||
-- get one of the reachable wander terrain hexes randomly
|
||||
local rand = AH.random(1, reachable_wander_terrain:size())
|
||||
--print(" reach_wander no allies: " .. reachable_wander_terrain:size() .. " rand #: " .. rand)
|
||||
--print(" reach_wander no allies: " .. reachable_wander_terrain:size() .. " rand #: " .. rand)
|
||||
local dst = reachable_wander_terrain:to_stable_pairs()
|
||||
if dst[1] then
|
||||
dst = dst[rand]
|
||||
|
|
|
@ -16,11 +16,11 @@ return {
|
|||
local T = H.set_wml_tag_metatable {}
|
||||
local _ = wesnoth.textdomain "wesnoth-ai"
|
||||
|
||||
local tooltip_enemy_weight = _"Enemy unit weight: The (negative) weight given to each enemy unit that can reach a potential target location. Default: 100"
|
||||
local tooltip_my_unit_weight = _"My unit weight: The (positive) weight given to each of the AI's units that can reach a potential target location. Default: 1"
|
||||
local tooltip_enemy_weight = _"Enemy unit weight: The (negative) weight given to each enemy unit that can reach a potential target location. Default: 100"
|
||||
local tooltip_my_unit_weight = _"My unit weight: The (positive) weight given to each of the AI's units that can reach a potential target location. Default: 1"
|
||||
local tooltip_distance_weight = _"Goal distance weight: The (negative) weight for each step the unit is away from its goal location.\nDefault: 3 -- thus, by default, being a step closer to the goal is as important as being in reach of 3 of AI's units."
|
||||
local tooltip_terrain_weight = _"Terrain defense weight: The (positive) weight of the terrain defense rating for a potential target location.\nDefault: 0.1 -- thus, by default, a difference of 30 in terrain defense rating is as important as being a step closer to the goal."
|
||||
local tooltip_bearing = _"Bearing: Everything else being equal, move protected unit toward or away from enemy groups. Default: toward"
|
||||
local tooltip_bearing = _"Bearing: Everything else being equal, move protected unit toward or away from enemy groups. Default: toward"
|
||||
|
||||
protect_unit.dialog = {
|
||||
T.tooltip { id = "tooltip_large" },
|
||||
|
@ -34,7 +34,7 @@ return {
|
|||
|
||||
T.row {
|
||||
T.column { horizontal_alignment = "left", border = "all", border_size = 5,
|
||||
T.label { label = _"Click on 'Close' without changing anything to use defaults.\nAll weights must be 0 or larger. Invalid inputs are converted to default values.\nTooltips enabled for all parameters." }
|
||||
T.label { label = _"Click on 'Close' without changing anything to use defaults.\nAll weights must be 0 or larger. Invalid inputs are converted to default values.\nTooltips enabled for all parameters." }
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -165,7 +165,7 @@ return {
|
|||
-- If AI parameters are not set, bring up the dialog
|
||||
-- For demo scenario only, delete for real use
|
||||
--if (not self.data.enemy_weight) then
|
||||
-- W.message { speaker = "narrator", image = "wesnoth-icon.png", message = "Before we get going, you can set some of the AI parameters. If you want to work with the default values, just click on 'Close' in the following dialog." }
|
||||
-- W.message { speaker = "narrator", image = "wesnoth-icon.png", message = "Before we get going, you can set some of the AI parameters. If you want to work with the default values, just click on 'Close' in the following dialog." }
|
||||
|
||||
-- local r = wesnoth.show_dialog(self.dialog, self.preshow, self.postshow)
|
||||
|
||||
|
@ -281,7 +281,7 @@ return {
|
|||
rating = rating - GDM.values[ind] * distance_weight
|
||||
-- Note: rating will usually be negative, but that's ok (the least negative hex wins)
|
||||
|
||||
-- Terrain rating. Difference of 30 in defense should be worth ~1 step toward goal
|
||||
-- Terrain rating. Difference of 30 in defense should be worth ~1 step toward goal
|
||||
rating = rating + TDM.values[ind] * terrain_weight
|
||||
|
||||
-- Tie breaker: closer to or farther from enemy
|
||||
|
|
|
@ -147,7 +147,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
|
|||
if (not cfg.action) then H.wml_error("[micro_ai] missing required action= key") end
|
||||
|
||||
if (cfg.action ~= 'add') and (cfg.action ~= 'delete') and (cfg.action ~= 'change') then
|
||||
H.wml_error("[micro_ai] invalid value for action=. Allowed values: add, delete or change")
|
||||
H.wml_error("[micro_ai] invalid value for action=. Allowed values: add, delete or change")
|
||||
end
|
||||
|
||||
--------- Healer Support Micro AI - side-wide AI ------------------------------------
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#textdomain wesnoth-ai
|
||||
|
||||
#define ANIMAL_AI_DESCRIPTIONS1
|
||||
_"<u>General</u>: These AI's are set up to simulate (to some extent) how these animals behave in real life. This includes that they are animals, meaning that they are not super smart. As an example, the wolves generally hunt in a pack, but are easily distracted by prey coming into range. They are also decent, but not great at cornering deer. For the most part, this is intentional.
|
||||
_"<u>General</u>: These AIs are set up to simulate (to some extent) how these animals behave in real life. This includes that they are animals, meaning that they are not super smart. As an example, the wolves generally hunt in a pack, but are easily distracted by prey coming into range. They are also decent, but not great at cornering deer. For the most part, this is intentional.
|
||||
|
||||
<u>Bears (replaced by Ghasts), Spiders and Yetis</u> mostly just wander in their respective parts of the map. They stay out of each other's way (and out of the way of the dogs), but do attack each other if cornered. They attack the other, weaker animals (deer etc.) if those are within range.
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ Note: The Bottleneck Defense AI is coded as a Micro AI. A Micro AI can be added
|
|||
image=wesnoth-icon.png
|
||||
message= _ "In this scenario, the AI playing the humans in the east is instructed to form a defensive line at the pass and hold off the orcs for as long as possible. Do you want to play the orc side or let the default (RCA) AI do that?"
|
||||
[option]
|
||||
message= _ "<span font='16'>I'll watch the two AI's fight it out.</span>"
|
||||
message= _ "<span font='16'>I'll watch the two AIs fight it out.</span>"
|
||||
[/option]
|
||||
[option]
|
||||
message= _ "<span font='16'>I'll play the orcs.</span>"
|
||||
|
|
|
@ -393,11 +393,11 @@
|
|||
#{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 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.
|
||||
|
||||
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.
|
||||
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."}
|
||||
# wmllint: unbalanced-off
|
||||
|
||||
[objectives]
|
||||
|
|
|
@ -80,11 +80,11 @@
|
|||
name=start
|
||||
|
||||
# wmllint: unbalanced-on
|
||||
{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 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.
|
||||
|
||||
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.
|
||||
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."}
|
||||
# wmllint: unbalanced-off
|
||||
[/event]
|
||||
|
||||
|
|
|
@ -136,12 +136,12 @@
|
|||
caption= _ "Question for the Player"
|
||||
image=wesnoth-icon.png
|
||||
# wmllint: unbalanced-on
|
||||
message= _ "In this scenario, the AI playing the humans in the east (Langzhar) is instructed to protect the wizard Rossauba, while moving him safely to the signpost. On the other side, Koorzhar's units (in the west) will primarily attack Rossauba, even if a better target is available. Do you want to play either of the sides or let the AI's battle it out among themselves?
|
||||
message= _ "In this scenario, the AI playing the humans in the east (Langzhar) is instructed to protect the wizard Rossauba, while moving him safely to the signpost. On the other side, Koorzhar's units (in the west) will primarily attack Rossauba, even if a better target is available. Do you want to play either of the sides or let the AIs battle it out among themselves?
|
||||
|
||||
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."
|
||||
# wmllint: unbalanced-off
|
||||
[option]
|
||||
message= _ "<span font='16'>I'll watch the two AI's fight it out</span>"
|
||||
message= _ "<span font='16'>I'll watch the two AIs fight it out</span>"
|
||||
[/option]
|
||||
[option]
|
||||
message= _ "<span font='16'>I'll play Langzhar's side (to see how Koorzhar's units target Rossauba)</span>"
|
||||
|
|
Loading…
Add table
Reference in a new issue