Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Did Toady hard-code what counts as a weapon?  (Read 1293 times)

Hummingbird

  • Bay Watcher
    • View Profile
Did Toady hard-code what counts as a weapon?
« on: December 05, 2010, 11:52:38 pm »

I've recently tried editing entity_default.txt to include large daggers as a human weapon and picks as a dwarven weapon. As I expected, genning a new world with these changes allowed me to put points into Knife User or Miner during character generation in Adventure Mode. However, when I make an adventurer with most points in Knife User or Miner, the game starts me with a copper spear, a copper dagger, and no shield, just as if I did not have the most points in a weapon skill at all. (I also tried this with goblins, who have large daggers to begin with, but the same thing happened.) I was also unable to find a dagger-wielding soldier in any fortress at all, although I did find daggers for sale in human shops. It seems that the civs are unable to recognize daggers or picks as legitimate weapons.

I've looked through the rest of the entity_default file and the item_weapon file, and it doesn't seem that I have to change anything else to make humans use daggers and dwarves use picks—other weapons are used by civs solely by their inclusion in entity_default with a [WEAPON:] clause.

This raises the question: does DF contain hard-coded distinctions between "proper" weapons like swords and axes and other items like daggers and picks? Or is it a bug that I can't make civs use certain item types for weapons? Has anybody experienced the same problem? How was it in previous versions?
Logged
But Elves aren't Vegetarians. They eat people.
So they are humanitarians.

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: Did Toady hard-code what counts as a weapon?
« Reply #1 on: December 06, 2010, 12:04:20 am »

I think weapons that don't use a "normal" skill (swords, spears, pikes, axes, maces, hammers, crossbows, bows, and... blowguns?) can't be used as your starting weapon in adventure mode for some reason. No idea why. I tried a Cooking skill weapon a while back with the same results as you. Not sure why it defaults to a spear.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Iban

  • Bay Watcher
  • [CAFFEINE_DEPENDENT]
    • View Profile
Re: Did Toady hard-code what counts as a weapon?
« Reply #2 on: December 06, 2010, 05:02:45 am »

Kobold adventurers have a similar problem. I'm interested in the solution.
Logged

inEQUALITY

  • Bay Watcher
  • Living On the Mirror's Edge
    • View Profile
Re: Did Toady hard-code what counts as a weapon?
« Reply #3 on: December 06, 2010, 01:15:56 pm »

Easy. Change the skill to one of the vanilla ones. Knife user to sword. Mining to, say, hammer. Make a separate entry for your weaponized pick if you plan on playing fortress mode, or else you'll have a legendary hammerer capable of knocking down not only the toughest of rocks but the toughest of trolls. :P

EDIT: Two entries in both the entity_default and the item_weapon files, that is, one for the digger version with mining skill and one for the weaponized one with its own skill.
Logged
Quote from: Carl Sagan
It does no harm to the romance of the sunset to know a little bit about it.
If the magma cannon doesn't count, they aren't proper scientists.

Hummingbird

  • Bay Watcher
    • View Profile
Re: Did Toady hard-code what counts as a weapon?
« Reply #4 on: December 06, 2010, 09:16:32 pm »

Easy. Change the skill to one of the vanilla ones. Knife user to sword. Mining to, say, hammer. Make a separate entry for your weaponized pick if you plan on playing fortress mode, or else you'll have a legendary hammerer capable of knocking down not only the toughest of rocks but the toughest of trolls. :P

EDIT: Two entries in both the entity_default and the item_weapon files, that is, one for the digger version with mining skill and one for the weaponized one with its own skill.

That works. However, it's a workaround that doesn't solve the underlying problem, which is that entity definitions ought to be able to define any skill as a weapon skill and any item as a legitimate weapon. This problem isn't solvable by modding, unfortunately, because what counts as a "normal" weapon skill is hardcoded.

Was it always like this? If I remember correctly, goblins and kobolds had knives as weapons in their entity definitions since the 40d days. Did kobolds and goblins never show up with knife-wielding guys? Were you started with no weapon when you tried to be a knife-user?
Logged
But Elves aren't Vegetarians. They eat people.
So they are humanitarians.

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Did Toady hard-code what counts as a weapon?
« Reply #5 on: December 06, 2010, 09:29:04 pm »

Yeah, if you tried to start as a knife-wielder in 40d you would just start the game unarmed.
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.