Skip to content

Gnoll Release v1.14.0 - Lua Integration

Compare
Choose a tag to compare
@Nefaro Nefaro released this 29 Aug 21:42
· 26 commits to master since this release

This release is a bit bigger this time and focuses on one topic, as the title says: Gnoll now introduces Lua integration into modded Gnomoria. As of right now it offers pretty much the same capabilities as the native .xml, except for anything related to sprites. However, different from the .xml variant, Lua allows to change the value while the game is running.
There is a short guide in the wiki: Lua Integration
Also there are some examples among the mods: ExpLuaIntegration ModInit.lua and LuaSupport/GnollLuaValidationScript.lua.

This is the first integration pass, as hinted at, currently we can only modify the initial data (or the definitions) of the game. Since it's quite a bit of work to integrate the code and I am running out of time (for this development cycle that is) I decided to release whatever I have.
There is still a lot to do, including introducing more events that can be hooked at from Lua and adding support for in-game objects and entities during the gameplay.

The integration is provided by Moonsharp

Note: By default Lua support is disabled. To enable Lua support, enable the aptly named "LuaSupport" mod within the game. If you also enable the example mod ExpLuaIntegration, you will have the example Lua code randomise the value of different wood materials.

Gnoll Patch 1.14

  • Added a few hooks on strategic location to intercept the moments, where the game has loaded all the data and is ready to play. As in, the last moment to do things before the player gets the control.

Gnoll ModLoader for patch 1.14

  • Cleaned up the versioning, removed the "G" prefix. It had a meaning a long time ago, but not anymore. Additionally now the whole Gnoll version fits into the version lable on the main page
  • Introduced Lua Integration support, it's baked into the mod loader and can be enabled/disabled by enabling/disabling "LuaSupport" mod.
  • Added functionality to save and load Gnoll specific savegame companion file. Previously I "hacked" the Gnomoria save games to add few pieces of data (vanilla Gnomoria just ignored the info, so this didn't break anything), but with Lua introduction needed a more flexible/powerful way to save (more) data. The Gnoll save file will be besides the proper save file at the Gnomoria userdata folder: ie "/My Games/Gnomoria/Gnoll/Worlds"
  • Unified the logging facility, Gnoll modloader, mods and Lua can now use their own logger and it all will end up in the same log, currently only the debug console.

Gnoll Mods for patch 1.14

  • LuaSupport - Mod for toggling Lua integration on and off. Disabled by default. Also includes some Lua enum-like definitions that can be used in Lua scripts. Also includes GnollLuaValidationScript.lua, which validates the integration by going through almost all the mappings and making sure the mappings are correct and work
  • ExpLuaIntegration - A mod to showcase Lua integration. Disabled by default. When enabled, on a new game start it will randomize the value of "wood" material. By default the value is 1, the script randomizes the value between 1~10, making some wood more valuable. Additionally showcases how to use the Lua integration, to access various stuff and to save/load the Gnoll companion savefile.

Gnoll Installer v1.14

  • Support for new version and an additionaly dependency (Moonsharp)