Skip to content

Songs of Syx example mod with an automated maven build pipeline

License

Notifications You must be signed in to change notification settings

4rg0n/songs-of-syx-mod-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

For V67

This project is intended for people who want to start modding for the game Songs of Syx. It contains a random weather eclipse event, which changes the light color. The maven build pipeline will take care of compiling, packaging and installing the mod into the games mod folder.

You will need a Java 1.8 JDK for developing. There are also some tips for developing a mod.

Prerequisite

⚠️ Game installation and mod directory paths are configured in the pom.xml in <profiles> and are default set to:

Game Installation

  • Windows: C:\Program Files (x86)\Steam\steamapps\common\Songs of Syx
  • Linux: ~/.steam/steam/steamapps/common/Songs of Syx

Mod Directory

  • Windows: ${user.home}/AppData/Roaming/songsofsyx/mods/
  • Linux: ~/.local/share/songsofsyx/mods/

Mod Uploader

  • Windows: ${user.home}/AppData/Roaming/songsofsyx/mods-uploader/
  • Linux: ~/.local/share/songsofsyx/mods-uploader/

⚠️ You may have to adjust these paths accordingly.

Setup for Intellij IDEA

Setup Intellij IDEA

Getting started

Maven is required to compile, package and install the mod. When using Intellij IDEA, Maven is already bundled within.

1️⃣ Install games jar file as local maven dependency by copying it from the game installation folder.

mvn validate 

ℹ️ You only have to run validate once (or when the games got an update you need)

2️⃣ Compile mod source; prepare mod file structure; copy mod files to game mod directory

mvn install 

3️⃣ Run the game, and you should see a Example Mod mod. Activate it and launch.

Run the game from within your IDE (Intellij IDEA)

There are 3 different "Run Configurations" in the .run folder:

  • DEBUG for running the game with debug capabilities via the little green bug icon
  • Main for running the game and skipping the launcher
  • MainLaunchLauncher for running the game with launcher

You may have to edit the game installation paths in these files. Intellij should automatically recognize these files and add them to your "Run Configuration" selection. It is usually found in the upper right hand corner. You can select the via the dropdown menu and run them with the play icon. The green bug icon will run the game with debug capabilities. This will only work with the DEBUG run configuration though.

Mod SDK

See Mod SDK Setup

Start making your own mod

See make your own mod.

Build commands

ℹ️ Installs only the games SongsOfSyx.jar and info/SongsOfSyx-sources.jar as a dependency, and validate whether it was successful.

mvn validate

⚠️ This is required or the project won't find the games code.

ℹ️ Building the mod only into target/out:

mvn package

The source code of the mod will be copied into e.g. target/out/songs-of-syx-mod-example/V63/script/_src.

ℹ️ Build and copy the output into the games mods folder (excluding _src):

mvn install

⚠️ The games mod folder location varies on each OS. There are maven profiles "windows" and "linux". The "windows" profile is the default. Maven should detect when you are building on a Linux OS and switch to the "linux" profile (not tested). You can force a profile with e.g.

mvn install -P linux

ℹ️ Deletes the target directory containing the packaged mod files and removes the mod from the games mod directory.

mvn clean

Mod Info / Build Settings

In the pom.xml you will find <properties> where you can change information about the mod. There you can also change the <game.version.major> property to your used game version. The <game.version.minor> property is only important when your mod really depends on stuff in this version and isn't compatible with lower versions.

Files (e.g. assets) for the mod are located in src/main/java/resources/mod-files and will be copied in the package phase.

Debugging

You can enable Debug Mode and Developer Mode in the game launcher settings. You will get more detailed logs and in-game developer tools for testing.

Eclipse

  • Add a new Run Configuration.
  • Set the main class name to init.MainLaunchLauncher.
  • In the tab Arguments set the working directory to your game installation folder e.g. C:/Program Files (x86)/Steam/steamapps/common/Songs of Syx.

Testing

There's JUnit 5 with AssertJ and Mockito 4 for testing your code.

Developing Tips

See doc/index.md.

Publish your Mod

There's a maven profile mods-uploader you can use to automatically copy and clean your files into the mod uploader. The directory is configurable via the <game.mod.uploader.directory> property in the <profiles>. It's default set to:

  • Windows: ${user.home}/AppData/Roaming/songsofsyx/mods-uploader
  • Linux: ${user.home}/.local/share/songsofsyx/mods-uploader

Will copy the mod files into the Steam Workshop Uploader directory.

mvn install -P mods-uploader

Will remove the mod files from the mod uploader. For updating the mod files.

mvn clean -P mods-uploader

Steam

Modding Resources

DISCLAIMER

The source code of the "eclipse" example comes from the game files itself and were written by the game dev Jake de Laval. I've just build the maven tooling around it.

About

Songs of Syx example mod with an automated maven build pipeline

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages