Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WEAPONS: Can this work?  (Read 1347 times)

ricemastah

  • Bay Watcher
    • View Profile
WEAPONS: Can this work?
« on: December 06, 2007, 12:42:00 pm »

NOTE: Long post, questions are at the bottom of the post.

Alright I have done some modding from previous versions, and I am currently working on a medium sized mod. Right now I am stuck on weapons. Ranged weapons to be specific.

code:
 
[ITEM_WEAPON:ITEM_WEAPON_CROSSBOW]
[NAME:crossbow:crossbows]
[DAMAGE:70:BLUDGEON]
[WEIGHT:40]
[SKILL:HAMMER]
[RANGED:CROSSBOW:BOLT]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:3]

[ITEM_AMMO:ITEM_AMMO_BOLTS]
[NAME:bolt:bolts]
[CLASS:BOLT]
[DAMAGE:100:PIERCE]


I am pretty sure someone put together a mod that involved small sidearms meant purely for throwing, and someone else put together a mod for guns. One of the things that were mentioned is the possibility that the 'guns' could use crossbow bolts and crossbows could use 'bullets'. The question? Are ammo classes hardcoded? Because the weapons ranged tags looks like it only refers to the weapon skill used and the class of ammo referred to. If it is not hardcoded and ammo classes can be defined then it would be easy enough to create a set of throwing weapons and weapon specific ammo. As well as a throwing glove. Of course because skills are still hardcoded it would be limited to existing skills, so there would be no difference between throwing darts and shooting bolts. Such as this:

code:
  
[ITEM_WEAPON:ITEM_WEAPON_THROWING_GLOVE]
[NAME:throwing glove:throwing gloves]
[DAMAGE:10:BLUDGEON]
[WEIGHT:5]
[SKILL:MACE]
[RANGED:CROSSBOW:THROWING]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:1]

[ITEM_AMMO:ITEM_AMMO_THROWING_AXE]
[NAME:throwing axe:throwing axes]
[CLASS:THROWING]
[DAMAGE:100:SLASH]

[ITEM_AMMO:ITEM_AMMO_THROWING_DAGGER]
[NAME:throwing dagger:throwing daggers]
[CLASS:THROWING]
[DAMAGE:75:SLASH]


This also leads to the possibility of creating ammo sets for weapons. in the code above the throwing glove should be able to use both the axes and daggers. I believe the ammo/gun mod showed that this is true, and now if what I believe should work will allow us to mod ammo specificity as well and multiple ammo types.

So that actually leads to several questions:

1. Are the ammo classes hardcoded or can users define their own ammo classes?
2. In the [RANGED:SKILL:CLASS] tag is the skill limited to crossbow and bow? or can you use something like throwing... I understand that throwing is not a known tag or possibility, but it is a skill and I would like to know if it is possible to use it as such in this tag.
3. Similar to 2., but in regards to the weapon can I use wrestling instead of mace?

I know I should test it out, but I would like to know If anyone has any experience in this. If not I'll try to form a world or two. Thank you for any help!

Logged

Paul

  • Bay Watcher
  • Polite discourse with a dash of insanity.
    • View Profile
    • Need an affordable website? I can help.
Re: WEAPONS: Can this work?
« Reply #1 on: December 06, 2007, 08:12:00 pm »

I haven't experimented with it but I believe that the ammo is defined in the entity_default file under the various entities.
Like looking at the dwarf entity you will notice
[WEAPON:ITEM_WEAPON_CROSSBOW] followed by
[AMMO:ITEM_AMMO_BOLTS]
You should be able to add a new weapon type followed immediately by the required ammo type and have it use that ammo.

As far as your questions concerning skills, I have no idea.

Logged
Do you like Science Fiction? I'm writing the Weaveborn Saga over on Royal Road and my website. Link

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: WEAPONS: Can this work?
« Reply #2 on: December 07, 2007, 02:55:00 am »

Using winrar's view utility to look through the .exe, you can find all skill and weapon tags.

The throwing skill is THROW.
Wrestling is UNARMED.

The problem with using those (except wrestling, probably) is that in dwarf mode, dwarves are hardcoded to use crossbows only, and in this case the skill defines the weapon.

I was able to mod in hoe's, sickles, smith's hammers, even pencils for nobles, and I can now take those skills as an adventurer, but the weapons don't spawn, and have to be found somehow.

Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

ricemastah

  • Bay Watcher
    • View Profile
Re: WEAPONS: Can this work?
« Reply #3 on: December 07, 2007, 10:56:00 am »

Well as of the last 2d version it was possible for me to generate dwarves, at least in adventurer mode that used bows. I had to mod in bows that dwarves were capable of using of course. But they could both produce bows and arrows in dwarf mode and use them in adventurer mode. The main point of that being to be able to get more ammo for adventurer mode. But I'm guessing no one seems to know whether or not ammo classes are hardcoded.

On the part of hoe's and pencils, making them weapons linked to the entity tags as paul suggested should work.

Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: WEAPONS: Can this work?
« Reply #4 on: December 07, 2007, 11:37:00 am »

No, that's not the point. I can MAKE those tools in fort mode, I can WIELD them as an adventurer, but I can't FIND them as an adventurer, or USE them in fort mode. They don't spawn at startup for an adventurer like other custom weapons do, and the dwarves don't try to use them for any purpose whatsoever. The only funny thing I managed to do was rig a weapon trap with rakes. "Rake in grass" FTW.  :)
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

ricemastah

  • Bay Watcher
    • View Profile
Re: WEAPONS: Can this work?
« Reply #5 on: December 07, 2007, 12:21:00 pm »

If you link them to other entities they should be able to make them also right? And then you should be able to find them in shops...?
Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: WEAPONS: Can this work?
« Reply #6 on: December 07, 2007, 01:23:00 pm »

Theoretically, yes. In practice, they are far too uncommon if they exist at all, because they use non-military skills. You don't see picks in shops, and they are basically weapons that use the mining skill.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Wiles

  • Bay Watcher
    • View Profile
Re: WEAPONS: Can this work?
« Reply #7 on: December 07, 2007, 01:48:00 pm »

I do believe that ammo is hardcoded. You could have something like a thrown spear, that uses the crossbow skill and uses renamed bolts as ammo.

code:
 [ITEM_WEAPON:ITEM_WEAPON_JAVELIN]
[NAME:javelins:javelins]
[DAMAGE:70:PIERCE]
[WEIGHT:30]
[SKILL:SPEAR]
[RANGED:CROSSBOW:BOLT]
[TWO_HANDED:0]
[MINIMUM_SIZE:5]
[MATERIAL_SIZE:3]

[ITEM_AMMO:ITEM_AMMO_JAVELIN]
[NAME:thrown javelin:thrown javelins]
[CLASS:BOLT]
[DAMAGE:100:PIERCE]


Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: WEAPONS: Can this work?
« Reply #8 on: December 07, 2007, 02:25:00 pm »

Ammo classes are not hardcoded. You can only easily obtain ammo that is fired from a crossbow-type weapon, but otherwise any ammo is good. I've had throwing axes in a custom class fired from a crossbow-skill "throwing axe set" in adventure mode.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India