the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Question Possible Issue with Message Manager Script (and other mods that rely on GetDialogueTarget())

rcoll

New Member
Messages
2
Hi, I'm having a problem with messages not appearing after being queued due to being in a conversation. It's only something I noticed because I was doing some tests with the settlement attack quests for my BS Defence mod, and it was causing the "Settlement is under attack!" objectives to not display (which are now handled by WF), making it look like settlement attacks had simply stopped after not receiving them for a while.

In my own tests on the script I found that the "if (Player.GetDialogueTarget() != None ....)" condition in the bCanShowMessage property was always returning false. In fact, GetDialogueTarget() instead of returning None when I wasn't in conversation, was actually returning the last npc I spoke to, only returning None after a reload of the save and not speaking to anyone.

Is anyone able to reproduce this behaviour in their game, or is the issue purely on my end?
 
What script and what function? I can take a look at it and request a code change to WSFW if required.
 
Script: MessageManager

Rich (BB code):
Bool Property bCanShowMessage
    Bool Function Get()
        if(Settings_QueueAllMessages.GetValue() == 1)
            return false
        else
            if(PlayerRef.IsInCombat() && Settings_SuppressMessages_DuringCombat.GetValue() == 1)
                RegisterForRemoteEvent(PlayerRef, "OnCombatStateChanged")
                return false
            elseif(PlayerRef.GetDialogueTarget() != None && Settings_SuppressMessages_DuringDialogue.GetValue() == 1) ;>>>>>rcoll - See Below <<<<<
                StartTimer(fTimerLength_DialogueCheck, iTimerID_DialogueCheck)
                return false
            endif
        endif
     
        return true
    EndFunction
EndProperty

;The GetDialogueTarget() function was returning the last npc the player spoke to, even outside of conversation. Maybe your dialogue target only updates when you actually talk to another npc?
;It causes the If condition to always return True, since the current dialogue target is never "None", except after loading a save.
;Also, I changed the condition to "PlayerRef.GetDialogueTarget().IsInDialogueWithPlayer() == True" today (same for the condition in the OnTimer() event), and it seems to be giving the intended effect on my end.
 
Last edited:
IsInDialogueWithPlayer
IIRC, that will only return true if the actor is actually speaking.
I wonder if PlayerRef.GetDialogueTarget().IsInScene() would be a more appropriate call? I'll have to consult people more knowledgeable than me. :scratchhead
 
Top