/longvinter-modding

longvinter modding source code

Primary LanguageCOtherNOASSERTION

Longvinter Modding Guide

For assistance and discussions, visit the 🔧-modding channel on the official Longvinter Discord.

Table of contents

  1. Setup
  2. Creating a mod
    1. Item Data Holder
    2. Placeable
    3. Weapon
  3. Packaging
  4. Testing
  5. Steam Workshop

Setup

  1. Download Unreal Engine 4.26 source build
  2. Build the engine from the source
  3. Add a new directory called Projects/ to the UE4Games.uprojectdirs file located in the Unreal Engine root folder
    image
  4. Download this repository and place it inside UE/Projects/ (Create the folder if it does not exist yet)
  5. Run the GenerateProjectFiles.bat in your UE4 root directory
  6. Open the UE4.sln
  7. Build the Longvinter project in the Development Editor configuration
    image
    image
  8. Verify that the build scripts are listed in the Programs/Automation directory
    image
  9. Open Properties for SimpleUGC.Automation and choose the Build tab on the left. Set the Output Path to your source build's Engine\Binaries\DotNET\AutomationScripts\ directory for both Development and Debug Configurations image
  10. Build the AutomationTool project in the Development config
  11. Right click the Longvinter project and click Set as Startup Project
    image
  12. Run the Longvinter project in Development Editor config
    image

More info about the SimpleUGC plugin and how to build/use it can be found here

Creating a Mod

  1. Open the Longvinter modding project
  2. Go to FileCreate UGC
  3. Fill in the Name, Author and Description and press Create Mod
  4. You should now have a new empty folder in the content browser

Adding a new Item Data Holder

The Item Data Holder has a list of every single item in the game
Making a custom Item Data Holder allows you to add new items and replace existing ones

Right click in the empty mod folder and click Blueprint Class

image

Select A_ItemDataHolder under the All Classes and add it to the mod

image

Now add a Replacement Actor Component to the new Item Data Holder so that it can replace the one already in the game

Open the Item Data Holder and press Add ComponentReplacement Actor

image

Click on the just added Replacement Actor and go to the details panel
Under there you should see Simple UGCActor Replacement

Add A_ItemDataHolder to the Actor Classes to replace list

image

Lastly make sure that Show Inherited Variables is checked

image

Adding a new Placeable

Start by right clicking on the mod folder again and adding a A_Placeable from the Blueprint Classes

image

Open the new placeable and customize it to your liking
You can for example change the model

image
image
image

To change the default values select the root placeable

image

If you want to edit the placement collision for example, you will need to check the Make Custom Collision Check box

image

After you are done with the placeable then it's time to add it to the Item Data Holder that we added earlier

Go to the Item Data Holder and select the AdditionalItems variable

image

Now in the details panel you can add a new item under the Default Value section

In this example I am changing the following:

  1. Name
  2. Texture which is the icon that shows in the inventory
  3. Category which is placeable in this case
  4. SpawnedPlaceableReference which is the actual placeable actor that we created

image

Adding a new Weapon

Start by going to your Item Data Holder and clicking the AdditionalItems variable

image

Add a new element to the array and change the values to your liking

image

To make a weapon you will need the following

  1. Wearable set to true
  2. Weapon set to true
  3. Slot set to 2
  4. Category set to Equipment

Inside WeaponStats you will find all weapon related values like the damage and fire rate

image

Packaging the mod

Before the mod can be loaded in the shipping verion of the game it needs to be packaged
Test your mod before packaging by clicking the play in editor button

image

To package your game just press FilePackage UGC

image

After the engine is done packaging you should get a packaged .zip file of the mod

image

Testing the mod

Extract the .zip file to \Longvinter\SteamMods\<mod_name>
Make sure that the <mod_name> folder is named the same as the .uplugin file you just extracted
If you are missing the SteamMods folder then run the MakeSymbolicLink.bat in the game folder as adminstrator

You should now have something like this
F:\SteamLibrary\steamapps\common\Longvinter\Longvinter\SteamMods\test
image

The last step is to run the CopyMods.bat in the game folder as adminstrator
This should copy your files from the SteamMods folder to the Mods folder in a correct format

Now you can simply start your game from steam and go to the host server tab to test

Uploading to the Steam Workshop

Uploading to the workshop is done through the workshop upload tool in game
You can find the upload tool on the mods page in the settings

image

Now just fill in the information and copy paste the Mod folder path
For the Preview image make sure that the image is less than 1MB in size and in a square format
The usual display size in the Steam Workshop is 200×200 pixels

image

After clicking the upload button the Mod will start uploading
If the mod upload was successful you should get OK and the window should close
If you get LimitExceeded it means that your preview image is too large

You can find the files to the unpackaged mod created in this guide on the Steam Workshop.