Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Castes with different body parts and associated attacks  (Read 2305 times)

Iapetus

  • Bay Watcher
    • View Profile
Castes with different body parts and associated attacks
« on: January 03, 2015, 09:08:04 am »

I want to create a creature (based on the Prador from Neal Asher's Polity novels) where the male and female castes have different body parts and associated attacks.  (No, nothing dirty - the males have big crab claws, and the females have large mandibles and a stabbing tail).

I've put all the "common" body parts and attacks in the main creature-level part of the code, and the male/female-specific ones in the appropriate castes.

In testing, everything looks ok at first, but attacks from or against the male/female parts suffer the "passes through" error.  Attacks with or against the common body parts work correctly).

What am I doing wrong?  Do I need to duplicate the material/tissue tokens for each caste?

Spoiler (click to show/hide)
Logged
Engraved on the floor is a well-designed image of a kobold and a carp.  The kobold is making a plaintive gesture.  The carp is laughing.

UnicodingUnicorn

  • Bay Watcher
  • Competent at Incompetency.
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #1 on: January 03, 2015, 09:14:19 am »

Yep, you answered yourself. You need to define the materials for the additional body parts you have added. Also, is there anything in the errorlog?
Logged
I do stuff, I guess

vjmdhzgr

  • Bay Watcher
  • Hehehe
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #2 on: January 03, 2015, 12:11:43 pm »

The problem is that the body parts need to be defined before the tissues so maybe moving the castes or atleast the caste body definitions to the top of the file would work.
Logged
Its a feature. Impregnating booze is a planned tech tree for dwarves and this is a sneak peek at it.
Unless you're past reproductive age. Then you're pretty much an extension of your kids' genitalia

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #3 on: January 03, 2015, 12:18:29 pm »

vjmdhzgr is right.  It takes some getting used to, but you can dip in and out of castes repeatedly as needed.  So just define the common bodyparts, select a caste, add a BODY token, select the other caste, add a BODY token, select all castes, do the tissues and materials stuff, then continue on your way (splitting into castes again for attacks and/or coloration).

Tissue layers are applied to bodyparts kind of like dipping a candle.  If you apply them twice, you end up with two complete sets of layers one atop the other.  This means arranging your creature to define all bodyparts, then apply tissues once.  If you have custom bodyparts that aren't mentioned in the standard tissue definitions, you'll need to make you own or carefully layer tissues onto just those parts.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Iapetus

  • Bay Watcher
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #4 on: January 10, 2015, 09:32:15 am »

Thanks.

I got it "working" by repeating the [BODY_DETAIL_PLAN:***] tokens under [SELECT_CASTE:ALL], but by the sound of it that will have resulted in duplication, so I'll have to tidy the raws up a bit.


On a related note: is there any way to make a creature gain or lose body parts as it ages, or add a token at a particular age?

(In the books, Prador male "children" form the bulk of the armies and workforce (at least, that part not made up by drones and slaves).  When they If they are allowed to* mature to adulthood, they lose their rear legs and become sexually mature.   To represent this in DF, I'd to have the adult caste initially asexual, and have some way to add the [MALE] token and remove some of the leg tokens at a later time).



* Prador would probably view most of the Bay12 community's Dwarven Childcare and population control suggestions as unreasonably benevolent.
Logged
Engraved on the floor is a well-designed image of a kobold and a carp.  The kobold is making a plaintive gesture.  The carp is laughing.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #5 on: January 10, 2015, 11:52:43 am »

Thanks.

I got it "working" by repeating the [BODY_DETAIL_PLAN:***] tokens under [SELECT_CASTE:ALL], but by the sound of it that will have resulted in duplication, so I'll have to tidy the raws up a bit.


On a related note: is there any way to make a creature gain or lose body parts as it ages, or add a token at a particular age?

(In the books, Prador male "children" form the bulk of the armies and workforce (at least, that part not made up by drones and slaves).  When they If they are allowed to* mature to adulthood, they lose their rear legs and become sexually mature.   To represent this in DF, I'd to have the adult caste initially asexual, and have some way to add the [MALE] token and remove some of the leg tokens at a later time).



* Prador would probably view most of the Bay12 community's Dwarven Childcare and population control suggestions as unreasonably benevolent.
Although it does get suggested from time to time, there are no caste-like life stages for creatures.  Physically, a child is just a smaller adult (same stats, same personality, etc.)... though there are a couple hardcoded behavioral differences (babies stay with mom, no child will perform fort tasks, etc.).

You could simulate the life cycle within a fort using a combination of interactions, but it wouldn't operate correctly off-screen (such as during worldgen, or in competing civs).
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Iapetus

  • Bay Watcher
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #6 on: January 13, 2015, 01:44:07 pm »

Okay, thanks.  I think for now I'll just go for the simple but inaccurate solution of representing the different life stages by different castes in varying ratios.   I might try and do something with interactions later (it would be quite appropriate since prador adults control or prevent their offsprings' maturation using pheromones), but is too advanced for me now.  (Plus, once I do get the hang of interactions and syndromes, my first priority will be trying to simulate the Spatterjay virus).


I have run into a few other problems now though.  I've redefined a number of body parts, and ended up with some really weird connections.

The stats screen for a prador third child lists the following parts:
carapace
visual turret
right palp eye, body
right palp eye, fourth turret eye
left palp eye, body
left palp eye, fourth turret eye
right mandible, body
right mandible, fourth turret eye
left mandible, body
left mandible, fourth turret eye
major ganglion, body
major ganglion, fourth turret eye
right pincer
left pincer

(I haven't listed the arms and legs).

There seems to be a problem with everything that is supposed to attach to the head:  the visual turret is suffering from the "attack passes through it" problem, and all the other head attachments are connecting to the body (as expected), but also to the fourth turret eye.

Can anyone see what's going on?

These are the relevant bits of code.
Spoiler (click to show/hide)

One other question: the carapace (shell) gets knocked off really easily in combat.  How can I make it stay on better?
Logged
Engraved on the floor is a well-designed image of a kobold and a carp.  The kobold is making a plaintive gesture.  The carp is laughing.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #7 on: January 14, 2015, 10:50:24 am »

Try attaching the visual turret, mandibles, etc. to the specific UB bodypart rather than the HEAD type.  Or use the vanilla BODY_HEAD detail plan which uses a HEAD category instead of BODY_UPPER.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Iapetus

  • Bay Watcher
    • View Profile
Re: Castes with different body parts and associated attacks
« Reply #8 on: January 25, 2015, 05:28:29 pm »

Attaching the eyestalks, mandibles, etc to the UB instead of the HEAD fixed the weird duplications.

I eventually worked out that the problem with the visual turret was that its custom category tag doesn't appear in the standard exoskeleton body detail plan, so it wasn't having any materials or tissues assigned to it.

I changed the category to HEAD, and it works properly now.  (I presumably could also have fixed this by creating a new Prador body detail plan, but decided the HEAD fix would be simpler).
Logged
Engraved on the floor is a well-designed image of a kobold and a carp.  The kobold is making a plaintive gesture.  The carp is laughing.