Making your first scripted mod: High Ranked Chaos Armies
Posted: 28 Jun 2023, 16:05
Never done coding before? Completely confused by functions, listeners, variables? What even are functions? The hell is Lua?
Then this tutorial is for you. The only things that will be assumed are:
1. That you've downloaded Rusted Pack File Manager and followed the instructions on setting that up.
2. Same for Visual Studio Code
That's it. I will make a post detailing the setup of those two tools at a later date. For now, let's get the interesting stuff noted down.
The general process is:

First, we need to create a .pack file. This file is the container for all of your mod's data, and is what will be uploaded to the Steam Workshop once the mod is finished. To do this, navigate to: File -> New Packfile. This will create a blank .pack file called unknown.pack.

Next, right-click on unknown.pack -> Create -> Folder -> script -> New Folder


Repeat the above process, to create the following folder path: script\campaign\mod

Right-click on the folder mod -> Create -> Create Text -> Name the script whatever you want. For this tutorial we'll give it some generic name, but you should name it something unique. For the original mod that I made, I called it fyty_high_ranked_chaos_armies.lua. Then click Ok to create the .lua file.


Now click on the .lua file we created, and RPFM should now look like this, if you did things properly:

Then this tutorial is for you. The only things that will be assumed are:
1. That you've downloaded Rusted Pack File Manager and followed the instructions on setting that up.
2. Same for Visual Studio Code
That's it. I will make a post detailing the setup of those two tools at a later date. For now, let's get the interesting stuff noted down.
The general process is:
- Create a .pack file
Create the standard folder path so our script will be loaded for all campaigns
Create a uniquely named .lua file in that folder
Create & Add the lua code to it

First, we need to create a .pack file. This file is the container for all of your mod's data, and is what will be uploaded to the Steam Workshop once the mod is finished. To do this, navigate to: File -> New Packfile. This will create a blank .pack file called unknown.pack.

Next, right-click on unknown.pack -> Create -> Folder -> script -> New Folder


Repeat the above process, to create the following folder path: script\campaign\mod

Right-click on the folder mod -> Create -> Create Text -> Name the script whatever you want. For this tutorial we'll give it some generic name, but you should name it something unique. For the original mod that I made, I called it fyty_high_ranked_chaos_armies.lua. Then click Ok to create the .lua file.


Now click on the .lua file we created, and RPFM should now look like this, if you did things properly:
