nikolaf Posted December 17, 2018 Share Posted December 17, 2018 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 More sharing options...
TheWormpie Posted December 17, 2018 Share Posted December 17, 2018 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 More sharing options...
nikolaf Posted December 17, 2018 Author Share Posted December 17, 2018 Thanks for the reply! If you mean the npcs should be referred to by their RefID, then sure. It was meant for two specific npcs. Let's call them NPC_A and NPC_B - how would it work? Link to comment Share on other sites More sharing options...
TheWormpie Posted December 18, 2018 Share Posted December 18, 2018 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 More sharing options...
nikolaf Posted December 18, 2018 Author Share Posted December 18, 2018 Your second option is what I was leaning towards more. Alas, I don't know how to make a script to trigger a spoken line yet. Can you show me what it should look like?Thanks for the advice! :smile: Link to comment Share on other sites More sharing options...
TheWormpie Posted December 19, 2018 Share Posted December 19, 2018 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 More sharing options...
nikolaf Posted December 19, 2018 Author Share Posted December 19, 2018 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 GodricsSquireTopic 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 More sharing options...
TheWormpie Posted December 19, 2018 Share Posted December 19, 2018 NPC_B.Say(yourTopic) is all you need. :) Create a taunt topic info. Put the above snippet in the script fragment of that topic info. Create a script property for "yourTopic" and another for NPC_B. Fill the properties. Done. Link to comment Share on other sites More sharing options...
nikolaf Posted December 19, 2018 Author Share Posted December 19, 2018 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 GodricsSquireTopicInfo Property GodricsOrders Auto Event OnInit() Utility.Wait(2.0) GodricsSquire.Say(GodricsOrders) EndEvent Link to comment Share on other sites More sharing options...
TheWormpie Posted December 20, 2018 Share Posted December 20, 2018 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 More sharing options...
Recommended Posts