• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

How to make a weapon for RO2 & RS

Here's a link to your setup for your weapon:
https://www.dropbox.com/sh/78073m99fllm9eq/AABCJyHyUXRo_cpneDZa73M8a?dl=0
This has all the classes you'll need pre-made to be edited for your weapon.
1.
Now let's set up our mutator.
Let's add it to:
C:\Users\Name\Documents\My Games\RedOrchestra2\ROGame\Src
VNx6eXk.png

2.
Let's now examine the files we have, We 8 files in total, two for testing the weapon in game, and 6 for the weapon itself.
So what does each of them do?
8Hhdibf.png

Let's start from the bottom.

MyNewWeaponBullet: this is our bullet's properties

ROAmmo_MyNewWeaponMag: This tells the weapon what properties it's ammo has.

RODmgType_MyNewWeaponBullet: This tells us what happens when a player is hit from our weapon

ROWeap_MyNewWeapon: This is our weapon class itself, it tells us what fire modes it has, recoil, accuracy, animations, all of that stuff that is very important for the weapon to function.

ROWeap_MyNewWeaponContent: This tells us what Static meshes, skeletal meshes, animation trees we use for your weapon

ROWeapAttach_MyNewWeapon: This class is for the third person skeletal mesh.

And those are all our key classes for a new weapon.
The final two classes are for testing our weapon with a role. We'll get to this later.
I've left notes inside the .uc files for you to look at, they'll tell you what specific things are, and what they do. You should have no problem figuring this out now.
3.
Now let's set up our compiler.
Now some of you might be wondering "What the **** is a compiler?!" Well a compiler is a program that literally compiles code, or rather combines it into something that can be used.
Now this is how we'll create a compiler.

We'll create a Cmd.exe shortcut, you can put this anywhere for example, I'll make mine on my desktop.
We'll want to add this to the Cmd.exe's properties:
Target: C:/Windows/System32/cmd.exe
Start In: "C:/Program Files (x86)/Steam/SteamApps/common/Red Orchestra 2/Binaries/Win64"

Now we have one more step before we can compile that code.
Open ROEditor.ini found in C:/Users/*USER*/Documents/My Games/RedOrchestra2/ROGame/Config/
Find "[ModPackages]" and add a line at the bottom of this section containing the following:
ModPackages=MyMutator

Open the shortcut. A CMD command prompt will open.
Input the following and hit enter: rogame make
This will compile your .uc source code files into a .u mutator file.
The .u file will be dumped in: Documents/My Games/RedOrchestra2/ROGame/Unpublished/CookedPC/Script

Brew your mutator
Make sure that your .u file is in /Documents/My Games/RedOrchestra2/ROGame/Unpublished/CookedPC/Script
Open the shortcut. Input the following: rogame brewcontent MyMutator
This will brew your unbrewed .u file into a brewed .u file.
The brewed .u file will be dumped in: /Documents/My Games/RedOrchestra2/ROGame/Published/CookedPC

~TBC~
 
Last edited: