Throwing weapons: projectiles

How to make a custom projectiles for throwing weapons

This page is a sub-page of Adding Weapons and tells you how to create a custom projectile for a throwing weapon.

To create a custom throwing weapon, check the parent guide and use knife as a base type.

Step 1: the yaml

Add the following lines to your yaml:

KnifeAttacks.MyKnifeThrowAttackProjectile:
  $type: Attack_Projectile
  projectileTemplateName: my_knife_projectile

Items.my_knife:
  $base: Items.Preset_Knife_Default
  appearanceResourceName: my_knife_appfile
  projectileTemplateName: my_knife_projectile
  attacks: [!append KnifeAttacks.MyKnifeThrowAttackProjectile]

Step 2: the entity

You can find all projectile entities in base\gameplay\projectiles\knife.

base\gameplay\projectiles\knife\tanto_projectile.ent is a root entity with associated .app file, while base\gameplay\projectiles\knife\knife_projectile.ent is a mesh entity with the component directly included.

Create a copy of the entity that you want, then connect it in your factory.

Step 3: The factory

Finally, hook everything up by registering the appearanceResourceName from your .yaml file in your factory.csv. As a reminder, this is the line we're talking about:

Items.my_knife:
  appearanceResourceName: my_knife_appfile

Make sure that the corresponding entry points at your projectile's entity file from step 3.

Step 4: The right mesh

In your entity or the linked .app file, make sure that you change all paths to the right mesh. (The mesh path is contained in resolvedDependencies and inplaceResources as well. TODO: Check if this is really necessary, then update the guide or tell mana, who couldn't be arsed to check herself)

Step 5: Test

If you did everything correctly, you should now have a custom projectile for thrown weapons.

Last updated

#647: Add info on downloading Phantom Liberty DLC files for rollback

Change request updated