Jump to content

[LE] Combat dialogue reactions for NPCs


nikolaf

Recommended Posts

I want to create a dialogue response for a combat taunt.

To put it simply: NPC_A speaks a line like "tighten the line!" and then NPC_B answers with "yes, sir!". And not like 'speaking to one another' ( i.e. staring at each other during combat ).

 

Does anyone know if it can be done, and if yes, how?

Link to comment
Share on other sites

Unless you mean it to be two specific actors interacting, the hardest part will probably be to figure out who else is currently in combat with the player that can answer the first line of dialogue. But apart from that, here's a few ideas:

 

If set up properly, scenes can function even when the involved actors are in combat. You could try playing a custom scene at random times during a combat.

 

You can also make the triggering line of Taunt dialogue run the Say method on another actor -- only you'll have to make sure that the actor in question is not already speaking, because otherwise the game will CTD.

Link to comment
Share on other sites

Good, then my two ideas above still apply.

 

You can make a quest scene including NPC_A and NPC_B. A possible way to achieve the scene being played randomly, is by registering for updates when NPC_A enters combat, and then make it play at random OnUpdate.

 

Or you can use the Say() method. Make a Taunt topic info for NPC_A with a script fragment telling NPC_B to Say() something if he's not already speaking.

Link to comment
Share on other sites

Just have a look at the wiki page for Say(). If you don't know how to script in general, make sure to read some tutorials on the subject. There's quite a few available if you google it.

akSpeaker.Say(myResponseTopicProperty)

Also, if that doesn't work out, you could make a mixture of both my ideas. Create a scene only consisting of NPC_B saying the response, and make that scene play in the Taunt info fragment of NPC_A:

myResponseSceneProperty.Start()
Link to comment
Share on other sites

Well I tried to make a script that would use the say() function, but I'm not sure if I'm missing something...

 

Where do I specify which topic info I want the npc to speak?

Currently it looks like this:

 

Scriptname GodricsOrders extends TopicInfo
actor GodricsSquire
Topic Property CombatTopicToSay Auto
Event OnInit()
If GodricsSquire.IsInCombat() == 1
Utility.Wait(2.0)
GodricsSquire.Say(CombatTopicToSay)
EndIf
EndEvent
Link to comment
Share on other sites

For some reason, compiling the script fragment yields a "no viable alternative" for the topicinfo property...

 

Also the one I made for the "big" script tab is saying there is a "type mismatch on parameter 1 (did you forget a cast?)", and I can't add a property to the topic info (only "none")

Still not sure what is wrong with it, though:

 

Scriptname GodricOrder extends TopicInfo
Actor GodricsSquire
TopicInfo Property GodricsOrders Auto
Event OnInit()
Utility.Wait(2.0)
GodricsSquire.Say(GodricsOrders)
EndEvent
Link to comment
Share on other sites

Start over. Remove your earlier script, delete it. You never need to edit the topic info script anywhere else than in the script fragments. Don't make properties manually, don't use an OnInit event, etc., etc.

 

The only thing you need to do, is create the two properties, fill them, and write that one single line of code in the end fragment field.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...