Aller au contenu

Photo

How can I get henchmen to play their "bored" voice?


  • Veuillez vous connecter pour répondre
10 réponses à ce sujet

#1
Grymlorde

Grymlorde
  • Members
  • 227 messages

There are some voicesets that include a "bored" speech that isn't heard in game as far as I know. What I'd like to do is have henchmen say the "bored" speech when they are bored. You can tell when they are bored or idle because that's when the model plays the stretch & yawn animation -- so clearly the engine is recognizing the event, just not playing the sound.

 

I've looked through the Omnibus as well as the Lexicon and can't find anything on this. Any ideas?



#2
Proleric

Proleric
  • Members
  • 2 361 messages
Did you try giving the following action to the henchman?

PlayVoiceChat(VOICE_CHAT_BORED);

#3
Grymlorde

Grymlorde
  • Members
  • 227 messages

Did you try giving the following action to the henchman?

PlayVoiceChat(VOICE_CHAT_BORED);

 

No, not yet. How do I capture the event when the henchmen is bored or idle?



#4
Proleric

Proleric
  • Members
  • 2 361 messages
You'd need to drill down into the henchman heartbeat event script to find the definitive answer, but I would't be surprised if the bored animation is generated randomly by PlayImmobileAmbientAnimations() rather than an explicit call that can be intercepted.

If so, you might disable that behaviour by commenting out

SetSpawnInCondition (NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);

on spawn, adding "act bored" code on heartbeat that explicitly plays both the animation and the voicechat.

EDIT : now I'm back at my desk, I can see that the bored animation is indeed played by PlayImmobileAmbientAnimations() in x0_i0_anims, but, short of recompiling all Bioware scripts that contain or inherit it, my advice remains the same! x0_d1_g1_bored does both the animation and the chat, but you'd need to change the first line to make it a henchman rather than a PC.

Modifié par Proleric, 09 mars 2014 - 10:52 .

  • Grymlorde aime ceci

#5
Grymlorde

Grymlorde
  • Members
  • 227 messages

You'd need to drill down into the henchman heartbeat event script to find the definitive answer, but I would't be surprised if the bored animation is generated randomly by PlayImmobileAmbientAnimations() rather than an explicit call that can be intercepted.

If so, you might disable that behaviour by commenting out

SetSpawnInCondition (NW_FLAG_IMMOBILE_AMBIENT_ANIMATIONS);

on spawn, adding "act bored" code on heartbeat that explicitly plays both the animation and the voicechat.

EDIT : now I'm back at my desk, I can see that the bored animation is indeed played by PlayImmobileAmbientAnimations() in x0_i0_anims, but, short of recompiling all Bioware scripts that contain or inherit it, my advice remains the same! x0_d1_g1_bored does both the animation and the chat, but you'd need to change the first line to make it a henchman rather than a PC.

 

Thanks Proleric! I'll give it a shot.



#6
Grymlorde

Grymlorde
  • Members
  • 227 messages

Now I can't get the henchmen to shut up. . . :P

 

Here's what I did:

 

In the spawn script I changed the SpawnInCondition to NW_FLAG_HEARTBEAT_EVENT

 

In the user defined script I wrote

 

if (nEvent == 1001)

{

     DelayCommond(60.0f, ExecuteScript("hen_bored", OBJECT_SELF));

}

 

Hen_Bored is:

void main()

{

     PlayVoiceChat(VOICE_CHAT_BORED, OBJECT_SELF);

     AssignCommand(OBJECT_SELF, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED));

}

 

While the initial boredom complaint happens after 60 seconds, it then fires every hearbeat thereafter. And what's weird (or hillarious) is that if the master runs away from the annoying henchman, the henchman follows hims (as he's supposed to) but stops every heartbeat to complain of boredom. In the fact the henchman's ennui is so overwhelming that after each monster he kills, he announces to the world that he's bored before proceeding to kill the next goblin!

 

How can get this poor guy to stop complaining every heartbeat?



#7
Grymlorde

Grymlorde
  • Members
  • 227 messages

Fixed it!

 

I changed Hen_Bored to:

 

void main()

{

     int nResult;

     nResult = d4();

     If (nResult==4)

     {

          PlayVoiceChat(VOICE_CHAT_BORED, OBJECT_SELF);

          AssignCommand(OBJECT_SELF, PlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED));

     }

}

 

 

Now I'm debating having the variable based on wisdom, e.g. d4 for Low Wisdom, d6 for Average Wisdom, etc. I haven't decided if I'll go that far but it does what I need for now.

 

Unless there is a better way. . .?

 

Cheers!



#8
Proleric

Proleric
  • Members
  • 2 361 messages
That's it, in essence.

I'm not sure why you wait 60 seconds? Maybe better to speak immediately, as who knows what might happen in the interim?

I use a system which queues companion interjections, interrupting the player on heartbeat, but only when idle (this to prevent important discussions being cancelled by combat etc). That might be over-complicated, though.

You might look at the frequency in PlayImmobileAmbientAnimations() if you find the interruption happens too often, once the novelty has worn off.

#9
Grymlorde

Grymlorde
  • Members
  • 227 messages

That's it, in essence.

I'm not sure why you wait 60 seconds? Maybe better to speak immediately, as who knows what might happen in the interim?

I use a system which queues companion interjections, interrupting the player on heartbeat, but only when idle (this to prevent important discussions being cancelled by combat etc). That might be over-complicated, though.

You might look at the frequency in PlayImmobileAmbientAnimations() if you find the interruption happens too often, once the novelty has worn off.

 

I removed the wait 60 seconds, just forgot to mention that.

 

I'd love to see your companion interjection queuing system as my intent all along has been to detect when the party was idle.



#10
Proleric

Proleric
  • Members
  • 2 361 messages
These are my scripts for single player - a bit scruffy, as they've evolved considerably.

Firstly, to store something the companion needs to say (perhaps in a few days time):

Spoiler

At the end of the henchman heartbeat script:
Spoiler

The "force talk" routine (which re-queues the message if it can't be delivered for some reason):
Spoiler

There are many situations in which this is useful. Example 1: when a bunch of monsters have been defeated, I want the companion to move the plot along in conversation, but that can't happen immediately, because the player is "too excited to talk", so I queue the message. Example 2: three days later, the companion remembers something important.


This is what I do, but, of course, there may be far better ways.
  • Grymlorde aime ceci

#11
_Guile

_Guile
  • Members
  • 685 messages

Put them in an empty module?   :D