Jump to content

Custom Companion Interjections in Quest Lines


Recommended Posts

 

Yes I get it now, the penny drops. I put parts of this script in the Quest script (under script tab) and my first custom event now fired.

Thanks a lot!

 

Reg, if LlamaRCA is helping you...good plan to take the help. She's the author of the Heather Casdin companion mod that I mentioned to you earlier today - BEST companion for fallout 4 EVER, hands down BTW. If anyone can help you sort this stuff out, trust me, its going to be this wonderfully knowledge person. :smile:

Edited by joerqc
Link to comment
Share on other sites

I've done this for Heather and for the most part it worked out very well. Be aware that you may need to do some tinkering with your script as you test the dialogue. It won't always play when you want it to, etc and you may need to add timers to delay a line or move it to another quest stage. I'd suggest you add some debug stuff to the script so you get either a notification during gameplay or a note in the log that tells you the parrticular dialogue line has played like it should. There are times when things won't happen as you expect them to even if the script is doing what it should (line should have played but someone else talked over it, etc). It can take a lot of time to get this type of commenting running smoothly.

I'll continue looking into it for DARRYL. So far it's been hard. It runs my stage once, then never again... So I simplified and I figured I could just loop a scene forever as long as the quest is active, check for conditions, just fire one line which is set to Single, go to a wait loop, then restart the scene. But it's not looping whatever I do, so I think some other quest for Ivy or a companion alias is stopping the scene.

Edited by Reginald001
Link to comment
Share on other sites

 

I've done this for Heather and for the most part it worked out very well. Be aware that you may need to do some tinkering with your script as you test the dialogue. It won't always play when you want it to, etc and you may need to add timers to delay a line or move it to another quest stage. I'd suggest you add some debug stuff to the script so you get either a notification during gameplay or a note in the log that tells you the parrticular dialogue line has played like it should. There are times when things won't happen as you expect them to even if the script is doing what it should (line should have played but someone else talked over it, etc). It can take a lot of time to get this type of commenting running smoothly.

I'll continue looking into it for DARRYL. So far it's been hard. It runs my stage once, then never again... So I simplified and I figured I could just loop a scene forever as long as the quest is active, check for conditions, just fire one line which is set to Single, go to a wait loop, then restart the scene. But it's not looping whatever I do, so I think some other quest for Ivy or a companion alias is stopping the scene.

 

 

The script the beth devs wrote to award affinity during player conversations may be useful to you. They are doing what you are attempting to do in that they are inserting reactions at different quest stages, but they are showing messages at that point rather than triggering dialogue. If you've already written up your version you might consider adding what you want to that same script by adding the quest stages you are interested in and triggering the dialogue from that.

 

Feel free to download Heather to see how I've done it if you cannot get it working with the vanilla models. Mine is done by catching some of the vanilla trigger points for affinty, monitoring for quest stages and end of scenes, etc. You'd be able to do something similar with the quest stages you are interested in. Heather's choice of what to comment on is extremely tailored to her personality and what she cares about. I play the comments she delivers in a separate quest to guarantee that the scene will play every time I want it. There's some indication in the scripting I went through that scenes in the same quest as the script calling the scene may fail to start and I wanted to avoid that issue.

 

I also build additional dialogue using the Story Manager and quests that trigger out of those.

Link to comment
Share on other sites

 

 

I've done this for Heather and for the most part it worked out very well. Be aware that you may need to do some tinkering with your script as you test the dialogue. It won't always play when you want it to, etc and you may need to add timers to delay a line or move it to another quest stage. I'd suggest you add some debug stuff to the script so you get either a notification during gameplay or a note in the log that tells you the parrticular dialogue line has played like it should. There are times when things won't happen as you expect them to even if the script is doing what it should (line should have played but someone else talked over it, etc). It can take a lot of time to get this type of commenting running smoothly.

I'll continue looking into it for DARRYL. So far it's been hard. It runs my stage once, then never again... So I simplified and I figured I could just loop a scene forever as long as the quest is active, check for conditions, just fire one line which is set to Single, go to a wait loop, then restart the scene. But it's not looping whatever I do, so I think some other quest for Ivy or a companion alias is stopping the scene.

 

 

The script the beth devs wrote to award affinity during player conversations may be useful to you. They are doing what you are attempting to do in that they are inserting reactions at different quest stages, but they are showing messages at that point rather than triggering dialogue. If you've already written up your version you might consider adding what you want to that same script by adding the quest stages you are interested in and triggering the dialogue from that.

 

Feel free to download Heather to see how I've done it if you cannot get it working with the vanilla models. Mine is done by catching some of the vanilla trigger points for affinty, monitoring for quest stages and end of scenes, etc. You'd be able to do something similar with the quest stages you are interested in. Heather's choice of what to comment on is extremely tailored to her personality and what she cares about. I play the comments she delivers in a separate quest to guarantee that the scene will play every time I want it. There's some indication in the scripting I went through that scenes in the same quest as the script calling the scene may fail to start and I wanted to avoid that issue.

 

I also build additional dialogue using the Story Manager and quests that trigger out of those.

 

 

So after two days of insistent searching I managed to get the behavior I wanted, largely due to your (and others') hints and tips on events and triggering. This morning I had the strange idea to look into Deacons' switching clothing behavior and it gave me the epiphany I needed. When I posted this thread I was still completely in the dark on the scripting side. And I was under the impression that I could do this without registering an event, but instead by making a separate looping quest.

 

After looking at Deacon I went back to registering an event. I attached a DARRYL script to my companion quest:

 

SOLUTION

Scriptname CompanionDARRYLScript extends Quest

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)
    ; watch for player to change location
    if akSender == Game.GetPlayer()

        Debug.Trace("DARRYL has detected the player has moved.")
        ; Say something relevant about the current situation
        p_DARRYLCompQuestSpontaneousChatter.Start()
    endif
EndEvent

Scene Property p_DARRYLCompQuestSpontaneousChatter Auto Const

In the 'recruit' stage of the QUEST STAGES tab I attached the event:

; register quest script for remote events:
kmyQuest.RegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")

And in the 'dismiss' scene I unregister the event:

; unregister quest script for remote events:
kmyQuest.UnregisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")

This command in the companion script (SCRIPTS tab):

p_DARRYLCompQuestSpontaneousChatter.Start()

 

Is called whenever the player enters a new location with DARRYL, this scene is a dialogue action only scene inside the DARRYL companion quest, which has many comments with conditions on current quest stages.

 

This was exactly the behavior I was searching for. :smile:

Edited by Reginald001
Link to comment
Share on other sites

 

 

 

I've done this for Heather and for the most part it worked out very well. Be aware that you may need to do some tinkering with your script as you test the dialogue. It won't always play when you want it to, etc and you may need to add timers to delay a line or move it to another quest stage. I'd suggest you add some debug stuff to the script so you get either a notification during gameplay or a note in the log that tells you the parrticular dialogue line has played like it should. There are times when things won't happen as you expect them to even if the script is doing what it should (line should have played but someone else talked over it, etc). It can take a lot of time to get this type of commenting running smoothly.

I'll continue looking into it for DARRYL. So far it's been hard. It runs my stage once, then never again... So I simplified and I figured I could just loop a scene forever as long as the quest is active, check for conditions, just fire one line which is set to Single, go to a wait loop, then restart the scene. But it's not looping whatever I do, so I think some other quest for Ivy or a companion alias is stopping the scene.

 

 

The script the beth devs wrote to award affinity during player conversations may be useful to you. They are doing what you are attempting to do in that they are inserting reactions at different quest stages, but they are showing messages at that point rather than triggering dialogue. If you've already written up your version you might consider adding what you want to that same script by adding the quest stages you are interested in and triggering the dialogue from that.

 

Feel free to download Heather to see how I've done it if you cannot get it working with the vanilla models. Mine is done by catching some of the vanilla trigger points for affinty, monitoring for quest stages and end of scenes, etc. You'd be able to do something similar with the quest stages you are interested in. Heather's choice of what to comment on is extremely tailored to her personality and what she cares about. I play the comments she delivers in a separate quest to guarantee that the scene will play every time I want it. There's some indication in the scripting I went through that scenes in the same quest as the script calling the scene may fail to start and I wanted to avoid that issue.

 

I also build additional dialogue using the Story Manager and quests that trigger out of those.

 

 

So after two days of insistent searching I managed to get the behavior I wanted, largely due to your (and others') hints and tips on events and triggering. This morning I had the strange idea to look into Deacons' switching clothing behavior and it gave me the epiphany I needed. When I posted this thread I was still completely in the dark on the scripting side. And I was under the impression that I could do this without registering an event, but instead by making a separate looping quest.

 

After looking at Deacon I went back to registering an event. I attached a DARRYL script to my companion quest:

 

SOLUTION

Scriptname CompanionDARRYLScript extends Quest

Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)
    ; watch for player to change location
    if akSender == Game.GetPlayer()

        Debug.Trace("DARRYL has detected the player has moved.")
        ; Say something relevant about the current situation
        p_DARRYLCompQuestSpontaneousChatter.Start()
    endif
EndEvent

Scene Property p_DARRYLCompQuestSpontaneousChatter Auto Const

In the 'recruit' stage of the QUEST STAGES tab I attached the event:

; register quest script for remote events:
kmyQuest.RegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")

And in the 'dismiss' scene I unregister the event:

; unregister quest script for remote events:
kmyQuest.UnregisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")

This command in the companion script (SCRIPTS tab):

p_DARRYLCompQuestSpontaneousChatter.Start()

 

Is called whenever the player enters a new location with DARRYL, this scene is a dialogue action only scene inside the DARRYL companion quest, which has many comments with conditions on current quest stages.

 

This was exactly the behavior I was searching for. :smile:

 

 

 

Just a heads up about some weaknesses with the location change event.

 

1) Location change event doesn't always happen when you want it to. If the player has been to the location before they go there with your actor the event may fail and your dialogue won't play properly.

 

2) The event may not trigger when the player enters the location, even if it's the first time, but will trigger when the player leaves it. This means if you write dialogue specifically for the first time the player and your actor arrive it won't sound right when it doesn't play until they leave the location.

Link to comment
Share on other sites

 

Just a heads up about some weaknesses with the location change event.

 

1) Location change event doesn't always happen when you want it to. If the player has been to the location before they go there with your actor the event may fail and your dialogue won't play properly.

 

2) The event may not trigger when the player enters the location, even if it's the first time, but will trigger when the player leaves it. This means if you write dialogue specifically for the first time the player and your actor arrive it won't sound right when it doesn't play until they leave the location.

 

 

Yes! I found this out the hard way. :smile:

 

But his dialogue is generic enough mostly to compensate.. 'So... this is lovely Concord?'.. etc.. I added quest stage conditions (and IsInLocation/Cell) which works mostly... I don't mind if some dialogue is skipped this way at random moments, it actually adds to the experience, so I added a random wait time before DARRYL speaks.

 

The 'Say Single time' option wasn't working initially until I forced each 'speaker' to Darryl (the combobox 'speaker' instead of adding a conditional GetISId = blah), now that works fine as well.

Edited by Reginald001
Link to comment
Share on other sites

  • Recently Browsing   0 members

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