Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Hmmm....New crossbow weapon?  (Read 805 times)

Zambaku

  • Bay Watcher
    • View Profile
Hmmm....New crossbow weapon?
« on: January 15, 2010, 07:46:56 am »

A while ago I made a new type of crossbow weapon. A throwing glove with throwing axes. I have just started training a marksdwarf army of six and they all use regular crossbows. Will they choose the crossbows at random or do I need to do something more to the new weapon then to allow them to use it in the raws?
Logged

kobot

  • Bay Watcher
    • View Profile
Re: Hmmm....New crossbow weapon?
« Reply #1 on: January 15, 2010, 08:04:00 am »

i think it might be impossible to add new ammo types, and maybe new ranged weapons at all with in this version of DF

if you really want to implement your new weapon you can modify one of the existing ones,

for an instance if you changed the crossbow and bolts entry in the raws to somthing like
Spoiler (click to show/hide)
you would totally replace crossbows and bolts with pairs of stylish gloves and throwing axes but there's no way to mod them in in addition to the crossbow

but i'm no expert, this is just how I understand it after a bit of modding and lot of forum browsing, i welcome someone to correct me...
Logged

slink

  • Bay Watcher
  • Crazy Cat Dwarf
    • View Profile
    • Slink's Burrow Online
Re: Hmmm....New crossbow weapon?
« Reply #2 on: January 15, 2010, 09:59:01 am »

Theoretically, this is done by the following set of changes.

Define a new ammunition:

[ITEM_AMMO:ITEM_AMMO_SPEARS_CN]
[NAME:throwing spear:throwing spears]
[CLASS:THROWING_SPEARS_CN]
[DAMAGE:120:PIERCE]

Define a new weapon to use the ammunition.  It must use an existing weapon skill to link the weapon to the ammunition.  In this case, that skill is CROSSBOW.

[ITEM_WEAPON:ITEM_WEAPON_SPEAR_ARM_CN]
[NAME:spear-thrower:spear-throwers]
[DAMAGE:50:BLUDGEON]
[WEIGHT:15]
[SKILL:HAMMER]
[RANGED:CROSSBOW:THROWING_SPEARS_CN]
[TWO_HANDED:7]
[MINIMUM_SIZE:7]
[MATERIAL_SIZE:6]

Add the weapon and ammunition to the entity description.

   [WEAPON:ITEM_WEAPON_SPEAR_ARM_CN]
      [AMMO:ITEM_AMMO_THROWING_SPEARS_CN]

These examples come from the Catchyname mod.  There are many more examples in various mods, all done the same way.  I confess not to have tried any of these new weapons yet.

Edit: corrected an item name  ... twice
« Last Edit: January 15, 2010, 06:35:40 pm by slink »
Logged
There is only one cat, and all cats are that cat.
Almost losing is sometimes fun.

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Hmmm....New crossbow weapon?
« Reply #3 on: January 15, 2010, 06:11:27 pm »

That should work with one small change, change the [RANGED:CROSSBOW:THROWING_SPEARS_CN] to [RANGED:CROSSBOW:THROWING_SPEARS], and then they will choose at random between normal crossbows and those ones. This will require a regen, though.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

slink

  • Bay Watcher
  • Crazy Cat Dwarf
    • View Profile
    • Slink's Burrow Online
Re: Hmmm....New crossbow weapon?
« Reply #4 on: January 15, 2010, 06:23:57 pm »

Yep, I missed another "_CN".  Thank you.  :)
Logged
There is only one cat, and all cats are that cat.
Almost losing is sometimes fun.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: Hmmm....New crossbow weapon?
« Reply #5 on: January 15, 2010, 11:03:58 pm »

[ITEM_AMMO:ITEM_AMMO_THROW_AXES]
[NAME:throwing axe:throwing axes]
[CLASS:THROW_AXE]
[DAMAGE:150:SLASH]

[ITEM_AMMO:ITEM_AMMO_THROW_KNIVES]
[NAME:throwing knife:throwing knives]
[CLASS:THROW_KNIFE]
[DAMAGE:100:GORE]

[ITEM_WEAPON:ITEM_WEAPON_THROW_GLOVE_AXE]
[NAME:axe throwing glove:axe throwing gloves]
[DAMAGE:100:BLUDGEON]
[WEIGHT:30]
[RANGED:AXE:THROW_AXE]
[SKILL:UNARMED]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:1]

[ITEM_WEAPON:ITEM_WEAPON_THROW_GLOVE_KNIFE]
[NAME:knife throwing glove:knife throwing gloves]
[DAMAGE:100:BLUDGEON]
[WEIGHT:30]
[RANGED:MACE:THROW_KNIFE]
[SKILL:UNARMED]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:1]

change the Axe and Mace in the throwing gloves [RANGED:..] to CROSSBOW if you want that skill to be used, I use BOW and CROSSBOW for my race of evil creatures, I changed that skill just to use as an example hope this helps
Logged