Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Reactions for slings and their ammo  (Read 1606 times)

Crabs

  • Bay Watcher
    • View Profile
Reactions for slings and their ammo
« on: September 03, 2019, 12:27:40 am »

EDIT: I managed to get it to work, here is the result if anyone wants to use them for their game. You might want to play around with the velocity and the bullet weight, though. At the moment it's fairly good against small-medium sized targets with no or little armor.
Metal armor deflects almost all shots but with pulling and tearing you can still disable armored targets by sheer volume of fire, considering how widely available the ammo is.

I tested 10 dorfs against a hydra and none of the 300 shots didn't manage to deal significant damage - as it should be.

Here's the raws:

Weapon:
Spoiler (click to show/hide)

Ammo:
Spoiler (click to show/hide)

Reactions:
[
Spoiler (click to show/hide)



Trying to mod craftable slings, slingstones and cloth quivers into the game. This is what I started with:

Weapon:
Spoiler (click to show/hide)

Ammo:
Spoiler (click to show/hide)

Reactions:
Spoiler (click to show/hide)

I found the reactions when looking around the forum but they don't seem to work. I can spawn ammo and slings in the arena and I can order them at workshops (i.e. I did not forget to permit these reactions in the entity raws).
I ordered the production of all these items in fort mode and the game crashed:

Errorlog:
Spoiler (click to show/hide)

Then I asked in the general modding thread where I got some help, but it seems like there's still missing something:

I changed my raws accordingly and now something very perculiar is happening:
I created a new world, embarked and dug some stone. Built a craftshop and ordered the making of
1 cloth sling
1 cloth quiver
1 slingstones (which should yield 30 stones)

now what happened:
a clothier brought cloth and made 10(!) slings! (How?)
a clothier brought no cloth and didn't make a quiver, job was still 'done' (i.e. he still went to the workshop, stood there for some time and then went back to the meeting area)
a stonecrafter brought no boulder to the shop, didn't make any slingstones and made 0 slingstones, the job was still 'done'

I have no idea how this could be happening.


Spoiler (click to show/hide)

I already looked into the various arms and amror mods floating around that promised to have slings in them but in none of them I found the reactions for the making of these.
« Last Edit: September 05, 2019, 02:30:54 am by Crabs »
Logged
(\/) (*o*) (\/)

Mister Crabby the Pincers of Stabbing?

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Reactions for slings and their ammo
« Reply #1 on: September 03, 2019, 01:56:17 am »

Quote
[REAGENT:A:1:CLOTH:NONE:NONE:NONE] 

Well...
Quote
[PRODUCT_DIMENSION:<size>]   Specifies the dimensions of the product. A product of 150 is typical for BAR, POWDER_MISC, LIQUID_MISC, DRINK, and GLOB. 15000 is typical for THREAD, and a size of 10000 is typical for CLOTH. Has no effect on any other item types. Note: this is not the actual volume of the product, which is hard-coded by the item token.

Should be 10000 for cloth, not 1. ;)

Quote
*** Error(s) finalizing the reaction MAKE_SLINGSTONES
MAKE_SLINGSTONES:Unrecognized Item Token: ITEM_AMMO
*** Error(s) finalizing the reaction MAKE_SLING_LEATHER
MAKE_SLING_LEATHER:Unrecognized Item Token: ITEM_WEAPON

In your reactions:

[PRODUCT:100:1:ITEM_WEAPON:ITEM_WEAPON_SLING:GET_MATERIAL_FROM_REAGENT:A:NONE]    should be WEAPON:ITEM_WEAPON_SLING, not ITEM_WEAPON:ITEM_WEAPON_SLING.

[PRODUCT:100:30:ITEM_AMMO:ITEM_AMMO_SLINGSTONES:GET_MATERIAL_FROM_REAGENT:A:NONE]   should be AMMO:ITEM_AMMO_SLINGSTONES.

[PRODUCT:100:1:ITEM_WEAPON_SLING:GET_MATERIAL_FROM_REAGENT:A:NONE] should be WEAPON:ITEM_WEAPON_SLING.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Crabs

  • Bay Watcher
    • View Profile
Re: Reactions for slings and their ammo
« Reply #2 on: September 03, 2019, 03:37:35 am »

Thanks for the reply!
Quote
[REAGENT:A:1:CLOTH:NONE:NONE:NONE] 

Well...
Quote
[PRODUCT_DIMENSION:<size>]   Specifies the dimensions of the product. A product of 150 is typical for BAR, POWDER_MISC, LIQUID_MISC, DRINK, and GLOB. 15000 is typical for THREAD, and a size of 10000 is typical for CLOTH. Has no effect on any other item types. Note: this is not the actual volume of the product, which is hard-coded by the item token.

Should be 10000 for cloth, not 1. ;)
Oops, changed that.

Quote
*** Error(s) finalizing the reaction MAKE_SLINGSTONES
MAKE_SLINGSTONES:Unrecognized Item Token: ITEM_AMMO
*** Error(s) finalizing the reaction MAKE_SLING_LEATHER
MAKE_SLING_LEATHER:Unrecognized Item Token: ITEM_WEAPON

In your reactions:

[PRODUCT:100:1:ITEM_WEAPON:ITEM_WEAPON_SLING:GET_MATERIAL_FROM_REAGENT:A:NONE]    should be WEAPON:ITEM_WEAPON_SLING, not ITEM_WEAPON:ITEM_WEAPON_SLING.

[PRODUCT:100:30:ITEM_AMMO:ITEM_AMMO_SLINGSTONES:GET_MATERIAL_FROM_REAGENT:A:NONE]   should be AMMO:ITEM_AMMO_SLINGSTONES.

[PRODUCT:100:1:ITEM_WEAPON_SLING:GET_MATERIAL_FROM_REAGENT:A:NONE] should be WEAPON:ITEM_WEAPON_SLING.

Yes, that was my first attempt but I already changed that to the (seemingly) correct product descriptions as shown in the second spoiler.
I don't think the 1 -> 10000 fix will fix the whole problem though since it leaves the slingstone reaction untouched.
Logged
(\/) (*o*) (\/)

Mister Crabby the Pincers of Stabbing?

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Reactions for slings and their ammo
« Reply #3 on: September 03, 2019, 03:52:46 am »

The lower reactions are fine. Did you generate a new world after you fixed them?
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Crabs

  • Bay Watcher
    • View Profile
Re: Reactions for slings and their ammo
« Reply #4 on: September 03, 2019, 03:54:41 am »

The lower reactions are fine. Did you generate a new world after you fixed them?
Yes, as I said in the OP. I have no idea how this happens.

EDIT:
Update: Just to make sure, I generated yet another world and the problem remains.
Also about this bit
Specifies the dimensions of the product. A product of 150 is typical for BAR, POWDER_MISC, LIQUID_MISC, DRINK, and GLOB. 15000 is typical for THREAD, and a size of 10000 is typical for CLOTH. Has no effect on any other item types. Note: this is not the actual volume of the product, which is hard-coded by the item token.
What effect does this even have, when size is determined in the item's raws and not in the reaction's values? Also how would I know the value for the sling made out of leather?
« Last Edit: September 03, 2019, 04:09:31 am by Crabs »
Logged
(\/) (*o*) (\/)

Mister Crabby the Pincers of Stabbing?

Ulfarr

  • Bay Watcher
  • Going on a pilgrimage to Mars
    • View Profile
Re: Reactions for slings and their ammo
« Reply #5 on: September 03, 2019, 09:39:08 am »

In your slingstone reaction, it's missing the amount of stones needed.
Logged
Bring Kobold Kamp to LNP! graphics compatibility fix.

So the conclusion I'm getting here is that we use QSPs because dwarves can't pilot submarines.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Reactions for slings and their ammo
« Reply #6 on: September 03, 2019, 09:42:21 am »

In your slingstone reaction, it's missing the amount of stones needed.
Argh, I'm so blind.  :o
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Crabs

  • Bay Watcher
    • View Profile
Re: Reactions for slings and their ammo
« Reply #7 on: September 04, 2019, 12:41:59 am »

In your slingstone reaction, it's missing the amount of stones needed.
Oh!
So according to DFWiki the structure is like this:
[REAGENT:<name>:<quantity>:<item token>:<material token>][...modifiers...]

So in my example the 1 was missing?
[REAGENT:A:1:BOULDER:NO_SUBTYPE:NONE:NONE][WORTHLESS_STONE_ONLY]

But then again, Meph said:
Quote
[REAGENT:A:1:CLOTH:NONE:NONE:NONE] 

Well...
Quote
[PRODUCT_DIMENSION:<size>]   Specifies the dimensions of the product. A product of 150 is typical for BAR, POWDER_MISC, LIQUID_MISC, DRINK, and GLOB. 15000 is typical for THREAD, and a size of 10000 is typical for CLOTH. Has no effect on any other item types. Note: this is not the actual volume of the product, which is hard-coded by the item token.

Should be 10000 for cloth, not 1. ;)

This would mean that 1 was correct after all?
Anyway thanks for the help, I'll see what the one does to my tests. I'll generate a new world.
EDIT/Update:
So inserting the 1 fixed that they are now actually carrying the boulders to the workshop but they still don't produce anything so I assume my [PRODUCT:...] lines must be faulty.
« Last Edit: September 04, 2019, 01:03:47 am by Crabs »
Logged
(\/) (*o*) (\/)

Mister Crabby the Pincers of Stabbing?

Ulfarr

  • Bay Watcher
  • Going on a pilgrimage to Mars
    • View Profile
Re: Reactions for slings and their ammo
« Reply #8 on: September 04, 2019, 01:15:32 am »

This would mean that 1 was correct after all?
Anyway thanks for the help, I'll see what the one does to my tests. I'll generate a new world.

Using value of "1" for cloth was technicaly correct, in that the game could recognize that a certain amount of cloth was needed. It just wasn't what you were trying to make.

For most reagents/products there is a 1:1 ratio between the reaction's quantity and the actual amount of said items getting consumed/produced. However, items that are either bars, powders, liquids, drinks, globs, thread or cloth are sometimes used in amounts that do not correspond to 1 in game item (i.e the miniscule amount of thread needed to suture a wound or melting an item that gives 1.3 bars of metal back) so the game treats them differently. The typical amounts, in Wiki/Meph's quote, are the reaction quantities that would result in a single unit of said items geting consumed/produced.
Logged
Bring Kobold Kamp to LNP! graphics compatibility fix.

So the conclusion I'm getting here is that we use QSPs because dwarves can't pilot submarines.

Crabs

  • Bay Watcher
    • View Profile
Re: Reactions for slings and their ammo
« Reply #9 on: September 04, 2019, 02:04:52 am »

This would mean that 1 was correct after all?
Anyway thanks for the help, I'll see what the one does to my tests. I'll generate a new world.

Using value of "1" for cloth was technicaly correct, in that the game could recognize that a certain amount of cloth was needed. It just wasn't what you were trying to make.

For most reagents/products there is a 1:1 ratio between the reaction's quantity and the actual amount of said items getting consumed/produced. However, items that are either bars, powders, liquids, drinks, globs, thread or cloth are sometimes used in amounts that do not correspond to 1 in game item (i.e the miniscule amount of thread needed to suture a wound or melting an item that gives 1.3 bars of metal back) so the game treats them differently. The typical amounts, in Wiki/Meph's quote, are the reaction quantities that would result in a single unit of said items geting consumed/produced.

Ah, I understand, thanks for clearing that up.
Playing DF can be very complex but trying to mod it shows how deep the abyss actually is. And that's just the raws...

EDIT:

So I changed the raws to this
Spoiler (click to show/hide)

generated a new world and now it actually worked. I have no idea why it didn't work earlier but now it does.
« Last Edit: September 04, 2019, 03:56:27 am by Crabs »
Logged
(\/) (*o*) (\/)

Mister Crabby the Pincers of Stabbing?