LUA error in THoT-Invaders
Moderator: Forum Moderators
Forum rules
Before reporting issues in this section, you must read the following topic:
Before reporting issues in this section, you must read the following topic:
LUA error in THoT-Invaders
See the attached replay. On turn 7 for side 3, the orcs re-occupy the village at 25,2. Immediately when the village is occupied there is only one hex free next to the village. The game tried to spawn more outlaw humans. It creates one, then prints the following error:
It looks like the lua code tries to handle the case where all the hexes next to the village are occupied, and tries to go out to radius 2 in that case. But this village is near the edge of the map, so radius 2 could theoretically include hexes that are off the map.
Observed with 1.14.15 (standalone MacOS version on MacOS 10.14.6). Other build details:
The Battle for Wesnoth version 1.14.15
Running on Apple macOS 10.14.6 (18G9323)
Distribution channel: SourceForge
Game paths
==========
Data dir: /Applications/Wesnoth.app/Contents/Resources
User config dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14
User data dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14
Saves dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14/saves
Add-ons dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14/data/add-ons
Cache dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14/cache
Libraries
=========
Boost: 1.74
Cairo: 1.16.0 (runtime 1.16.0)
Pango: 1.46.1 (runtime 1.46.1)
SDL: 2.0.12 (runtime 2.0.12)
SDL_image: 2.0.5 (runtime 2.0.5)
SDL_mixer: 2.0.4 (runtime 2.0.4)
SDL_ttf: 2.0.15 (runtime 2.0.15)
Features
========
JPEG screenshots: yes
Lua console completion: yes
Legacy bidirectional rendering: no
Cocoa notifications back end: yes
Current video settings
======================
Current pixel resolution: 1440x855
Refresh rate: 60
SDL reports: 256x255 dots per inch.
Installed add-ons
=================
No add-ons installed.
Code: Select all
20210801 01:08:36 error scripting/lua: campaigns/The_Hammer_of_Thursagan/lua/spawns.lua:27: bad argument #2 to 'put_unit' (invalid location)
stack traceback:
[C]: in field 'put_unit'
campaigns/The_Hammer_of_Thursagan/lua/spawns.lua:27: in local 'cmd'
lua/wml-utils.lua:145: in field 'handle_event_commands'
lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>
Observed with 1.14.15 (standalone MacOS version on MacOS 10.14.6). Other build details:
The Battle for Wesnoth version 1.14.15
Running on Apple macOS 10.14.6 (18G9323)
Distribution channel: SourceForge
Game paths
==========
Data dir: /Applications/Wesnoth.app/Contents/Resources
User config dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14
User data dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14
Saves dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14/saves
Add-ons dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14/data/add-ons
Cache dir: /Volumes/m_app/apps/org.wesnoth.Wesnoth/Data/Library/Application Support/Wesnoth_1.14/cache
Libraries
=========
Boost: 1.74
Cairo: 1.16.0 (runtime 1.16.0)
Pango: 1.46.1 (runtime 1.46.1)
SDL: 2.0.12 (runtime 2.0.12)
SDL_image: 2.0.5 (runtime 2.0.5)
SDL_mixer: 2.0.4 (runtime 2.0.4)
SDL_ttf: 2.0.15 (runtime 2.0.15)
Features
========
JPEG screenshots: yes
Lua console completion: yes
Legacy bidirectional rendering: no
Cocoa notifications back end: yes
Current video settings
======================
Current pixel resolution: 1440x855
Refresh rate: 60
SDL reports: 256x255 dots per inch.
Installed add-ons
=================
No add-ons installed.
- Attachments
-
- THoT-Invaders replay.gz
- (48.38 KiB) Downloaded 47 times
Re: LUA error in THoT-Invaders
The function needs to exclude the borders.
The fix would apply for:
The_Hammer_of_Thursagan/lua/spawns.lua
Eastern_Invasion/lua/bandits.lua