Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: help with custom interaction please  (Read 1521 times)

Geltor

  • Bay Watcher
    • View Profile
help with custom interaction please
« on: December 26, 2015, 11:13:19 am »

heres my first attempt at modding. im trying to add two interactions. one which will cause my adventurer to stop being hungry/thirsty, and the other to remove those effects if i want to add my adventurer to the ranks of fortress denizens. im trying to make it as simple as possible, mostly by making it a self only ability and classify it as an attack to prevent npcs from using it. when  i load up a human adventurer, two "Unknown interaction" abilities show up under the innate abilities, but they dont do anything. heres what i got:


in creature_standard, under [HUMAN]
Code: [Select]
[CREATURE:HUMAN]
[DESCRIPTION:A medium-sized creature prone to great ambition.]
[NAME:human:humans:human]
[CASTE_NAME:human:humans:human]
[OUTSIDER_CONTROLLABLE]
[CREATURE_TILE:'U'][COLOR:3:0:0]
[CREATURE_SOLDIER_TILE:154]
[INTELLIGENT]
[CANOPENDOORS]
[BENIGN]

[CAN_DO_INTERACTION:DIVINE_FAVOR]
[CDI:ADV_NAME:Fast]
[CDI:USAGE_HINT:ATTACK]
[CAN_DO_INTERACTION:DIVINE_UNFAVOR]
[CDI:ADV_NAME:Consumption]
[CDI:USAGE_HINT:ATTACK]
etc...
under interactions_standard
Code: [Select]
[INTERACTION:DIVINE_FAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:CREATURE]
[I_USAGE:ATTACK]
[IT_FORBIDDEN:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:CREATURE]
[IE_IMMEDIATE]
[SYNDROME]
[SYN_NAME:divine favor]
[CE_ADD_TAG:NO_EAT:NO_DRINK]

[INTERACTION:DIVINE_UNFAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:CREATURE]
[I_USAGE:ATTACK]
[IT_REQUIRES:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:CREATURE]
[IE_IMMEDIATE]
[SYNDROME]
[SYN_NAME:divine unfavor]
[CE_REMOVE_TAG:NO_EAT:NO_DRINK]

what did i do wrong?
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: help with custom interaction please
« Reply #1 on: December 26, 2015, 12:39:16 pm »

You are missing START:0 in the effects. [CE_ADD_TAG:NO_EAT:NO_DRINK] should be [CE_ADD_TAG:NO_EAT:NO_DRINK:START:0]. Also, I_USAGE:ATTACK in the interactions themselves is not needed.

Here's a fixed version:
Code: [Select]
[INTERACTION:DIVINE_FAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:CREATURE]
                [IT_LOCATION:CONTEXT_CREATURE]
[IT_FORBIDDEN:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:CREATURE]
[IE_IMMEDIATE]
[SYNDROME]
               [SYN_NAME:divine favor]
               [CE_ADD_TAG:NO_EAT:NO_DRINK:START:0]

[INTERACTION:DIVINE_UNFAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:CREATURE]
                [IT_LOCATION:CONTEXT_CREATURE]
[IT_REQUIRES:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:CREATURE]
[IE_IMMEDIATE]
[SYNDROME]
               [SYN_NAME:divine unfavor]
               [CE_REMOVE_TAG:NO_EAT:NO_DRINK:START:0]

In general, the errorlog should tell you what is wrong with stuff, which helps speed up things rather than awaiting an answer.
« Last Edit: December 26, 2015, 12:42:34 pm by Teneb »
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Geltor

  • Bay Watcher
    • View Profile
Re: help with custom interaction please
« Reply #2 on: December 26, 2015, 01:12:01 pm »

You are missing START:0 in the effects. [CE_ADD_TAG:NO_EAT:NO_DRINK] should be [CE_ADD_TAG:NO_EAT:NO_DRINK:START:0]. Also, I_USAGE:ATTACK in the interactions themselves is not needed.

Here's a fixed version:
Code: [Select]
[INTERACTION:DIVINE_FAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:CREATURE]
                [IT_LOCATION:CONTEXT_CREATURE]
[IT_FORBIDDEN:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:CREATURE]
[IE_IMMEDIATE]
[SYNDROME]
               [SYN_NAME:divine favor]
               [CE_ADD_TAG:NO_EAT:NO_DRINK:START:0]

[INTERACTION:DIVINE_UNFAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:CREATURE]
                [IT_LOCATION:CONTEXT_CREATURE]
[IT_REQUIRES:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:CREATURE]
[IE_IMMEDIATE]
[SYNDROME]
               [SYN_NAME:divine unfavor]
               [CE_REMOVE_TAG:NO_EAT:NO_DRINK:START:0]

In general, the errorlog should tell you what is wrong with stuff, which helps speed up things rather than awaiting an answer.
didnt know there was an errorlog. even after applying your fixed version, the problem i described persists, but the error log reveals this:
Code: [Select]
*** Error(s) found in the file "data/save/region1/raw/objects/interaction_standard.txt"
DIVINE_FAVOR:Unrecognized Interaction Token: IT_LOCATION
DIVINE_FAVOR:Unrecognized Interaction Token: IT_FORBIDDEN
DIVINE_FAVOR:Unrecognized Interaction Effect Type: ADD_SNYDROME
DIVINE_FAVOR:Unrecognized Interaction Token: IE_TARGET
DIVINE_FAVOR:Unrecognized Interaction Token: IE_IMMEDIATE
DIVINE_FAVOR:Unrecognized Interaction Token: SYNDROME
DIVINE_FAVOR:Unrecognized Interaction Token: SYN_NAME
DIVINE_FAVOR:Unrecognized Interaction Token: CE_ADD_TAG
DIVINE_UNFAVOR:Unrecognized Interaction Token: IT_LOCATION
DIVINE_UNFAVOR:Unrecognized Interaction Token: IT_REQUIRES
DIVINE_UNFAVOR:Unrecognized Interaction Effect Type: ADD_SNYDROME
DIVINE_UNFAVOR:Unrecognized Interaction Token: IE_TARGET
DIVINE_UNFAVOR:Unrecognized Interaction Token: IE_IMMEDIATE
DIVINE_UNFAVOR:Unrecognized Interaction Token: SYNDROME
DIVINE_UNFAVOR:Unrecognized Interaction Token: SYN_NAME
DIVINE_UNFAVOR:Unrecognized Interaction Token: CE_REMOVE_TAG
*** Error(s) finalizing the creature HUMAN
Interaction Token not recognized : DIVINE_FAVOR
Interaction Token not recognized : DIVINE_UNFAVOR
Interaction Token not recognized : DIVINE_FAVOR
it all seems to be in order, so why does it not recognize it?
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: help with custom interaction please
« Reply #3 on: December 26, 2015, 03:34:57 pm »

I fucked up and forgot to fix something else. I've also included what you should place in your creature and commented it so you can understand it.


The interactions
Code: [Select]
[INTERACTION:DIVINE_FAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CREATURE] The "A" (which can be called anything you want, but is needed) is important since you can actually set various targets
                [IT_LOCATION:CONTEXT_CREATURE]
[IT_FORBIDDEN:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:A] "A" will get hit with this.
[IE_IMMEDIATE]
[SYNDROME]
               [SYN_NAME:divine favor]
               [CE_ADD_TAG:NO_EAT:NO_DRINK:START:0]

[INTERACTION:DIVINE_UNFAVOR]
[I_SOURCE:CREATURE_ACTION]
[I_TARGET:A:CREATURE]
                [IT_LOCATION:CONTEXT_CREATURE]
[IT_REQUIRES:NO_EAT:NO_DRINK]
[I_EFFECT:ADD_SNYDROME]
[IE_TARGET:A]
[IE_IMMEDIATE]
[SYNDROME]
               [SYN_NAME:divine unfavor]
               [CE_REMOVE_TAG:NO_EAT:NO_DRINK:START:0]

What you should place in your creature
Code: [Select]
[CAN_DO_INTERACTION:DIVINE_FAVOR]
[CDI:ADV_NAME:Divine Favor]
[CDI:TARGET:A:SELF_ONLY]
[CDI:TARGET_RANGE:A:1] Doesn't matter
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:TARGET_VERB:no longer feel hunger or thirst:NA:NA] Will appear when you use it. Handy to know if it actually works without waiting.
[CDI:FREE_ACTION] Does not count as an action and thus should not pass time in adventure mode
[CDI:WAIT_PERIOD:3] Set it to whatever you want
[CAN_DO_INTERACTION:DIVINE_UNFAVOR]
[CDI:ADV_NAME:Divine Unfavor]
[CDI:TARGET:A:SELF_ONLY]
[CDI:TARGET_RANGE:A:1]
[CDI:MAX_TARGET_NUMBER:A:1]
[CDI:TARGET_VERB:again feel hunger and thirst:NA:NA]
[CDI:FREE_ACTION]
[CDI:WAIT_PERIOD:3]
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Zerosaiko

  • Escaped Lunatic
    • View Profile
Re: help with custom interaction please
« Reply #4 on: December 26, 2015, 08:27:43 pm »

In these raws, the [I_EFFECT:ADD_SYNDROME]'s are all misspelled as [I_EFFECT:ADD_SNYDROME], which might be causing a lot of your problems.
Logged

Teneb

  • Bay Watcher
  • (they/them) Penguin rebellion
    • View Profile
Re: help with custom interaction please
« Reply #5 on: December 26, 2015, 09:38:47 pm »

In these raws, the [I_EFFECT:ADD_SYNDROME]'s are all misspelled as [I_EFFECT:ADD_SNYDROME], which might be causing a lot of your problems.
I miss notepad++'s spellchecker. So bad.
Logged
Monstrous Manual: D&D in DF
Quote from: Tack
What if “slammed in the ass by dead philosophers” is actually the thing which will progress our culture to the next step?

Geltor

  • Bay Watcher
    • View Profile
Re: help with custom interaction please
« Reply #6 on: December 27, 2015, 10:03:11 am »

Thanks for the help. The name of the ability now appears in the 'x' menu under innate abilities and the message is shown when activated, however the effects of NO_EAT and NO_DRINK don't work. There is also no error log this time. What could be the problem?
Nevermind, it was my bad.

How can I add this ability to every creature instead of having to manually insert it in creatures_standard?

Lastly, I've added the [IT_REQUIRES:NO_EAT:NO_DRINK] in the interaction in hopes that if you did one, you cannot do it again and can only do the other. (ie: if you disable hunger, you can only enable it, and not disable it again and vis versa) That doesn't seem to work. Any suggestions?
« Last Edit: December 27, 2015, 10:14:12 am by Geltor »
Logged

Trainzack

  • Bay Watcher
  • The universe is, and we are.
    • View Profile
Re: help with custom interaction please
« Reply #7 on: December 27, 2015, 12:51:09 pm »

Well, you can do all the animal people at once by modifying the creature variations in c_variation_default.txt (ANIMAL_PERSON and ANIMAL_PERSON_LEGLESS).

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: help with custom interaction please
« Reply #8 on: December 29, 2015, 12:28:42 am »

Thanks for the help. The name of the ability now appears in the 'x' menu under innate abilities and the message is shown when activated, however the effects of NO_EAT and NO_DRINK don't work. There is also no error log this time. What could be the problem?
Nevermind, it was my bad.

How can I add this ability to every creature instead of having to manually insert it in creatures_standard?

Lastly, I've added the [IT_REQUIRES:NO_EAT:NO_DRINK] in the interaction in hopes that if you did one, you cannot do it again and can only do the other. (ie: if you disable hunger, you can only enable it, and not disable it again and vis versa) That doesn't seem to work. Any suggestions?
The easiest way to make this available to all creatures for adventure mode purposes is to attach the interactions to a fruit of some kind and then make that fruit available through a resource-free adventure mode reaction, and only through that reaction. Then when you want to gain the interaction you just use that reaction and eat the fruit.
Logged
Fame is a vapor. The only earthly certainty is oblivion.