Creating Custom AIs
Moderator: Forum Moderators
Forum rules
- Please use [code] BBCode tags in your posts for embedding WML snippets.
- To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Creating Custom AIs
Hi,
The example shown on the wiki is throwing lua errors.
https://wiki.wesnoth.org/Creating_Custom_AIs
I think the passed cfg argument is null.
Edit:
Commenting out [args] and using eval_parms= and exec_parms= seems to fix it.
Edit2:
This is confusing af.
[args] works by I had to make cfg the first argument :/
Just make that the default shown in the example.
The example shown on the wiki is throwing lua errors.
https://wiki.wesnoth.org/Creating_Custom_AIs
I think the passed cfg argument is null.
Code: Select all
20220118 21:19:25 error scripting/lua: ~add-ons/Bug_Tester/lua/return_guardian.lua:42: bad argument #1 to 'find_vacant_tile' (location expected, got nil)
stack traceback:
[C]: in field 'find_vacant_tile'
~add-ons/Bug_Tester/lua/return_guardian.lua:42: in field 'execution'
[string "local self, params, data = ......"]:2: in main chunk
Commenting out [args] and using eval_parms= and exec_parms= seems to fix it.
Edit2:
This is confusing af.
[args] works by I had to make cfg the first argument :/
Just make that the default shown in the example.
- Celtic_Minstrel
- Developer
- Posts: 2211
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: Creating Custom AIs
Yeah, it looks like the example is wrong, so feel free to update it with what actually works.