Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [mod help] Body, Body Parts and Body Detail Plans  (Read 2448 times)

Distman

  • Bay Watcher
    • View Profile
[mod help] Body, Body Parts and Body Detail Plans
« on: December 12, 2019, 10:56:28 am »

Getting back into DF modding after a six-month hiatus...

Feeling confused over how bodies work in raws. I'm making an immobile fungi creature with tentacles. It has (obviously) no bones, brain, eyes; all composed of one tissue/material called Sponge.

So I've made a [BODY]; a mushroom-like body (Stem > Ring > Cap) with five tentacles, each with a mouth on it.
Definition looks like this:
Code: [Select]
[BODY:FUNGI_5TENTACLES_MOUTHS]
[BP:UB:ring:ring][CON:LB][UPPERBODY][CATEGORY:BODY_UPPER]
[DEFAULT_RELSIZE:300]
[BP:LB:stem:stems][LOWERBODY][STANCE][CATEGORY:BODY_LOWER]
[DEFAULT_RELSIZE:800]
[BP:HD:cap:STP][CON:UB][HEAD][CATEGORY:HEAD]
[DEFAULT_RELSIZE:1400]

[BP:1T:first tentacle:STP][CON:HD][LIMB][GRASP][CATEGORY:TENTACLE]
[DEFAULT_RELSIZE:400]
[BP:2T:second tentacle:STP][CON:HD][LIMB][GRASP][CATEGORY:TENTACLE]
[DEFAULT_RELSIZE:400]
[BP:3T:third tentacle:STP][CON:HD][LIMB][GRASP][CATEGORY:TENTACLE]
[DEFAULT_RELSIZE:400]
[BP:4T:fourth tentacle:STP][CON:HD][LIMB][GRASP][CATEGORY:TENTACLE]
[DEFAULT_RELSIZE:400]
[BP:5T:fifth tentacle:STP][CON:HD][LIMB][GRASP][CATEGORY:TENTACLE]
[DEFAULT_RELSIZE:400]

[BP:1MOUTH:first mouth:STP][CON:1T][MOUTH][EMBEDDED][APERTURE][CATEGORY:MOUTH]
[DEFAULT_RELSIZE:20]
[BP:2MOUTH:second mouth:STP][CON:2T][MOUTH][EMBEDDED][APERTURE][CATEGORY:MOUTH]
[DEFAULT_RELSIZE:20]
[BP:3MOUTH:third mouth:STP][CON:3T][MOUTH][EMBEDDED][APERTURE][CATEGORY:MOUTH]
[DEFAULT_RELSIZE:20]
[BP:4MOUTH:fourth mouth:STP][CON:4T][MOUTH][EMBEDDED][APERTURE][CATEGORY:MOUTH]
[DEFAULT_RELSIZE:20]
[BP:5MOUTH:fifth mouth:STP][CON:5T][MOUTH][EMBEDDED][APERTURE][CATEGORY:MOUTH]
[DEFAULT_RELSIZE:20]

It is defined in creature raw like this:
Code: [Select]
[BODY:FUNGI_5TENTACLES_MOUTHS]
[BODY_DETAIL_PLAN:MOLLUSC_TISSUE_LAYERS:SKIN:FAT:MUSCLE]

[USE_MATERIAL_TEMPLATE:SPONGE:SPONGE_TEMPLATE]
[USE_TISSUE_TEMPLATE:SPONGE:SPONGE_TEMPLATE]

[TISSUE:BODY_TISSUE]
[TISSUE_NAME:fungi body:fungi bodies]
[TISSUE_MATERIAL:LOCAL_CREATURE_MAT:SPONGE]
[MUSCULAR]
[STRUCTURAL]
[TISSUE_MAT_STATE:SOLID]
[RELATIVE_THICKNESS:1]
[CONNECTS]
[TISSUE_SHAPE:LAYER]

[TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]

I'm missing something since I get the following error messages:
SPORE_TOWER:DEFAULT:stem, layer 2: Tissue SKIN was not found, using first tissue instead
SPORE_TOWER:DEFAULT:stem, layer 3: Tissue FAT was not found, using first tissue instead
SPORE_TOWER:DEFAULT:stem, layer 4: Tissue MUSCLE was not found, using first tissue instead
SPORE_TOWER:Attack PUNCH seems to have correct format but could not find proper BPs in any caste, so not added

What am I doing wrong? Bodies are very abstract and hard to understand imo.

Thanks,
Distman
Logged

Distman

  • Bay Watcher
    • View Profile
Re: [mod help] Body, Body Parts and Body Detail Plans
« Reply #1 on: December 12, 2019, 01:11:28 pm »

Yeah... So... You shall not define UPPERBODY before LOWERBODY if UPPERBODY is connected to LOWERBODY.

Problem solved and did some clean up in creature raw.
But i'm pretty sure i can streamline this some more:
Code: [Select]
[BODY_DETAIL_PLAN:MOLLUSC_TISSUE_LAYERS:SKIN:FAT:MUSCLE]

[USE_MATERIAL_TEMPLATE:SPONGE:SPONGE_TEMPLATE]

[USE_MATERIAL_TEMPLATE:SKIN:SPONGE_TEMPLATE]
[USE_MATERIAL_TEMPLATE:FAT:SPONGE_TEMPLATE]
[USE_MATERIAL_TEMPLATE:MUSCLE:SPONGE_TEMPLATE]

[USE_TISSUE_TEMPLATE:SPONGE:SPONGE_TEMPLATE]

[USE_TISSUE_TEMPLATE:SKIN:SPONGE_TEMPLATE]
[USE_TISSUE_TEMPLATE:FAT:SPONGE_TEMPLATE]
[USE_TISSUE_TEMPLATE:MUSCLE:SPONGE_TEMPLATE]

[USE_MATERIAL_TEMPLATE:TOOTH:TOOTH_TEMPLATE]
[USE_TISSUE_TEMPLATE:TOOTH:TOOTH_TEMPLATE]

[TISSUE:BODY_TISSUE]
[TISSUE_NAME:fungi body:fungi bodies]
[TISSUE_MATERIAL:LOCAL_CREATURE_MAT:SPONGE]
[MUSCULAR]
[STRUCTURAL]
HEALING_RATE:90
[TISSUE_MAT_STATE:SOLID]
[RELATIVE_THICKNESS:1]
[CONNECTS]
[TISSUE_SHAPE:LAYER]

[TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]

Do I really need to USE_MATERIAL_TEMPLATE and USE_TISSUE_TEMPLATE for all tissue layers? [TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE] should overwrite all of them with my defined tissue, right?

/Distman
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: [mod help] Body, Body Parts and Body Detail Plans
« Reply #2 on: January 02, 2020, 12:29:12 am »

Your Custom body is fine.

Using the Body in the creature is also fine. But since you *Want* it made from 1 material the BPD [BODY_DETAIL_PLAN:MOLLUSC_TISSUE_LAYERS:SKIN:FAT:MUSCLE] you don't need this. This BDP takes in 3 tissues and layers them on bodyparts that are avaliable (defined in the BDP)

so you don't need that line at all and that will remove errors
Quote
SPORE_TOWER:DEFAULT:stem, layer 2: Tissue SKIN was not found, using first tissue instead
SPORE_TOWER:DEFAULT:stem, layer 3: Tissue FAT was not found, using first tissue instead
SPORE_TOWER:DEFAULT:stem, layer 4: Tissue MUSCLE was not found, using first tissue instead

Why? Because you've never defined those 3 tissues (as far as I can see) and ergo probably not those materials (once again as far as I can see)

Quote
   [USE_TISSUE_TEMPLATE:SPONGE:SPONGE_TEMPLATE]
   
   [TISSUE:BODY_TISSUE]
      [TISSUE_NAME:fungi body:fungi bodies]
      [TISSUE_MATERIAL:LOCAL_CREATURE_MAT:SPONGE]
      [MUSCULAR]
      [STRUCTURAL]
      [TISSUE_MAT_STATE:SOLID]
      [RELATIVE_THICKNESS:1]
      [CONNECTS]
      [TISSUE_SHAPE:LAYER]

Use one or the other. Because you're defining a tissue SPONGE, then you're manually creating a tissue BODY_TISSUE and then you're using it here:
[TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]

so the line:
[USE_TISSUE_TEMPLATE:SPONGE:SPONGE_TEMPLATE]

 is never really being used, and is pointless to have.
Also your error for ATTACK:PUNCH probably is defined before the BODY tag, that or you're targeting a part instead of BY_TYPE:GRASP which would use your tentacles


Nitpicking:
  • [TISSUE_NAME:fungi body:fungi bodies] - this is what will be read in the combat log "The Dwarf strikes the mushroom in the cap, tearing the fungi body" So I'd recommend just calling it fungus:fungi
  • single tissued creatures tend to be easily killed/destroyed, you can get by this by just adding another [TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE] or two

End Notes:

Posted Dec 12th and no replies, ouch I haven't been patrolling the forums of late due to real life and other projects. But still hurts to see that you had no reply for a simple question.

As to bodies and that I'll try to explain it real quick, 1st as a tree:
Quote
Creature
   Materials
   Tissues*
   Body
      Tissue_Layers


A Creature will have materials defined, and then also tissues defined. These Tissues will be made up of materials (referenced), A body will be defined via the [BODY:] tag with a limitless number of args which are tied to BODY objects (as you know)

However when a BODY is defined in a creature it has no tissues (yet) so you must layer tissues on (going off of Painter's Logic, which is 1st layer is the bottom layer, as more layers are layered on top) so something like an arm (human-wise) would need to be layered with BONE, then MUSCLE, then FAT, and finally SKIN, and optionally HAIR so that BONE is the core of the limb, and SKIN is the very outside.

So really Creatures are just made up of BODY parts that are layered with TISSUEs (crazy).
Logged

Distman

  • Bay Watcher
    • View Profile
Re: [mod help] Body, Body Parts and Body Detail Plans
« Reply #3 on: April 15, 2020, 06:59:52 pm »

Thanks for clearing things up!
I can see now that most of this was messy.

So you can actually stack [TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]?? Good to know. But anyway, they are not easy to kill, at least not unarmed.
Logged

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: [mod help] Body, Body Parts and Body Detail Plans
« Reply #4 on: April 16, 2020, 02:02:22 pm »

Yup you can stack
[TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]
[TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]
[TISSUE_LAYER:BY_CATEGORY:ALL:BODY_TISSUE]

and it'd have 3 layers of that tissue. Healthcare windows will look weird when you look at "Head: Fungus cut open, Fungus cut open, Fungus cut open"

but it will toughen up the creature in regards to plain combat
Logged