Jump to content

Companion custom event comments: non-vanilla based follower


Recommended Posts

Working on a FO4 companion. Having an issue with the idle comments, e.g. companion commenting when player enters Diamond City, or mods armor, or enters a dark/messy/creepy interior cell, etc.

 

If I put the companion on the vanilla companion system (using the vanilla "companionactorscript"), all the location and event comments work just fine.

 

But I don't want this companion to use the vanilla system or to count against the follower limit (for a few reasons).

 

Using the vanilla system, on the companion's quest > player dialogue tab, there are keyword-based comment categories, for example:

 

AOT_Gen_Dark

AOT_ Gen_Messy

CAT_Event_ModArmor_Topic

CAT_Event_ModWeapon_Topic

CIS_ENL_DiamondCity

CIS_ENL_Vault

 

Question is:

 

How do I get these keyword categories to work for the companion if they are not on the vanilla system and are not using the vanilla companionactorscript?

 

To clarify a few things:

 

1) When I add keywords for AOT, CAT, CIS, etc. into the companion's NPC record on the keyword tab, that doesn't help at all. The only way the companion says the lines is if they are on the vanilla system using companionactorscript.

 

2) There is a way to get the result I want using specific conditions on idles in the "Misc" tab of the companion's quest, instead of using the "player dialogue" tab, but that's more effort.

 

3) There is also a way to modify the vanilla companionactorscript, but it's about 29 pages, and I'm not going to do that. I'd rather use the method in point #2 above if need be.

 

4) Whether the companion is on the vanilla system or not, the Detection and Combat lines work just fine. It's just the location and event based comments that are the issue.

 

5) I've had no issues making Skyrim non-vanilla followers do comments correctly and no problem with vanilla system Fallout 4 followers doing comments correctly, it's just a problem with non-vanilla system Fallout 4 companions.

 

Is there some shortcut I'm missing to make this work?

 

Thank you!

 

Link to comment
Share on other sites

The companion script hooks the companion alias into the script events, which then fire a line of dialogue.

You will have to write your own script to catch these events, then fire them.

 

There are more quests you'll need to look into, if you want to catch 'all' vanilla events.

- AO_Comments_Dialogue

- COMQuestCommentary

 

These hook into the triggers placed all over the maps for areas that followers respond to. If you want to bypass all of that, you'll need to a) create your own script for catching these events, b) place your own triggers in maps (this was rhetorical.. don't do that).

 

When facing this same issue I created a dialogue loop script which just kicks off a huge topic which is filled with conditional dialogue, never mind the IsHugging stuff in there which is specific to this companion.

 

The topic she speaks (a sharedinfo) has two groups, location dialogue and quest dialogue. And it looks like this:

 

Scriptname CompanionIvyScript extends Quest
Quest Property pAO_Companion_Bar Auto Const
Quest Property pMQ106 Auto Const
Scene Property pCommand_HackTerminal_Scene Auto Const
Bool Property pIvyIsRecruited = False Auto
Alias Property p_IvyCompQAlias Auto Const
ReferenceAlias Property pIVYCOMP Auto Const
Topic Property p_IvySpontChatter Auto Const
Topic Property pDebugChatter Auto Const

GlobalVariable Property p_ivy_listens Auto Const
GlobalVariable Property p_ivy_chats Auto Const
GlobalVariable Property IvyIsRecruited Auto Const
GlobalVariable Property p_ivy_IsHugging Auto Const

Armor Property p_ivy_listener_hat Auto Const
Actor Ivy

Event OnQuestInit()
    RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
    RegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")
EndEvent



Event Actor.OnPlayerLoadGame(Actor akSender)
    ;restart the chatter loop when the player has loaded their game
    if akSender == Game.GetPlayer() && IvyIsRecruited.GetValueInt() == 1
    ;p_ivy_loadgame_message.Show()
        Debug.Trace("IVY has detected the player has loaded their game, she's initialising her chat routines.")
    ivyDeaf()
    ;make sure that if a hugging anim was playing during save this global is reset.
    p_ivy_IsHugging.SetValueInt(0)
    Utility.Wait(4)
    ivyListens()
    endif
EndEvent

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)
    ; watch for player to change location
    if akSender == Game.GetPlayer() && IvyIsRecruited.GetValueInt() == 1
    ;p_ivy_newloc_message.Show()
        Debug.Trace("IVY has detected the player has moved, she's checking her chatter routines.")
    ivyDeaf()
    ;make sure that this global is reset.
    p_ivy_IsHugging.SetValueInt(0)
    Utility.Wait(4)
    ivyListens()
    endif
EndEvent

Function ivyListens()
    if p_ivy_listens.GetValueInt() == 0 && p_ivy_chats.GetValueInt() == 1
        int listenMessage = 0

        pIvyIsRecruited = True
        p_ivy_listens.SetValue(1)
        
        Ivy = pIVYCOMP.GetActorRef()

        ;wait 15 seconds before initialising chat routines.
        Utility.Wait(15)

        ;debug message
        ;p_ivy_islistening_message.Show()

        While pIvyIsRecruited
                     Utility.Wait(4)

            if Game.GetPlayer().IsInIronSights() == False && Ivy.IsInScene() == False && Game.GetPlayer().IsTalking() == False && Ivy.IsDoingFavor() == False && Ivy.IsTalking() == False &&  pCommand_HackTerminal_Scene.IsPlaying() == False
                      Ivy.Say(p_IvySpontChatter, Ivy, False, Game.GetPlayer())
            endif
        EndWhile
    endif
EndFunction

Function ivyDeaf()
    ;p_ivy_deaf_message.Show()
    pIvyIsRecruited = False
    p_ivy_listens.SetValue(0)
EndFunction

 
Edited by Reginald001
Link to comment
Share on other sites

Hi Thuggysmurf :)

 

The AOT_ comments and the CIS_comments are driven via the Story Manager and quests that are started up out of that. That sequence is often kicked off via a trigger in the gameworld that has its own script on it for these things. There are a lot of AO_ and CIS_ quests that are handled in this set up to get various comments and behaviors working (dogmeat finding stuff, comments in locations, companions talking to other actors, etc).

 

The CAT_Event comments are run via events triggered by something the player or companion does (when the player uses a workbench, when the player and/or companion go swimming, etc). You can have a script that catches those events and triggers a comment in response to it. You can find examples of scripting to catch the events and set up comments on them in the FollowersScript (onplayerswim(), onplayeruseworkbench(), etc).

 

I wrote my own script for catching quest commentary. The COMQuestCommentary, iirc, requires using the companionactor script, and I wanted as little tie-in with the vanilla companion system as possible.

 

 

4) Whether the companion is on the vanilla system or not, the Detection and Combat lines work just fine. It's just the location and event based comments that are the issue.

 

 

That's because the combat and detection lines are hardcoded to work and they work on all actors. The other comments are run via the Story Manager and additional scripting and quests are needed to get them into the game.

Link to comment
Share on other sites

Reginald and Llama, thank you both for the detailed advice!

 

Llama: Just curious, on Heather's NPC record, why does she have keywords for AO_Comment128, 256, 512, etc., but no keywords for the CAT_Event stuff?

 

Was messing with the file some more, and got all the non-event comments and about half the event comments I wanted working using the topics in the hard-coded combat + detection tabs + putting specific enough conditions on any location based comments and adjusting the comment frequency in the "misc" tab.

 

No dice on certain event comments (e.g. mod armor, mod weapon, eat corpse, etc) without the custom script like you recommended. Also, Fallout 4 CK appears to have a bunch of nonworking keywords and condition functions left over from prior games that don't do anything in Fallout 4.

 

When testing in game, started to feel that the AO_comment marker system Bethesda set up in Fallout 4 can be somewhat limiting because a companion will typically only make one comment in an area, in a specific spot, the same one each time, and if using multiple companions, they will talk over each other.

 

For example, when visiting Diamond City with 4 companions, they all make a comment at the exact same time when first arriving, so you can't really hear what they're saying individually, and then that's it, no additional commentary.

 

Versus by using idle comments in the "misc" tab with location and frequency conditions, the companion can say a series of lines as you venture further into the cell, offering more depth as you go + they don't comment at the same time as the AO-comment based companions.

 

Anyway, I never really thought about that before because the vanilla companion system makes things so easy. Thank you again for your help!

Link to comment
Share on other sites

Reginald and Llama, thank you both for the detailed advice!

 

Llama: Just curious, on Heather's NPC record, why does she have keywords for AO_Comment128, 256, 512, etc., but no keywords for the CAT_Event stuff?

 

The AO_Comment keywords are there so the script on the triggers around the gameworld will do its thing when she hits them.

 

The CAT_ keywords aren't necessary to get those comments to play. My script handles triggering them. I listen for the event and play the comment when the event is received with SayCustom().

 

 

When testing in game, started to feel that the AO_comment marker system Bethesda set up in Fallout 4 can be somewhat limiting because a companion will typically only make one comment in an area, in a specific spot, the same one each time, and if using multiple companions, they will talk over each other.

For example, when visiting Diamond City with 4 companions, they all make a comment at the exact same time when first arriving, so you can't really hear what they're saying individually, and then that's it, no additional commentary.

 

There are a few issues with the system, I agree. That particular Diamond City comment is a unique comment. There are about ten of those comments that play the first time a companion enters a location with the player, or maybe it only plays if it's the first time the player enters that location. I'm not sure because I didn't test it enough to figure out the subtleties (I don't use it).

Most unique location comments don't work that way (Salem museum comments, etc). The first companion to the trigger wins and delivers their comment. Any other companions present won't deliver the line. So in that case you get one comment from one of the companions which is more pleasant for the player, but does mean you may have written dialogue that the player doesn't hear in that moment because another companion got to the trigger first.

Versus by using idle comments in the "misc" tab with location and frequency conditions, the companion can say a series of lines as you venture further into the cell, offering more depth as you go + they don't comment at the same time as the AO-comment based companions.

 

I did that for Heather's idle chatter as well. There are several ways you can get chatter into the game that doesn't play exactly when the vanillas will deliver their lines.

I didn't completely reject the AO_ system though and used a lot of the system in locations where I really wanted her to interact in that moment. I figured it was better to write the lines to have her talk about the interesting moment even though other companions might steal the trigger and silence her now and then. Honestly, I love the vanilla, dev-placed triggers. You can get an awful lot of dialogue into the game via creative use of the systems available, but sometimes a trigger is the only way to get a comment when you want/need it and having them in the vanilla game is a headache-free luxury.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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