Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Wounds from different parts inside a part?  (Read 850 times)

SlimeOfSteel

  • Bay Watcher
  • Novice Programmer
    • View Profile
Wounds from different parts inside a part?
« on: May 07, 2018, 12:52:41 pm »

I wasn't sure where to post this, so I'll post it here.

So once again, I was experimenting with Dwarf Fortress to work on my wound editor. However, I kept coming across something odd. Sometimes, different parts would be coupled in with a part's layers.

I'm not good with explaining, so I'll give you an example.

The subject I was testing on (A fox) had it's upper body injured. However, in the layers, there was an entry for it's left lung, a completely different part. Yet the part was in the upper body's layer list.

Is this a bug or something? If not, why does this occur?
Logged
It works, but I don't know why.

MrRoboto75

  • Bay Watcher
  • Belongs in the Trash!
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #1 on: May 07, 2018, 01:29:08 pm »

Shouldn't the lung be inside the upper torso somewhere?
Logged
I consume
I purchase
I consume again

ChairmanPoo

  • Bay Watcher
  • Send in the clowns
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #2 on: May 07, 2018, 02:57:34 pm »

Maybe it's a teratoma?
Logged
Everyone sucks at everything. Until they don't. Not sucking is a product of time invested.

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #3 on: May 07, 2018, 03:34:18 pm »

Where else would the lung be, exactly?

DF uses parent/child relationships when dealing with bodyparts, especially in the case of internal organs. This is so that attacks on a major part can have consequences for the secondary parts, meaning that a spear strike to the chest can puncture the heart, and the heart cannot be targeted as a separate location (because it isn't, really... It's contained within the former).

So for something like teeth, the hierarchy goes (upper body) -> head -> face -> mouth -> "teeth" -> the individual teeth, such such as eye tooth, second molar and so on.

The upper body is in parenthesis because there's a slightly different relationship between major bodyparts and their connections than there is between a large part and its organs or minor pieces, but all bodyparts have a tree structure that is rooted in the upper body. This is what makes it possible to cut a head off of a body, rather than a body off of a head.


Also this is the wrong subforum, this is the general discussion for things that are not DF.

MrRoboto75

  • Bay Watcher
  • Belongs in the Trash!
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #4 on: May 07, 2018, 03:50:00 pm »

Maybe it's a teratoma?

Its naught a tooma!
Logged
I consume
I purchase
I consume again

SlimeOfSteel

  • Bay Watcher
  • Novice Programmer
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #5 on: May 08, 2018, 09:01:13 am »

Where else would the lung be, exactly?

DF uses parent/child relationships when dealing with bodyparts, especially in the case of internal organs. This is so that attacks on a major part can have consequences for the secondary parts, meaning that a spear strike to the chest can puncture the heart, and the heart cannot be targeted as a separate location (because it isn't, really... It's contained within the former).

So for something like teeth, the hierarchy goes (upper body) -> head -> face -> mouth -> "teeth" -> the individual teeth, such such as eye tooth, second molar and so on.

The upper body is in parenthesis because there's a slightly different relationship between major bodyparts and their connections than there is between a large part and its organs or minor pieces, but all bodyparts have a tree structure that is rooted in the upper body. This is what makes it possible to cut a head off of a body, rather than a body off of a head.

Ah, that explains it. I'm making a wound editor script, and that kind of screwed up the script, so I guess I'll have to rework the script.

Also this is the wrong subforum, this is the general discussion for things that are not DF.

Yeah, my bad. Next time I'll try and post in the DF General Discussion.
Logged
It works, but I don't know why.

Kagus

  • Bay Watcher
  • Olive oil. Don't you?
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #6 on: May 08, 2018, 09:14:54 am »

Hehehe, well, you'll know there's something really wrong with a script when it starts acting exactly as expected.

You can get a better feel for how bodies are put together by going into the Raws and looking at... uh... I think it's called BODY_STANDARD.txt? I don't have an installation of DF on this computer, so I can't check it at the moment. Note that, as with most of DF's structuring, it can be a little hard to read.

This will also probably be a better way of learning about how the game handles things like muscle/fat/skin layers, hair, and bones than I would be able to tell you, as I never around much with that.


I will, however, tell you about a lovely time back in my days as a fledgling modder for an earlier version of DF, when I tried to make a race of vampires. In an attempt to make the heart a truly critical location (it was entirely possible to survive massive heart injury in those days), I made the dumb mistake of giving it the [HEAD] tag, which causes a mob to die if the part gets damaged heavily.

This of course resulted in vampires with hearts featuring faces, eyes and teeth, and their bite attacks would be split 50/50 between the head making the attack and the heart leaping out of the chest to nibble someone. Nightmarish mental images were had.

SlimeOfSteel

  • Bay Watcher
  • Novice Programmer
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #7 on: May 08, 2018, 11:20:00 am »

Hehehe, well, you'll know there's something really wrong with a script when it starts acting exactly as expected.

You can get a better feel for how bodies are put together by going into the Raws and looking at... uh... I think it's called BODY_STANDARD.txt? I don't have an installation of DF on this computer, so I can't check it at the moment. Note that, as with most of DF's structuring, it can be a little hard to read.

This will also probably be a better way of learning about how the game handles things like muscle/fat/skin layers, hair, and bones than I would be able to tell you, as I never around much with that.

I checked, and you're kind of right. It was called body_default.txt. I'll check it out and see what I can do.

I will, however, tell you about a lovely time back in my days as a fledgling modder for an earlier version of DF, when I tried to make a race of vampires. In an attempt to make the heart a truly critical location (it was entirely possible to survive massive heart injury in those days), I made the dumb mistake of giving it the [HEAD] tag, which causes a mob to die if the part gets damaged heavily.

This of course resulted in vampires with hearts featuring faces, eyes and teeth, and their bite attacks would be split 50/50 between the head making the attack and the heart leaping out of the chest to nibble someone. Nightmarish mental images were had.

Holy shit, that sounds both simultaneously terrifying yet awesome at the same time.
Logged
It works, but I don't know why.

SlimeOfSteel

  • Bay Watcher
  • Novice Programmer
    • View Profile
Re: Wounds from different parts inside a part?
« Reply #8 on: May 08, 2018, 04:54:30 pm »

All right, I think I may have figured it out. The sub parts are being treated as layers to the regular injured part.
Logged
It works, but I don't know why.