Creating a custom weapon?

  • How exactly do you go about coding one? :concern:

  • I made a mod template that you can use.

    Extract the “TEMPLATE” folder to Development/Src folder inside your chivalry’s installation folder. Rename the TEMPLATE folder to your desired Mod Name. You can’t use spaces in the name, and it should ideally be a short and unique name that won’t conflict with anything. (e.g., “PebbleMod”)

    To get it working, you first have to rename all files, replacing the “template” word with the chosen mod name. I’ve included a .bat file that you can use to batch rename: Edit the .bat file with notepad and replace MODNAME with your mod’s name. Then put copies of the bat file on the folders your .uc and .uci files are located. Now just run the bat files and the files will be renamed automagically. You have to rename the DefalutTEMPLATE.ini and TEMPLATE.INT files too, but you can do that manually easily.

    After that you need to replace the word “TEMPLATE” with your your mod’s name INSIDE the files. To do that I use Notepad++ “find in files” function. Download Notepad++, click on the binoculars icon, click on the “Find in Files” tab, SELECT THE CORRECT DIRECTORY and then just use the “Replace In Files” function. (the correct directory is your mod’s folder, the folder that was originally called “TEMPLATE”)

    After you have everything renamed, open the FamilyInfo .uc files and put your custom weapons inside the default properties. I’ve replaced the Vanguard’s Greatsword with a Custom Greatsword that deals only 1 damage. Take a look at the Vanguard FamilyInfo classes to see how it was done. Also look at CustomGreatsword Weapon and WeaponAttachment Classes to see how the weapon was modded (Those classes are named TEMPLATEWeapon_CustomGreatsword.uc and TEMPLATEWeaponAttachment_CustomGreatsword.uc, respectively).

    For further instructions on how to build your scripts and how to run the game with you mod, read Torn Banner’s SDK Wiki:

  • EDIT. It’s fixed now.

  • I’ve updated the Mod Template download link and the instructions. It should work now.

Log in to reply