Jump to content

Custom Companion - Location-Specific Ambient Dialogue


xJustAdam

Recommended Posts

Title. I'm currently working on my very first custom companion, and I've done pretty well off written and Youtube tutorials thus far. I've worked out the scripting, dialogue and even made a small quest for them, which I consider an achievement considering I've never made a proper mod before in my life.

 

However, I'm now stumped at how to implement location-specific ambient lines for my companion. Cass in the vanilla game has many lines specific to several locations, I've examined the quest for this and the script and I still can't work my head around it. I've also tried looking at other modded companions on the Nexus that have achieved this - but still no luck figuring it out.

 

Any pointers would be massively appreciated. I'm so close to having this mod exactly the way I want it. One last hurdle.

 

TL;DR, how to implement ambient dialogue for companions at specific locations/worldspaces.

Edited by TheL0neW0nder
Link to comment
Share on other sites

There's a couple ways to do it:

 

You could use a Primitive Activator with a Ontriggerenter script that tells your companion to Say a dialogue topic once you or they pass through it. Since it requires passing through the trigger these are best reserved for set-piece moments or when you otherwise can guarantee the player will hit it.

You can also call a Say on the companion with any result script, such as when a Quest stage is Set.

 

You can use HELLO Topic dialogues in the conversation tab. (HELLO dialogues are the things NPCs will say as you walk by them)

Using conditions you can create both general and specific HELLOs.

Edited by Radioactivelad
Link to comment
Share on other sites

If you have specific locations , and you want to say specific dialogue.

Then go to those locations in geck , and place an X marker , name it "MySpecificMarker"

Then where you have this specific dialogue (some quest)

Put a condition on it of "GetDistance : to >> MySpecificMarker <= 5000 ; (ingame units for example)

And you run it on the subject or reference ... that actors ref-ID .

 

Hope that helps

Link to comment
Share on other sites

  • 4 months later...

I added Mass Effect style banter a different way... ;)

 

My NPC is running this script... which basically waits and does nothing until a random amount of time has passed and then forces the NPC to say something to the player...

 

float m_banterTimer

float m_banterThreshold

 

BEGIN GameMode

if m_banterTimer < m_banterThreshold

set m_banterTimer to m_banterTimer + GetSecondsPassed

else

set m_banterTimer to 0

set m_banterThreshold to GetRandomPercent*4

SayTo player LocationBanter;

endif; banterTimer

END

 

... and then I put all my banter dialog into the topic called LocationBanter... The location-specific responses all have a condition using the GetInCell function to tie them to specific places and are at the top of the topic's stack so they evaluate first but only trigger when you're at a specific location; they're also flagged with "once per day" so you don't get spammed by them. The bonus to this method is that I can have generic non-location-specific dialog at the BOTTOM of the topic's stack, so if I'm NOT at a landmark, my NPC still makes amusing observations every now and again. :) (Plus I'm not dropping new objects in cells all over the game, it's just the script and the dialog... Nice and tidy, easy to manage.)

Edited by Budong
Link to comment
Share on other sites

:) I've been testing an NPC follower with this script/dialog setup for almost a year now and it's had absolutely zero impact on game performance. Hasn't affected stability either.

 

Not surprising really... it's a decade-old game running on 2019 hardware and my script does almost nothing. You should look at something like NVDLC01GhostSCRIPT that Obsidian created for Dead Money... it assigns many more values and does shed-loads more function-calls while in GameMode... and it didn't impact performance, not even on gaming rigs from 2010. :p

 

Take forum wisdom with a grain of salt... a lot of stuff that people "know" just gets read and repeated until it becomes "the truth"... and then nobody really tries anything new anymore because they just do whatever the previous guy did. Mod, test, verify... then you'll know first-hand if something works or not.

Link to comment
Share on other sites

While you have a point about running things in GameMode every frame, we're also not running FNV on 2009 era computers. Budong's method has an advantage with mod compatibility since it does not modify existing locations in-game. The disadvantage is a script running inefficiently in the background. Sure, it wastes a few clock cycles, but a modern PC can waste a lot of clock cycles on inefficient scripts and you'll never notice any lag or other issues with the game.

 

Running in GameMode is something that you generally want to avoid, but if you have a valid reason for setting up your script that way, it's not that terrible.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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