If you want to help us maintaining this wiki, check out or discord server: https://discord.gg/3u69jMa 

Creating a weapon, ammo, projectile, attachment, and pickup class

From SWRC Wiki
Jump to: navigation, search

This tutorial doesn't require that you have made a custom HudArms, because you can also use stock HudArms the same way. Topic covered include creating weapon, ammo, attachment, and pickup actor classes so that you can bring functionality to your weapon.

First of all, choose a stock weapon that will have similar stats (such as firerate, damage) to the weapon you wish to create. (I will be using the DC17m.)

Using the actor classes browser (making sure that "Placeable classes only?" is unchecked), navigate to Inventory > Weapon > [StockWeaponOfChoice]

Right-click the weapon and select "New".


I will leave the Package at Properties and I will name the weapon CloneBlasterWeapon, but you can set these to whatever you want.

A window will show up with the weapon's properties. Most are inherited from the stock weapon, but the ones in bold have been changed. To see the original values, simply double-click the stock weapon in the browser.

Most of the properties will be covered in a tutorial about editing stock weapons, but some values need to be edited specifically for stock weapons. Here are the items you need to change:

--DisplayAdvanced > Mesh needs to be set to your custom animation if you have one. (Use the same method as static meshes: find the animation in the animation tab and click "Use" on the property.)

--Hidden > AmmoName needs to be set to your custom ammo, which you haven't created yet, so don't worry about this right now.

--Hidden > AttachmentClass needs to be set to your custom attachment, which you also haven't created yet.

--Hidden > MuzzleClass need to be set to none if you made a custom weapon animation, as you have already made one in the animation editor.

--Inventory > DroppedPickupClass & PickupClass needs to be set to your pickup class, which you haven't created yet.

Make a new class for your ammo in Inventory > Ammunition > [StockWeaponOfChoice]. I will call mine CloneBlasterAmmo.

The only property you need to change in the ammo class is Hidden > ProjectileClass. Later, set this value to the projectile class you make.

Make sure that you set the AmmoName in your weapon to your newly created ammo.

Make a new projectile class in Projectile > [StockWeaponOfChoice]. Note that some weapons are in sub classes of projectile. I will name it CloneBlasterProjectile.

Be sure to set the ProjectileClass in the ammo to this new projectile class!

Make a new attachment class in InventoryAttachment > WeaponAttachment > [StockWeaponOfChoice]. Set DisplayAdvanced > StaticMesh to your weapon's static mesh using the browser and the "Use" button. Make sure that DisplayAdvanced > DrawType is set to DT_StaticMesh.

Make sure to set the attachment class in your weapon to this.

Make a new pickup class in Pickup > CTPickup > [StockWeaponOfChoice]. Set DisplayAdvanced > StaticMesh to your weapon's static mesh using the browser and the "Use" button. Make sure that DisplayAdvanced > DrawType is set to DT_StaticMesh. Set Pickup > InventoryType to your weapon.

Be sure to set the pickup classes in you weapon to this.

Save, but remember that the weapon will not be the exact weapon you want until you assign stat values in the article on editing stock weapons.

To place the pickup in a level, make sure it is selected. In the level, right-click and you will see an option to place the pickup.