Wargus / wargus

Importer and scripts for Warcraft II: Tides of Darkness, the expansion Beyond the Dark Portal, and Aleonas Tales
GNU General Public License v2.0
360 stars 55 forks source link

LUA error: attempt to call global 'SetFogOfWarEasingSteps' (a nil value) #468

Closed etm closed 3 months ago

etm commented 3 months ago

I successfully extracted from setup_warcraft_ii_2.02v4(28734).exe which i downloaded from GOG.

When starting, the following error occurs. I have Fedora 40, lua 5.4.6

[string "/home/xxx/.stratagus/data.Wargus/scripts/stratagus.lua"]:204: attempt to call global 'SetFogOfWarEasingSteps' (a nil value) stack traceback: [string "/home/xxx/.stratagus/data.Wargus/scripts/stratagus.lua"]:204: in main chunk

ipochto commented 3 months ago

Which version of stratagus ?

etm commented 3 months ago

Stratagus v3.3.2, Copyright (c) 1998-2020 by The Stratagus Project written by Lutz Sammer, Fabrice Rossi, Vladi Shabanski, Patrice Fortier, Jon Gabrielson, Andreas Arens, Nehal Mistry, Jimmy Salmon, Pali Rohar, cybermind and others. https://github.com/Wargus/stratagus Compile options ZLIB BZ2LIB VORBIS THEORA LINUX

then version that comes with fedora 40

ipochto commented 3 months ago

Very strange, this method was added about 2 years ago. Do you have this line? https://github.com/Wargus/stratagus/blob/9a24853bd68d5e8fc97fec66e1a8cb4a543f999e/src/map/script_map.cpp#L1187

ipochto commented 3 months ago

Just cheсked: this commit was merged after 3.3.2 release. So, you should use the same versions for both wargus and stratagus. 3.3.2 is latest stable. In your case, it looks like you're using the master for wargus and 3.3.2 for stratagus.

etm commented 3 months ago

You are right. Sadly i am not successful in compiling stratagus HEAD, i currently fail in editloop.cpp because guichan version seems different on fedora (and im am not sure what i need, vendored_guichan() cmake function is missing from my cmake and i am not sure how to get it).

I had some success with the 3.3.2 version, but there is a consistent crash when clicking on victory in level 4 horde (ToD). I can provide the savegame 1 second before victory in a different issue, but as i said its from an old version.

Jarod42 commented 3 months ago

Make sure you have (git) submodule updated, i.e stratagus\third-party should not be empty, and should also contains guichan directory.

etm commented 3 months ago

@Jarod42: yes i missed the submodule. With submodule guichan errors go away. It compiles till end. But then during linking:

/usr/bin/ld: libstrataguslib.a(interface.cpp.o): in function `HandleCommandKey(int)': /home/mangler/Projects//stratagus/src/ui/interface.cpp:533:(.text+0x22f1): undefined reference to `lua_getglobal'.

I assume the problem is that I have no lua 5.1 (although if have compat-lua-* for fedora which contains 5.1 things. Manually linking to -llua-5.4 (against better judgement) of course produces a thing which immediatly segfaults. hmmm.

Jarod42 commented 3 months ago

Try to set BUILD_VENDORED_LUA option to ON (CMake) to use provided version instead of system one...

etm commented 3 months ago

Thanks, that was it. It works together with wargus appimage. I will try to compile wargus next.