WeaponProfile ​
Inherits: DatabaseResource < Resource
A Weapon Animation Profile: one way of fighting that your game has animations for (One Hand, Two Hand, Bow, Rifle, Unarmed ...). You define it once (Entity Assets > Weapon Profiles) and every animation pack gets its folder weapon_animations/<folder name>/ with a subfolder for each animation role: attack, stance (the combat idle), block, dodge, hit, sheathe, unsheathe, and for a ranged profile aim and reload; a profile with hand variants has attack_left too. The packs that already exist get the folders when you save the profile, and the packs you make afterwards get them with the rest of their folders. A weapon class (and an NPC) picks a profile; the animations of the equipped weapon are then the clips in its folders. Unarmed is built in and cannot be deleted. See docs: Entity Assets > Weapon Profiles.
Properties ​
String | folder_name | "" |
bool | hand_variants | false |
bool | ranged | false |
bool | built_in | false |
Methods ​
PackedStringArray | get_roles() |
String | describe_role( role: String ) static |
PackedStringArray | get_required_roles() |
PackedStringArray | get_folder_paths() |
String | make_folder_name( text: String ) static |
bool | is_valid_folder_name( text: String ) static |
WeaponProfile | build_unarmed() static |
PackedStringArray | validate() |
Constants ​
intID_UNARMED =1000001- The id of the built-in Unarmed profileStringUNARMED_FOLDER ="unarmed"- The folder name of the built-in Unarmed profileStringROLE_ATTACK ="attack"- The roles (the subfolders of the profile folder) and what they are forStringROLE_ATTACK_LEFT ="attack_left"StringROLE_STANCE ="stance"StringROLE_BLOCK ="block"StringROLE_DODGE ="dodge"StringROLE_HIT ="hit"StringROLE_SHEATHE ="sheathe"StringROLE_UNSHEATHE ="unsheathe"StringROLE_AIM ="aim"StringROLE_RELOAD ="reload"
Property descriptions ​
String folder_name = "" ​
The name of the folder of this profile in every animation pack (made when the profile is made; it never changes, so the files stay where they are when the profile is renamed)
bool hand_variants = false ​
Does a one handed weapon of this profile have different attack clips for the left hand (a folder attack_left)? With none in it the right hand clips play for both
bool ranged = false ​
Is it a ranged weapon (a bow, a gun)? A ranged profile has aim and reload folders
bool built_in = false ​
Is it built in (Unarmed)? It cannot be deleted
Method descriptions ​
PackedStringArray get_roles() ​
The folders (roles) of this profile: attack, attack_left (hand variants), stance, block, aim and reload (ranged)
String describe_role( role: String ) ​
What a role is for, in a sentence (the tooltips and the report of the editor)
PackedStringArray get_required_roles() ​
The roles a profile should have clips for (the others are optional): the report of the editor is orange when one of these is empty
PackedStringArray get_folder_paths() ​
The folders of this profile relative to the entity folder of a pack ("weapon_animations/one_hand/attack" ...)
String make_folder_name( text: String ) ​
A folder name made from a name: lower case letters, digits and underscores ("One Hand!" -> "one_hand")
bool is_valid_folder_name( text: String ) ​
Can this text be the folder name of a profile?
WeaponProfile build_unarmed() ​
The built-in Unarmed profile
PackedStringArray validate() ​
Warnings about the profile (empty when it is fine)