wesnoth/data/ai/lua/extCAexample.lua
Dmitry Kovalenko b207a1b1ca LuaAI: the need to define an engine is now deprecated.
All CAs can be store in external .lua files. If the scenario config
lacks an [engine] tag for the Lua AI engine, but still tries to use CA
with engine=lua, a dummy engine will be automatically generated,
providing the needed functionality
2012-06-12 12:36:06 +00:00

16 lines
306 B
Lua

--! #textdomain wesnoth
example_ca = {}
function example_ca:eval(ai)
wesnoth.message("External eval says hi!")
return 10000
end
function example_ca:exec(ai)
wesnoth.message("External CA exec attacks!")
ai.attack(2, 12, 3, 12, 1, 1) -- showcasing the presence of the AI table
end
return example_ca