Modifying x0_inc_henai to change behaviour, could use advice

My second module, a city adventure, uses several henchmen at different stages, and their involvement with the story and the PC varies.

To reflect that, and other things, I found myself editing the x0_inc_henai file which apparently defines a lot of the stuff that henchmen do.

Now, my understanding is that in the case of an include file, I would need to recompile all the scripts that use it so that they draw from the modified script. I would prefer to avoid recompiling all the BioWare henchmen scripts “just in case,” although if that is the smartest thing to do I will of course do it.

So far, I have modified the response to the radial menu icon saying “remove from party.” Henchmen in my module must not be removed that way, so I found the relevant portion in the x0_inc_henai script, edited it, and recompiled the x0_ch_henconv script, because my understanding is that radial menu commands are “silent shouts” and the henchmen respond to those trough the conversation script.
This worked, and my “no can do” message now appears as desired.

The other thing I wanted to do - and here comes the question - was to stop henchmen from playing voice chat when near death. I have found the relevant portion in x0_inc_henai (see below) and commented out the two lines.

(...)
 // * when hit points less than 10% will whine about
                // * being near death
                if (iHP < 10 && Random(5) == 0)
                    VoiceNearDeath();
(...)

However, if I understand correctly, I now have to recompile the script that calls that function in order to stop it from actually happening. Is that right? And if so, does anyone know which script would that be?

Guessing rather than knowing, but I’d put my money on the henchman’s creature event scripts, most likely OnCombatRoundEnd, OnDamaged, or OnHeartbeat. :thinking: Try opening the creature scripts, and see if they trace back to x0_inc_henai. If they do, they need to be recompiled for the changes made to the library to take effect in that script, yes.

2 Likes

They all include the inc_henai script, that’s the trouble! And I’m a bit scared to meddle with them. I was scared to meddle with the inc file for months.

Incidentally, are you the same TheBarbarian who posts on the beamdog forums? Because while googling a semi-related problem I found your post there that solved it for me :smiley:

1 Like

I wouldn’t worry about it. If something goes wrong, all you should need to do to revert to the original state is to delete the altered files again, as the moduleside copies override the basegame scripts but do not actually replace or alter the originals.

I’m very rarely on the BD forums, but yes, I’ve left a couple of posts there. :slight_smile: If it’s the preachy account with the inordinately long and inordinately melodramatic posts, then it’s probably me.

Ooh! I didn’t know that! That makes it all a lot easier.

The style wasn’t as… flamboyant… as I expected, hence my doubt. Also, double thanks are in order then!

1 Like

You don’t even say “Hello” for weeks and then you post inordinately long posts. How does that fit together? How can you be so tight-lipped and a chatterbox at the same time? Explain… :wink:
Though I probably shouldn’t “derail” this thread.

1 Like

So in the interest of posterior, um, I mean, posterity, it was OnCombatRoundEnd.

Removing that option is a godsend when making immortal henchmen who are often brought down to 1 hp and don’t die, and I’ve decided to do that, because it was either this or World’s Most Annoying Escort Quest.

If you want to change an include file, it’s vital to do it systematically, otherwise very strange bugs can occur.

You can obtain a folder of the Bioware scripts then search it using a decent file manager (e.g. Free Commander).

You will find 55 scripts which refer to x0_inc_henai. Repeat for any of those which are includes themselves, such as s3_inc_horse. Every script discovered that has a direct or indirect reference to x0_inc_henai must be recompiled.

Alternatively, you can disable the radial menu in x0_ch_hen_conv:

        // listening pattern matched
        if (GetIsObjectValid(oMaster))
        {
            // we have a master, only listen to them
            // * Nov 2003 - Added an AbleToTalk, so that henchmen
            // * do not respond to orders when 'frozen'
            if (GetIsObjectValid(oShouter) && oMaster == oShouter && AbleToTalk(OBJECT_SELF)) {
                SetCommandable(TRUE);
                // CUSTOM CODE
                if (nMatch == ASSOCIATE_COMMAND_LEAVEPARTY)
                  SendMessageToPC(GetFirstPC(), "Remove From Party is disabled.");
                else
                // END CUSTOM CODE
                bkRespondToHenchmenShout(oShouter, nMatch, oIntruder);
            }
        }

You could also remove VoiceNearDeath from the voice sets for your companions.

That might eliminate the need to edit x0_inc_henai (depending on what else you need to do).

Drat.

Just when I thought it was so nice and easy.

Thank you, Proleric, I see I’ve got to think this through. How does one modify an existing BW voice set? I found soundsets.2da but it only looks like a reference list matching a name to the actual sounds. There’s also several .bif files called “sounds” in the data folder, but I have no idea what .bif files are.

Put a “t” after the last “n” and you’re good to go.

I’m sorry, I don’t understand what that means.

https://neverwintervault.org/project/nwn2/other/making-custom-voiceset
^- I’ve never tried to do this, but I found this tutorial on making a voiceset from scratch. :thinking: It’d make a lot of sense if all the necessary information for modifying existing voicesets was in there, as well.

1 Like

You don’t know what hentai means?

I’m not looking for that kind of behaviour.

Then I’m all out of ideas.

I’m no expert, but I imagine you can make a short, silent audio file to override vs_XXXXXX_dying.wav, where XXXXXX is the voiceset in question.

Voicesets are covered in detail in the Custom Content Guide.

Alternatively, maybe give the companion no voiceset at all in the toolset (they can be really annoying).

1 Like

I had no idea a custom content guide existed. (And if I had, I’d probably still think it’s not for people like me, the way it starts off with words like “danglymesh and skinmesh.”) Thank you, I’ll check it out!

CCG V3 is here

TR

3 Likes