10 Attachment Parameters
Fesiug edited this page 2022-01-04 05:45:25 -05:00

These can be found in lua/arccw/shared/attachments/default.lua
Many of these can be used in the weapon script itself, especially hooks
99.99% of all ArcCW hooks have wep as their first parameter.


PrintName

string
Long name of the attachment used in the spawnmenu and in the Customization UI preview.

AbbrevName

string
Abbreviated short name used in the Customization UI attachment selection list.

Icon

IMaterial
Icon used in the spawnmenu and Customization UI.

Description

string
Description of attachment used in the Customization UI.

Desc_Pros

table
List of positives used in the Customization UI.
EX:

att.Desc_Pros = {
    "This describes a positive of the attachment"
}

Desc_Cons

table
List of negatives used in the Customization UI.
EX:

att.Desc_Cons = {
    "This describes a negative of the attachment"
}

Desc_Neutrals

table
List of neutral information used in the Customization UI.
EX:

att.Desc_Neutrals = {
    "This describes something neutral about the attachment or some controls"
}

Slot

table OR string
List or string used to dictate what slots this attachment can go on to.
EX:

att.Slot = "optic"
att.Slot = {"optic_sniper", "optic"}

Spawnable

boolean
Generate an entity for this attachment.

AdminOnly

boolean
Whether only administrators should be allowed to spawn and attach this attachment.

Ignore

boolean
Whether ArcCW should invalidate this attachment's existance.

InvAtt

string
If set to another attachment, owning this will own that one as well.

Free

boolean Whether this attachment is always available to anyone regardless of them owning it.

IgnorePickX

boolean
Should Pick X ignore this attachment and not increment the counter?

Hidden

boolean Whether this attachment is invisible to the UI.

HideIfBlocked

boolean
If the attachment cannot be attached due to flag restrictions, it is invisible to the UI.

HideIfUnavailable

boolean
If the attachment isn't owned, it is invisible to the UI.

NoRandom

boolean Whether the attachment should be disallowed to be attached through a random roll.

RandomWeight

number
Random rolling weight. Defaults to 1. To avoid issues, it should be an integer.

NotForNPCs

boolean
NPCs will not randomly spawn with this weapon or attachment.

AddPrefix

string
Adds a prefix to the weapon name.

AddSuffix

string
Adds a suffix to the weapon name.

ToggleStats

table
A very powerful system to allow changing of stats by the player.
EX:

NO EXAMPLE YET!
NO EXAMPLE YET!
NO EXAMPLE YET!
NO EXAMPLE YET!
NO EXAMPLE YET!
NO EXAMPLE YET!

KeepBaseIrons

boolean
Whether this optic should keep the original ironsight position intact.

BaseIronsFirst

boolean
Whether the original ironsights should the first one used.

GivesFlags

table
Flags to give when this attachment is installed.

RequireFlags

table
Flags to require for this attachment to be installed.

ExcludeFlags

table
Flags that will not allow this attachment to be installed.

Hook_ExtraFlags

function
Parameters are wep, data
data is a table
I'm not sure.
Any strings present in data will be added to the weapon's flags.

SubSlots

table A very powerful system to allow additional slots to be added to the weapon.
UNFINISHED. DO NOT USE.

Max

number
Defines how many of these attachments are allowed to be installed on this weapon.

Model

string
Model to use to represent this attachment.

HideModel

boolean
Don't draw the model.

ModelBodygroups

string
String of bodygroups that should be toggled on the model. EX:

att.ModelBodygroups = "01120000"

ModelSkin

number
The skin that should be used on this model.

ModelScale

Vector
Scale applied to the model.

ModelOffset

Vector
Offset applied to the model.

OffsetAng

Angle
Angle offset applied to the model.

ModelIsShield

boolean
Whether the model should have a collision model.

ShieldResistance

number
How much penetration an ArcCW weapon should have to shoot through this shield.

ShieldBone

string
Which bone the shield model should be attached to.

Charm

boolean
Whether this attachment should be a charm.

CharmBone

string
Not 100% sure.

CharmModel

string
Model to use for the charm.

CharmOffset

Vector
Offset applied to the charm.

CharmScale

Vector
Scale applied to the charm.

CharmSkin

number
Skin used on the charm model.

CharmBodygroups

string
Bodygroups used on the charm model.

Health

number
Health used for breakable attachments.

ShieldCorrectPos

Vector
Offset applied to the shield collision model.

ShieldCorrectAng

Angle
Angle to apply to the shield collision model.

DamageOnShoot

number
Damage to apply to the attachment on weapon fire.

DamageOnReload

number
Damage to apply to the attachment when the weapon is reloaded.

DamagePerSecond

number
Damage to apply every second to the attachment.

DrawFunc

function
Parameters are wep, element, wm
element is a ??? Entity maybe ???
wm is a ??? Entity maybe ???