Creating your mod
Creating a Lua mod is the easiest of all other modding methods and requires pretty much no set up. That being said, it's heavily recommended to use a code editor just to make the process of development easier.
I recommend using Visual Studio (or it's sibling VSCodium) and the Lua extension by Tencent or sumneko. The extension by Tencent is older, but is faster and has less bugs, while the sumneko one is more up to date.
Where to create your script
To find the correct location for youur script, you will need to find the location of your installation's mod or Mods folder. Follow the following directions based on your modding installation.
- In a mod manager
- In a manual installation
Go into your mod manager's settings, and search for the button "Browse profile folder". This will open a folder in your file explorer, and from there navigate into the shimloader folder, and into the mod folder.
Go to the location of your download of VotV, then navigate to the /VotV/Binaries/Win64/ue4ss/Mods directory.
Creating your mod's folder
Once you are in your mod folder, you will see some other files and folders such as "BPML_GenericFunctions". Create a new folder and give it the name of your mod.
Once you have done that, enter that folder and create a folder named scripts, and inside that folder create a new file called main.lua. This is your mod's script!
Finally, to enable your mod, you can either:
- (Recommended) Create a blank
enabled.txtfile in your mod folder (alongside yourscriptsfolder). This force-enables the mod. - Add a line of text like
<My modname> : 1to themods.txtfile in the base mod folder. Make sure to place your text before thekeybinds : 1line.
📂 mod/Mods
📁 MyExampleMod
📁 scripts
📄 main.lua
📄 enabled.txt
Next steps
Now that you have your script file, you can start programming your mod. Open it up in your editor and you're ready to start programming. To run your mod, all you have to do is run the game and the script should run automatically.
I heavily recommend checking out UE4SS's lua modding docs for some extra insight on the API, and also check out the Palworld modding wiki for more examples and in-depth guides on Lua usage.
Final Notes
Theres some notable differences and quirks in behaviors that its nice to be aware of:
- UE4SS provides a bunch of new functions that are available for you to use.
- You can use UE4SS's console GUI to reload mods, allowing you to edit your code and re-run them without having to close and reopen the game.