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: 478
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
Co-founder and current maintainer of IsarFoundation, Afterlife Rated and overall Wesnoth Autohost Project
Developer and maintainer of my fork of World Conquest, Invincibles Conquest II
User avatar
Celtic_Minstrel
Developer
Posts: 2158
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: A simple external AI Lua error

Post by Celtic_Minstrel »

I'm pretty sure the code you posted cannot cause that error. We need more information.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply