Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How to keep the AI from using an interaction?  (Read 992 times)

RenoFox

  • Bay Watcher
    • View Profile
How to keep the AI from using an interaction?
« on: November 11, 2012, 10:49:27 am »

I made an interaction that knocks out unwanted followers without counting as a hostile action, but the problem is that the NPC humans use it as well. Usage hint GREETING makes them knock each other out, ATTACK makes them overpowered in combat, and no usage hint means they will use it at every chance they get.

So, how can I make an interaction that only the player actually uses?

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: How to keep the AI from using an interaction?
« Reply #1 on: November 11, 2012, 10:56:17 am »

Reaction that creates a consumable material that gives the player this interaction

I.E

Make Magic Meat
Eat meat
Gain Power.
Logged

Ieb

  • Bay Watcher
  • A Breakdancing Ogre
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #2 on: November 11, 2012, 11:39:19 am »

Make a caste within the creature you wish to travel with which is the only caste able to use the interaction, and add POP_RATIO:0 to it to keep it from spawning during worldgen?
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #3 on: November 11, 2012, 11:42:04 am »

They still spawn. The POP_RATIO defaults to 1.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

RenoFox

  • Bay Watcher
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #4 on: November 11, 2012, 12:02:27 pm »

Reaction that creates a consumable material that gives the player this interaction

I.E

Make Magic Meat
Eat meat
Gain Power.

That is brilliant! Not only would that work, it would work for any creature you'll adventure as!

Now I hate to ask something so general, but how do I do that? I have successfully made reactions to spawn nonspecific meat and cheese, but how do I make food that carries a syndrome?

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #5 on: November 11, 2012, 12:07:58 pm »

Reaction that creates a consumable material that gives the player this interaction

I.E

Make Magic Meat
Eat meat
Gain Power.

That is brilliant! Not only would that work, it would work for any creature you'll adventure as!

Now I hate to ask something so general, but how do I do that? I have successfully made reactions to spawn nonspecific meat and cheese, but how do I make food that carries a syndrome?

The same way you make any material that imparts a syndrome.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution
Re: How to keep the AI from using an interaction?
« Reply #6 on: November 11, 2012, 12:23:10 pm »

only a material from a CREATURE or PLANT can be consumed, so you have to add in a new material into either

Add this to any creature I'll pick DOG for now:

Code: [Select]
[USE_MATERIAL_TEMPLATE:MAGIC_MEAT:MUSCLE_TEMPLATE]
[STATE_NAME_ADJ:ALL_SOLID:magic meat]
[STATE_NAME_ADJ:LIQUID:magic meat juice]
[STATE_NAME_ADJ:GAS:magic meat smoke]
[MATERIAL_VALUE:10]
[DISPLAY_COLOR:5:0:0]
[EDIBLE_RAW]
[PREFIX:NONE] --- this removes "dog" from the front, thus allowing just "magic meat" to display
[SYNDROME]
[SYN_NAME:Gained Meat Power]
[SYN_CONTACT]
[SYN_INHALED]
[SYN_INJECTED]
[SYN_INGESTED]---- This one is the most important
[CE_CAN_DO_INTERACTION:START:0:END:5000]
[CDI:INTERACTION:<Your Interaction Here>]
[CDI:ADV_NAME:xxxxxxx]
[CDI:TARGET_RANGE:A:##]
[CDI:MAX_TARGET_NUMBER:A:##]
[CDI:WAIT_PERIOD:###]

then make a reaction that creates MEAT:NONE:CREATURE_MAT:DOG:MAGIC_MEAT
Logged

Ieb

  • Bay Watcher
  • A Breakdancing Ogre
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #7 on: November 11, 2012, 12:25:58 pm »

They still spawn. The POP_RATIO defaults to 1.

The more I know. /stupid
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #8 on: November 11, 2012, 01:20:11 pm »

only a material from a CREATURE or PLANT can be consumed, so you have to add in a new material into either

Really? You can't have an [EDIBLE_RAW] inorganic that you use to make a CHEESE item?

RenoFox

  • Bay Watcher
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #9 on: November 11, 2012, 02:00:56 pm »

I made a new creature called "food source" with [DOES_NOT_EXIST], added MAGIC_MEAT_TEMPLATE to material_template.txt and [USE_MATERIAL_TEMPLATE:ALL:MAGIC_MEAT_TEMPLATE] to the food source creature. Now the adventurer can spawn "food source magic meat chops". To test it, I gave the MAGIC_MEAT_TEMPLATE the giant cave spider venom syndrome modified with [SYN_CONTACT], [SYN_INHALED] and [SYN_INGESTED] tags, but eating it didn't have any effect.

Also, the errorlog says: "MAGIC_MEAT_TEMPLATEUnrecognized Material Template Token: PREFIX".

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #10 on: November 11, 2012, 02:04:43 pm »

Well, you should be using the default muscle template for the magic meat and have the syndrome defined in the creature's material definition.

RenoFox

  • Bay Watcher
    • View Profile
Re: How to keep the AI from using an interaction?
« Reply #11 on: November 11, 2012, 02:57:05 pm »

It works! Just goes to show how little I understand about templates. Thanks for all the help!