Taunts and Triggers

Article written by Dark_Warrior_1_ (Hosted with permission from Woad Creations)
Published on 12-07-2008; updated on 08-17-2014
Tags: AI, Dialogue

I.) Ok first i will explain what the AI script means then how to set it up with the triggers.

(defrule

(taunt-detected 1 1)

The first number is the player the second number is the taunt you want to type and have it do something.

=>

(acknowledge-taunt 1 1) This acknowledges the taunt you typed and the player.

(cc-add-resource wood 40) This is how it gets incorporated into the triggers example. For the taunt number 1 you want it to be 40 wood for the taunt number 2 you want it to be 39 wood etc.

II.) Now I will show you how to set up the triggers.

This is for the taunt number one for different number just increase or decrease, the Accumulate Attribute condition and the tribute effect.

First you need to download the AI from the link at the top of the page then set it to a player. (Ed. note: download unavailable)

Condition 0: Accumulate Attribute-40 wood-The Player you have the AI set to.

Effect 0: (The First effect must be this)-Tribute-40 wood-to the player the AI is set to.

The Next effect can be whatever you want it to do. You can also add more conditions if you like.

III.) Facts and Information about this system.

So if you say 1 (Yes) the AI file will tribute 40 wood to player 3 and the condition of Accumulate Attribute - Wood Stockpile 40 will be met.

Next in order to be able to use the trick again you will need to tribute all of player 3's wood so it is set back to 0.

You will then need to set up 3 Triggers for this to work properly.

One for the Question

One for the Yes answer

One for the No answer

When the player answers the question use an effect in both answers to deactivate the one that wasn't used that way it wont trigger when a player uses the taunt in a different location.

So if the player says Yes to buy a chain mail use an effect in the Yes trigger to deactivate the No triggers. If the player says No use an effect to deactivate the Yes answer and reactivate the question so when the player comes back the blacksmith will ask him again.

If you use the "Select Object" condition for the question make sure you change the ownership of the object to player one and back in the No answer so it doesn't keep repeating the question if the object is selected. Changing the ownership of the object to player one and back will deselect the object.

What is this trick good for? Well let's say you have an RPG where you want the player to be able to reply to questions. This trick is exactly how you can do that.

For example the player goes to a blacksmith and he says "Would you like to buy a chain mail? (1=Yes) (2=No)"

The player can then use taunts to answer the question. Make sure you put the timer of display instructions on for a long time because if it just goes away there is no need to actually answer the question and the AI wont work properly.

This trick is also great for casting Magic Spells in battle.

Make note that if the player uses any taunts during game play when they are not supposed to it will make the AI send the tribute at any time it is used. This creates problems because when the player does go to a shop that requires taunts it will be automatically answered. So make sure you explain this in your scenario.

Use your imagination the possibilities are endless.

If you need still more help just E-mail me at Dark_Warrior_1_ [at] hotmail [dot] com

I did not create this by any means it was introduced to me by Garrett