Skip to content

Projectiles & Clips

Benjamin Amos edited this page Mar 6, 2022 · 7 revisions

Projectile

A projectile is a bullet that a gun fires. To add new projectiles to a module you need to add a projectile configuration file to your module's configs.

A projectile consists of 2 parts:

  • A texture of the projectile in assets/textures/projectiles/
  • A clip that is actually attached to the gun to fire the projectile.

The properties of projectile must be defined in /configs/projectilesConfig.json . These include:

  • Damage - dmg
  • Damage Type - dmgType
  • Speed of the projectile - speed
  • Texture - tex
  • Size of the texture (scale) - texSz
  • The collision effect settings (the glowing animation for gun fire) collisionEffect
    • The effect file - explFire
    • Size - size
    • Texture for the collision effect - tex
    • Tint for the effect - tint
  • The sound for the firing effect - collisionSound

For more properties, see this schema.

An example of the config from the caution module:

{
    "rbc": {
        "dmg": 3,
        "dmgType": "energy",
        "speed": 6,
        "tex": "caution:rbc",
        "texSz": 0.15,
        "collisionEffect": {
            "effectFile": "core:explFire",
            "size": 0.1,
            "tex": "core:fire",
            "tint": "220 0 0"
        },
        "collisionSound": "core:blastCollision"
    }
}

Clips

A clip is the ammo used by a gun. Each clip is associated with a projectile. Clips are stored in the /items/clips/ directory.

A clip consists of 2 parts:

  • A configuration file
  • An icon that is displayed in stats when the clip is in use.

The properties of a clip must be defined in the configuration file in its own directory. These include:

  • The projectile that the clip stores - projectile
  • The capacity of the clip - size
  • Price - price
  • Name of the icon for the clip - iconName
  • Name displayed in-game - displayName
  • Plural word for projectiles - plural

An example of the config from the caution module:

{
    "projectile": "rbc",
    "size": 30,
    "price": 20,
    "iconName": "rbcClip",
    "displayName": "Red Blood Cell",
    "plural": "cells"
}