Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Modding in new ranged weapons  (Read 969 times)

Luraien

  • Bay Watcher
    • View Profile
Modding in new ranged weapons
« on: November 01, 2009, 07:56:44 pm »

I modded in a nailgun, pretty much just the crossbow with a fancier name and more devastating ammo. I've added the correct [WEAPON:nailgun blah blah] and the ammo tags into the civs, but nobody can use them. In adventurer I don't get a nailer option (modded it so crossbowers are called nailers) and dwarves don't pick them up from the wagon in fortress mode. Can anyone think of where I've gone wrong?
Logged

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: Modding in new ranged weapons
« Reply #1 on: November 01, 2009, 07:59:45 pm »

I might, but it'll be easier if you post the raw entry for the nail gun and one of the entity entries.
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Luraien

  • Bay Watcher
    • View Profile
Re: Modding in new ranged weapons
« Reply #2 on: November 01, 2009, 08:09:30 pm »

Weapon:

[ITEM_WEAPON:ITEM_WEAPON_CROSSBOW]
[NAME:nailgun:nailguns]
[DAMAGE:70:BLUDGEON]
[WEIGHT:20]
[SKILL:HAMMER]
[RANGED:NAILGUN:NAIL]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:3]

Ammo:

[ITEM_AMMO:ITEM_AMMO_BOLT]
[NAME:nail:nails]
[CLASS:NAIL]
[DAMAGE:350:PIERCE]


As you can see it's just the crossbow with different names.

I've also changed this [CROSSBOWMAN_NAME:nailer:nailers] and kept in the following for the entity_default

   [WEAPON:ITEM_WEAPON_CROSSBOW]
      [AMMO:ITEM_AMMO_BOLT]
« Last Edit: November 01, 2009, 08:13:52 pm by Luraien »
Logged

LegoLord

  • Bay Watcher
  • Can you see it now?
    • View Profile
Re: Modding in new ranged weapons
« Reply #3 on: November 01, 2009, 08:14:47 pm »

Hm.  So did you edit crossbows, or add this entry into the game?  If it's the latter, then you've got a problem with multiple entries with the same title (entries start [OBJECTTYPE:TITLE]).  The title is what defines it as its own type of object, so having two entries with the same title causes problems.  If you want this to be a new object, you'll need [ITEM_WEAPON:(insert unique title in all caps here)]

If it is the prior, I don't have a clue, as it should have worked in that case. 
« Last Edit: November 01, 2009, 08:19:02 pm by LegoLord »
Logged
"Oh look there is a dragon my clothes might burn let me take them off and only wear steel plate."
And this is how tinned food was invented.
Alternately: The Brick Testament. It's a really fun look at what the bible would look like if interpreted literally. With Legos.
Just so I remember

Luraien

  • Bay Watcher
    • View Profile
Re: Modding in new ranged weapons
« Reply #4 on: November 01, 2009, 08:20:52 pm »

It's just one of a kind with it's title. I'm going to try this on a clean copy of DF, completely unmodded, and see if that works. I've been screwing around with races and that might have had an effect on it.
Logged

Luraien

  • Bay Watcher
    • View Profile
Re: Modding in new ranged weapons
« Reply #5 on: November 01, 2009, 08:26:59 pm »

Yeah somewhere along the line I'd messed up the races, in the new copy the nailgun works fine. Guess I'll mod from here, thankyou anyway ;D
Logged

Ziusudra

  • Bay Watcher
    • View Profile
Re: Modding in new ranged weapons
« Reply #6 on: November 02, 2009, 03:31:05 pm »

In the raws you posted, RANGED:NAILGUN:NAIL is a problem. Should be RANGED:CROSSBOW:NAIL as it determines the skill (and ammo) used when firing ammo and NAILGUN is not a skill.
Logged
Ironblood didn't use an axe because he needed it. He used it to be kind. And right now he wasn't being kind.

Enatai

  • Bay Watcher
  • [LIKES_MODDING]
    • View Profile
Re: Modding in new ranged weapons
« Reply #7 on: November 02, 2009, 03:47:32 pm »

Yeah, it seems odd that the nailgun would work considering the fact that nobody can use it... Perhaps civilizations create it and you used it in adventure mode but that's... just odd, are you sure that your dwarves are actually skilled in its usage?
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding in new ranged weapons
« Reply #8 on: November 07, 2009, 06:34:52 am »

Weapon:

[ITEM_WEAPON:ITEM_WEAPON_CROSSBOW]
[NAME:nailgun:nailguns]
[DAMAGE:70:BLUDGEON]
[WEIGHT:20]
[SKILL:HAMMER]
[RANGED:NAILGUN:NAIL]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:3]

Ammo:

[ITEM_AMMO:ITEM_AMMO_BOLT]
[NAME:nail:nails]
[CLASS:NAIL]
[DAMAGE:350:PIERCE]


As you can see it's just the crossbow with different names.

I've also changed this [CROSSBOWMAN_NAME:nailer:nailers] and kept in the following for the entity_default

   [WEAPON:ITEM_WEAPON_CROSSBOW]
      [AMMO:ITEM_AMMO_BOLT]

Error. It's [RANGED:CROSSBOW:NAIL] , there's no NAILGUN skill.
P.S. Aww, I missed that it was already answered...

350 pure DMG?! With a hardcoded CRITBOOST:2 on top of that ?! Man, it's one ugly rail gun, not nail gun :D.

P.P.S. Wait, you actually replaced the crossbows with it instead of making a new weapon and giving it to YOUR entity only? Man, your fortress mode must be deadly, because every race which uses crossbows would kill your dwarves in 1 shot :D. Not to mention adventure mode, where you'd be dead in any human city.
« Last Edit: November 07, 2009, 06:38:54 am by Deon »
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository