You can add a self-targeting interaction with USAGE_HINT:DEFEND which adds the CAN_LEARN tag for a short period of time.
Note that whether a creature is considered sapient with respect to eating it is determined by whether it has CAN_LEARN when it dies, so any of these creature which die in combat will not be eaten by dwarves.
Thanks this was another Idea I had too
.
I figured I could somehow create 2 interactions. The first adding CAN_LEARN if the cavy does not have CAN_LEARN and is in combat with defend. And the second to remove the CAN_LEARN if it has it and is not in combat.
I don't understand syndromes yet maybe you can clarify a few questions I have.
Do syndromes have a way to do something like remove CAN_LEARN if the requirements don't match anymore? Or if the time for it ran out and is not refreshed anymore? In programming I would probably use a fall through else if condition.
And another question regarding Interactions is how low should I set the cool down? And if I set it too low will it impact the game performance?
#UPDATE: I've just implemented your idea, lets hope this works and there are no side effects
. Thanks again for helping. I did put the creature and interaction file down below, possibly helping someone trying to do the same.
Thanks
Creature txt:
creatures_domestic_chains_brave_cavies
[OBJECT:CREATURE]
[CREATURE:BRAVE_CAVY]
[DESCRIPTION:A small brave rodent with no tail. It can be found roaming the grassland in herds. It has three toes on its hind feet.]
[NAME:brave cavy:brave cavies:brave cavy]
[CHILD:1][GENERAL_CHILD_NAME:brave cavy pup:brave cavy pups]
[CREATURE_TILE:'c'][COLOR:7:0:0]
[CREATURE_CLASS:MAMMAL]
[PETVALUE:6]
[PET]
[TRAINABLE]
[PERSONALITY:BRAVERY:50:62:100]
[NOEMOTION]
[NATURAL_SKILL:DODGING:2]
[NATURAL_SKILL:BITE:1]
[NATURAL_SKILL:MELEE_COMBAT:1]
[NO_SLEEP]
[NO_DRINK]
[NO_EAT]
[TRANCES]
[LARGE_PREDATOR]
[VISION_ARC:50:310]
[NATURAL]
[LARGE_ROAMING]
[COMMON_DOMESTIC]
[BIOME:ANY_LAND]
[CAN_DO_INTERACTION:FIGHTING]
[CDI:ADV_NAME:Is fighting]
[CDI:USAGE_HINT:DEFEND]
[CDI:TARGET:A:SELF_ONLY]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:FREE_ACTION]
[CDI:WAIT_PERIOD:0]
[POPULATION_NUMBER:15:30]
[CLUSTER_NUMBER:5:10]
[PREFSTRING:three toes]
[PREFSTRING:adorable call]
[BODY:QUADRUPED_NECK:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:THROAT:NECK:SPINE:BRAIN:SKULL:4TOES_FQ_REG:3TOES_RQ_REG:MOUTH:TONGUE:RODENT_TEETH:RIBCAGE]
[BODYGLOSS:PAW]
[GRASSTRAMPLE:0]
[BODY_DETAIL_PLAN:STANDARD_MATERIALS]
[BODY_DETAIL_PLAN:STANDARD_TISSUES]
[BODY_DETAIL_PLAN:VERTEBRATE_TISSUE_LAYERS:SKIN:FAT:MUSCLE:BONE:CARTILAGE]
[BODY_DETAIL_PLAN:BODY_HAIR_TISSUE_LAYERS:HAIR]
[USE_MATERIAL_TEMPLATE:NAIL:NAIL_TEMPLATE]
[USE_TISSUE_TEMPLATE:NAIL:NAIL_TEMPLATE]
[TISSUE_LAYER:BY_CATEGORY:TOE:NAIL:FRONT]
[SELECT_TISSUE_LAYER:HEART:BY_CATEGORY:HEART]
[PLUS_TISSUE_LAYER:SKIN:BY_CATEGORY:THROAT]
[TL_MAJOR_ARTERIES]
[BODY_DETAIL_PLAN:STANDARD_HEAD_POSITIONS]
[BODY_DETAIL_PLAN:HUMANOID_RIBCAGE_POSITIONS]
[USE_MATERIAL_TEMPLATE:SINEW:SINEW_TEMPLATE]
[TENDONS:LOCAL_CREATURE_MAT:SINEW:200]
[LIGAMENTS:LOCAL_CREATURE_MAT:SINEW:200]
[HAS_NERVES]
[USE_MATERIAL_TEMPLATE:BLOOD:BLOOD_TEMPLATE]
[BLOOD:LOCAL_CREATURE_MAT:BLOOD:LIQUID]
[CREATURE_CLASS:GENERAL_POISON]
[GETS_WOUND_INFECTIONS]
[GETS_INFECTIONS_FROM_ROT]
[USE_MATERIAL_TEMPLATE:PUS:PUS_TEMPLATE]
[PUS:LOCAL_CREATURE_MAT:PUS:LIQUID]
[BODY_SIZE:0:0:80]
[BODY_SIZE:0:168:400]
[BODY_SIZE:1:0:800]
[BODY_APPEARANCE_MODIFIER:LENGTH:90:95:98:100:102:105:110]
[BODY_APPEARANCE_MODIFIER:HEIGHT:90:95:98:100:102:105:110]
[BODY_APPEARANCE_MODIFIER:BROADNESS:90:95:98:100:102:105:110]
[MAXAGE:4:8]
[ATTACK:BITE:CHILD_BODYPART_GROUP:BY_CATEGORY:HEAD:BY_CATEGORY:TOOTH]
[ATTACK_SKILL:BITE]
[ATTACK_VERB:bite:bites]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PREPARE_AND_RECOVER:3:3]
[ATTACK_PRIORITY:MAIN]
[ATTACK_FLAG_CANLATCH]
[ATTACK:SCRATCH:CHILD_TISSUE_LAYER_GROUP:BY_TYPE:STANCE:BY_CATEGORY:ALL:NAIL]
[ATTACK_SKILL:GRASP_STRIKE]
[ATTACK_VERB:scratch:scratches]
[ATTACK_CONTACT_PERC:100]
[ATTACK_PENETRATION_PERC:100]
[ATTACK_FLAG_EDGE]
[ATTACK_PREPARE_AND_RECOVER:3:3]
[ATTACK_PRIORITY:SECOND]
[DIURNAL]
[HOMEOTHERM:10067]
[APPLY_CREATURE_VARIATION:STANDARD_QUADRUPED_GAITS:900:707:513:283:1900:2900] 31 kph
[APPLY_CREATURE_VARIATION:STANDARD_SWIMMING_GAITS:9000:8900:8825:8775:9500:9900] 1 kph, NO DATA
[APPLY_CREATURE_VARIATION:STANDARD_CRAWLING_GAITS:9000:8900:8825:8775:9500:9900] 1 kph, NO DATA
[SWIMS_INNATE]
[MUNDANE]
[CASTE:FEMALE]
[CASTE_NAME:brave cavy sow:brave cavy sows:brave cavy sow]
[FEMALE]
[CASTE:MALE]
[CASTE_NAME:brave cavy boar:brave cavy boars:brave cavy boar]
[MALE]
[SET_BP_GROUP:BY_TYPE:LOWERBODY][BP_ADD_TYPE:GELDABLE]
[SELECT_CASTE:ALL]
[SET_TL_GROUP:BY_CATEGORY:ALL:HAIR]
[TL_COLOR_MODIFIER:BLACK:1:BROWN:1:WHITE:1:GRAY:1:LIGHT_BROWN:1:DARK_BROWN:1:TAN:1:AUBURN:1:CHESTNUT:1:SLATE_GRAY:1:CREAM:1:CINNAMON:1:BUFF:1:BEIGE:1:CHOCOLATE:1:CHARCOAL:1:ASH_GRAY:1:RUSSET:1:IVORY:1:FLAX:1:PUMPKIN:1:GOLD:1:GOLDEN_YELLOW:1:GOLDENROD:1:COPPER:1:SAFFRON:1:AMBER:1:MAHOGANY:1:OCHRE:1:PALE_BROWN:1:RAW_UMBER:1:BURNT_SIENNA:1:BURNT_UMBER:1:SEPIA:1:DARK_TAN:1:PALE_CHESTNUT:1:DARK_CHESTNUT:1:TAUPE_PALE:1:TAUPE_DARK:1:TAUPE_SANDY:1:TAUPE_GRAY:1:TAUPE_MEDIUM:1:ECRU:1]
[TLCM_NOUN:hair:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:ALL:SKIN]
[TL_COLOR_MODIFIER:BROWN:1:BURNT_UMBER:1:CINNAMON:1:COPPER:1:DARK_BROWN:1:DARK_PEACH:1:DARK_TAN:1:ECRU:1:PALE_BROWN:1:PALE_CHESTNUT:1:PALE_PINK:1:PEACH:1:PINK:1:RAW_UMBER:1:SEPIA:1:TAN:1:TAUPE_PALE:1:TAUPE_SANDY:1]
[TLCM_NOUN:skin:SINGULAR]
[SET_TL_GROUP:BY_CATEGORY:EYE:EYE]
[TL_COLOR_MODIFIER:BLACK:1]
[TLCM_NOUN:eyes:PLURAL]
Interaction txt:
interaction_chains_brave_cavies
[OBJECT:INTERACTION]
[INTERACTION:FIGHTING]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CREATURE]
[IT_LOCATION:CONTEXT_CREATURE]
[IT_CANNOT_HAVE_SYNDROME_CLASS:CURRENTLY_FIGHTING]
[IT_CANNOT_TARGET_IF_ALREADY_AFFECTED]
[IT_FORBIDDEN:CAN_LEARN]
[I_EFFECT:ADD_SYNDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
[SYNDROME]
[SYN_NAME:fighting]
[SYN_CLASS:CURRENTLY_FIGHTING]
[SYN_NO_HOSPITAL]
[CE_ADD_TAG:CAN_LEARN:START:0:END:8:ABRUPT:DWF_STRETCH:144]