[solved] Where is "ai.attack" explained?
Moderator: Forum Moderators
[solved] Where is "ai.attack" explained?
data/ai/lua/extCAexample.lua
has the following line:
Code: Select all
ai.attack(2, 12, 3, 12, 1, 1) -- showcasing the presence of the AI table
Thanks.
(A bit unrelated, but if I wanted to search the forum for "ai.attack", how could I enter that without resulting in a (rejected) search for the two words attack and ai?)
EDIT:Changing title because this is solved.
EDIT2: Changing title again, new question. No, it was a stupid mistake on my part...
Last edited by doofus-01 on January 31st, 2016, 1:27 am, edited 3 times in total.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: Where is "ai.attack" explained?
Didnt think of way for searching "ai", but for attack
Searching git repo found trace of this
att*ack
works relatively well.Searching git repo found trace of this
ai.attack(attacker, defender, weapon)
. Might be worth looking data/ai/lua/ai_helper.lua and https://github.com/wesnoth/wesnoth/sear ... &type=CodeRe: Where is "ai.attack" explained?
you can also look up the definition of the ai.attack function in this file https://github.com/wesnoth/wesnoth/blob ... a/core.cpp, it tslly you that it takes the parameters (attacker, defender, weapon_used, i_dont_know) where parameters 1 and 2 are eigher lua units, or locations passed as 2 integers.
I i understand that code correctly then this table https://github.com/wesnoth/wesnoth/blob ... e.cpp#L846 contains all the ai. functions.
In 1.13 you can maybe also alternativeley use [do_command] actionwml which lets you execute game actions in the format explained here in the replaywml wiki file.
I i understand that code correctly then this table https://github.com/wesnoth/wesnoth/blob ... e.cpp#L846 contains all the ai. functions.
In 1.13 you can maybe also alternativeley use [do_command] actionwml which lets you execute game actions in the format explained here in the replaywml wiki file.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
Re: Where is "ai.attack" explained?
Thanks, using the astrix to tied things together looks like it works. I tried searching "ai*attack" and got no results, but at least it was a search for what I intended (I think).Ravana wrote:Didnt think of way for searching "ai", but for attack att*ack works relatively well.
Thanks as well, that answers my question. After all that, [do_command] is probably more my speed. Neither were quite what I was hoping for, but good to know anyway.gfgtdf wrote:you can also look up the definition of the ai.attack function in this file ...
Thanks again, this is closed.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: [solved] Where is "ai.attack" explained?
doofus-01: I know you already got your answer, but just for future reference: Customizing_AI_in_Wesnoth_1.8#Lua_AI_syntax
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
Re: [solved] Where is "ai.attack" explained?
Well that's embarrassing. Thanks for the link, mattsc.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
| Abandoned: Tales of the Setting Sun
GitHub link for these projects
Re: [solved] Where is "ai.attack" explained?
I forgot to comment on this earlier. It's frequently bugged me that you cannot search the forums for "ai", but there's a workaround by using Google (and probably other search engines). In your case, you can type this into the Google search:doofus-01 wrote:(A bit unrelated, but if I wanted to search the forum for "ai.attack", how could I enter that without resulting in a (rejected) search for the two words attack and ai?)
"ai.attack" site:forums.wesnoth.org
A minor annoyance is that the . is a placeholder here as Google ignores most special characters, so it will also find "ai attack", "ai_attack" etc., but there aren't so many instances of those on the forums that that is a serious problem.
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on