A simple external AI Lua error

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
ib2002
Posts: 1
Joined: May 24th, 2022, 12:04 am

A simple external AI Lua error

Post by ib2002 »

I'm working AI project for school that involves reinforcement learning. I use wesnoth as a test environment. The project interfaces to wesnoth using Lua. I tried the Lua interface from another repository and it all works fine except for the most basic CA that supposed to just pass the turn:

Code: Select all

local ca_pass = {}

function ca_pass:evaluation()
    return 999980
end

function ca_pass:execution(cfg, data)
    
end

return ca_pass
This seems to generate an error

Code: Select all

attempt to index a nil value
I searched high and low and read through the creating custom AI manual on this site, but I can't seem to find a clue yet. Any help will be greatly appreciated.
dwarftough
Posts: 254
Joined: August 4th, 2019, 5:27 pm

Re: A simple external AI Lua error

Post by dwarftough »

ib2002 wrote: May 24th, 2022, 12:34 am This seems to generate an error

Code: Select all

attempt to index a nil value
It usually says where it's attempted to index a nil value, a trace with line numbers. Could you provide one? It would help finding the cause
Post Reply