Your First Weapon - HaodongMo/ARC-9 GitHub Wiki

Creating a weapon is simple. A basic template can be found at arc9_base/shared.lua, which contains all the basic stat parameters you can use in a weapon. Simply copy the ones you want to use into your own weapon file, remembering to add SWEP.Base = "arc9_base" to it somewhere as well, and set SWEP.Spawnable = true. Then, you can simply set SWEP.ViewModel to your desired viewmodel.

Due to the TPIK/MirrorVMWM system ARC9 makes use of, it does not support viewmodels that are not compatible with the Garry's Mod c_hands system. You should be using this system anyway.

Your weapon will probably not work immediately out of the gate. The reason for this is that all ARC9 weapons require an Animation table to be properly set up. This adds a small amount of extra development effort, but provides a massive amount of versatility for developers to remap animations.

A template Animation table can be found near the bottom of shared.lua, as well as a list of all compatible animations.

At minimum, you must define the following animations:

  • fire
  • draw
  • holster (If your model doesn't have a holster animation, you can use draw with Reverse = true set on the animation entry.)
  • reload
  • idle
  • reload_start (For shotgun reload weapons)
  • reload_insert (For shotgun reload weapons)
  • reload_finish (For shotgun reload weapons)
  • reload_ubgl (For weapons with an integral UBGL)

At minimum, an Animation table entry must contain a Source, which can be a string or a {"table", "of", "strings"}. For other available parameters, see shared.lua.