How do I make the AI repeatedly use voice lines (like in Tamar's campaign)?

I’m making a campaign and in some scenarios I use taunts to give orders to the AI and (by using signals) the player is displaying a dialogue, just like in the 4th scenario of Tamar’s campaign, where the Armenians are shouting “For Tamar!”.

The problem is that once I use the taunt, the player doesn’t use the sound anymore.

Does anyone know how can I fix it?

Don’t know for taunts but for the signal you could use “object in area”, select flare and remember to select “resource” in the window on the right. Then “task object” to attack move where the flare is.
If you want it to repeat loop it with a timer of 30 or something so the message doesn’t pop up continually.

I don’t have a problem with making the AI attack a certain opponent/player. All I am interested is the repeating of the voice line, every time I taunt it, not every 30 or so seconds.

Well, I only know how to do this with chat commands, Haven’t personally experimented with how to do it with flares yet.

Firstly you need to have a trigger with the condition ‘AI Signal’ Let’s say for example set it to 119.
Then you would want to have an effect which is ‘Acknowledge a.i signal’ (also set it to 119).
You can also add a ‘display instructions’ or any other effects you need, and you should probably set the trigger to looping if you want it to continuously activate when you type that number.

Then you need to add in the script for the a.i. Here is some of the code in an A.I file, although you might need some more lines, these are just some of the essential ones.

image

Oh and incase it wasn’t clear, this is for when the player types 119 into the chat.

1 Like

Yes. I have used an AI code to make it work, as well as Display Instructions and it works just fine, but only for the first time. Setting the trigger to loop though will result in the player using the voice line repeatedly, even if I don’t use the taunt. That’s what I want to avoid.

If you truly do have all of those lines, AND the trigger effect Acknowledge a.i signal’ then it should only trigger when you type the number in the chat.

You may however need 2 different defrules to loop the a.i script.

Yes. It only triggers once, even though I type it more than once.

Could you send screenshots of your A.I script and the Scenario editor trigger? Otherwise I’ll just be stabbing in the dark.

This is the AI:

(defrule
(taunt-detected 1 205)
(military-population greater-than 18)
=>
(acknowledge-taunt 1 205)
(set-strategic-number sn-focus-player-number 5)
(set-strategic-number sn-target-player-number 5)
(set-strategic-number sn-minimum-attack-group-size 1)
(set-strategic-number sn-maximum-attack-group-size 40)
(set-strategic-number sn-percent-attack-soldiers 100)
(attack-now)
(set-goal attack-goal standby)
(set-signal 1)
)

And this is the trigger:

image

image

should be like that.

Doesn’t work.

Why the 119 though?

Just Random number I used as an example.

For your trigger you would want to use 205

That doesn’t work either. I also tried 1, but it didn’t work.

I think perhaps the issue may be in your A.I script too then. Where it say’s (set-signal 1) maybe change that to (set-signal 205) as well.

That doesn’t work either. Maybe there should be a change in the AI that resets the signal.

I’ll send a script from an a.i I have where it attacks a certain player upon command and then it will have a voice line everytime you send the chat.

;Attack Player 2
(defrule
(player-in-game 2)
(taunt-detected any-ally 62)
=>
(set-signal 62)
(acknowledge-event trigger 62)
(up-reset-attack-now)
(acknowledge-taunt 1 62)
(set-strategic-number sn-focus-player-number 2)
(set-strategic-number sn-target-player-number 2)
(attack-now)
(enable-timer 19 5)
)

;Attack new Target 1
(defrule
(timer-triggered 19)
=>
(set-strategic-number sn-percent-attack-boats 70)
(set-strategic-number sn-percent-attack-soldiers 98)
(attack-now)
(disable-timer 19)
)

No need to copy this exact script, Just look at some of the essentials.

remember to also have the trigger where the a.i signal and acknowledge a.i signal to be looping.

hopefully it helps.