Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Postby Darthagnon » November 19th, 2017, 12:04 am

Guess I shouldn't expect too much tech support for game mods, ;) but thought I'd ask anyway.

After not playing Battle for Wesnoth for years, I finally installed 1.12.6 and am getting back into it. Also went and installed a few interesting-looking mods. One of these was the Ultra Super Death Gore Fest Chainsawer 3000 mod, which adds blood to the game.

It works perfectly, except for...
Whenever a unit dies, it posts a LUA error to the chat. It's clearable with Ctrl+X, but it would be kinda nice if I could either a) disable error reporting, or b) figure out some sort of fix.

The error it posts is the following:
Code: Select all
23:56 <Lua error> .../Ultra_Super_Death_Gore_Fest_Chainsawer_3000/usdgfc3.lua:68: attempt to index global 'helper' (a nil value)
stack traceback:
.../Ultra_Super_Death_Gore_Fest_Chainsawer_3000/usdgfc3.lua:68: in function 'cmd'
...es (x86)/Battle for Wesnoth 1.12.6\data\lua/wml-tags.lua:320: in function <...es (x86)/Battle for Wesnoth 1.12.6\data\lua/wml-tags.lua:284>


I'd sure appreciate any help. I hope this is the right forum to post in.

Live long and prosper!

Darth Agnon
Monster Hunter, Planeswalker and Sith
Darthagnon
 
Posts: 1
Joined: November 18th, 2017, 9:21 pm

Re: Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Postby Tad_Carlucci » November 19th, 2017, 3:21 am

Don't have the source (it's in the UMC mod) and not chasing down the error but if you want to:

The error message usually indicates you're missing a Lua module. Most likely from another UMC. The 'helper' was probably supposed to represent another module, but, for some reason, it did not load and 'helper' is nil as a result. There may have been a console log message, probably when the campaign or scenario was first loaded which would help identify the missing component. Or you could look at the Lua source in the scenario and see where helper is assigned (probably near the top of the file).
I forked real life and now I'm getting merge conflicts.
Tad_Carlucci
Developer
 
Posts: 210
Joined: April 24th, 2016, 4:18 pm

Re: Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Postby jjr » November 28th, 2017, 3:44 pm

Tad_Carlucci wrote:Don't have the source (it's in the UMC mod) and not chasing down the error but if you want to:

The error message usually indicates you're missing a Lua module. Most likely from another UMC. The 'helper' was probably supposed to represent another module, but, for some reason, it did not load and 'helper' is nil as a result. There may have been a console log message, probably when the campaign or scenario was first loaded which would help identify the missing component. Or you could look at the Lua source in the scenario and see where helper is assigned (probably near the top of the file).

I upload an attachment for the lua file; the error locates in line 68:
Code: Select all
local death_code = helper.get_child(ucode, "death")

This file is the only Lua file in the addon, and I can't find any variables or functions that named "helper".
Since I am new to BFW, I don't know any built-in functions for Lua modding, but my coding instinct tells me that "helper" should refer to one of the built-in functions/global variables of BFW, right?
Attachments
usdgfc3.lua
This is the lua source file that contains the error
(6.35 KiB) Downloaded 4 times
User avatar
jjr
 
Posts: 2
Joined: November 28th, 2017, 3:07 pm

Re: Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Postby Pentarctagon » November 28th, 2017, 5:02 pm

You do need to initialize the helper variable though. See here for an example.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Pentarctagon
Forum Administrator
 
Posts: 2972
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Postby Chainsawer » November 29th, 2017, 1:32 pm

It has been fixed.
Chainsawer
 
Posts: 1
Joined: November 29th, 2017, 1:31 pm

Re: Lua Errors: Ultra Super Death Gore Fest Chainsawer 3000

Postby jjr » November 30th, 2017, 9:52 am

Chainsawer wrote:It has been fixed.

There are some other errors reported in the log:
20171128 21:31:17 error display: could not open image 'usdgfc3-heavy-light-2.png'
20171128 21:31:21 warning engine: variable_info: invalid WML array index, usdgfc3_items[0]

The image problem may be in line 130 of the lua file, and the invalid array index one may be in line 152.
User avatar
jjr
 
Posts: 2
Joined: November 28th, 2017, 3:07 pm


Return to Lua Labs

Who is online

Users browsing this forum: No registered users and 1 guest