Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

ManuelBlanc/NecroLua

Repository files navigation

Full Lua modding support was officially added in Crypt of the NecroDancer: Synchrony, rendering this project obsolete. To mod CotND, please see: https://vortexbuffer.com/synchrony/docs/


NecroLua

NecroLua

NecroLua adds modding capabilities to Crypt of the NecroDancer via LuaJIT.

Installation and usage

  1. Download the latest release (or build it from the source).
  2. Extract the zip in the same directory as the NecroDancer.exe executable. E.g.,
C:\Program Files (x86)\Steam\steamapps\common\Crypt of the NecroDancer
  1. Create a test mod
  2. Run the NecroLua.exe executable to launch the game with mods.
  3. Enjoy!
  4. If you have a question, feature request or bug report, please open an issue.

Making mods

Check the wiki documentation for more information on the modding API.

Building from source

  1. First, install the following software packages:
  • Microsoft command line build tools (MSVC v142 - VS 2019 C++ x64/86 build tools)
    • Make sure to use the x86 (32-bit) tools since NecroDancer.exe is a 32-bit executable
  • LuaJIT 2.1.0-beta3
    • Use luajit's included src/msvcbuild.bat instead of running the makefile
  • Microsoft Research Detours Package
    • If you run into issues, try installing the ".NET desktop development tools" through the Visual Studio Installer
  • DbgHelp.dll – Windows Image Helper (included with Windows)
  • ImageMagick (Optional, used to make the app icon)
  1. After installing the above packages, go to your NecroLua directory and create an include subdirectory and a lib subdirectory, and copy in the required headers and library files; the following files should be present:
$ ls lib/ include/
include/:
detours.h  lauxlib.h  lua.h  luaconf.h  luajit.h  lualib.h

lib/:
detours.lib  lua51.lib
  1. nmake all

  2. Copy the following files to the same directory as the NecroDancer.exe executable:

  • NecroLua.exe
  • NecroLuaAPI.dll
  • lua51.dll
  • steam_appid.txt
  1. Continue following the install instructions

Example mod

Set up the following directory structure:

Crypt of the NecroDancer
|-- NecroDancer.exe
|-- ...
|-- <other files and directories>
|-- ...
`-- mods
    `-- example-mod
        `-- lua
            `-- init.lua

init.lua should have the following contents:

print ""
print "loading lua mod"
print ""

necrolua.hook("c_Player::p_GetElectricStrength", function(func, self)
  return 1 - func(self)
end)

This mod will make invert your character's electricity; e.g. you will do arcing electric attacks when you're not on the zone 5 wire.

Contributors

Special thanks to IamLupo and Adikso.

License

Copyright (C) 2019 ManuelBlanc

This is free software, and you are welcome to redistribute it under certain conditions. See Copyright Notice in LICENSE.txt for details.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Releases

No releases published

Packages

No packages published