Download
(6 Kb)
Download
Updated: 03/27/23 09:49 AM
Pictures
File Info
Compatibility:
Scribes of Fate (8.3.5)
Updated:03/27/23 09:49 AM
Created:07/25/22 12:49 PM
Monthly downloads:144
Total downloads:6,981
Favorites:26
MD5:
Shut Yer Trap - Mute NPCs  Popular! (More than 5000 hits)
Version: 37.1
by: remosito [More]
Some of the NPC say/yells started to annoy me. So I tried a couple addons. But they shut up most NPCs and the game started to feel empty to me.

So instead this Addon keeps track of the last 20 NPC yell/say (Struga,...) and allows you to mute selected dialogues by an NPC. Or all their Voice Overs.

This only works for NPC yell/say. Not for Quest Giver Interface Voice Over.

Requires Lib-AddonMenu-2.0


Disclaimers:
- I have not tested this with 100s of muted dialogues/NPCs so no guarantee about performance in this case. Would be suprised though if it were an issue.
- In the background this works by setting the volume of the VoiceOver audio channel to 0 for a calculated duration based on dialogue length. If another NPC dialogue starts or is ongoing during this period. It will be muted too. If my formula calculation gives to short a duration. The end of the muted conversation would be heard again.
37.1
- minor fix
- switch to better event for vo volume reset

37.0
- API bump
- VO Audio level sometimes staying at 0 hopefully fixed for good

36.0
- multiple fixes

35.9
- found and fixed rare-ish nil error

35.7
- New Feature: Unmute previously muted NPC/Dialogue

35.5
- should now be compatible with pchat, rchat

35.4
- left debug printout in 35.3..sorry guys and gals

35.3
- require min version for libaddonmenu (thanks baertram)
- muted chatter is now suppressed in chat too

35.2
- Hint to edit saved vars file to unmute or see list of muted dialogues
- Now supresses subtitles in addition to audio

35.1
- fixed bug where muting two NPCs in close succession resulted in VO volume being set to 0 permanently

35.0
- Initial Version for U35
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Uploader
Date
37.0
6kB
remosito
03/19/23 10:30 AM
37.0
6kB
remosito
12/20/22 07:50 AM
35.9
6kB
remosito
08/08/22 10:41 AM


Post A Reply Comment Options
Unread 11/04/23, 09:17 AM  
SlippyCheeze
AddOn Author - Click to view AddOns

Forum posts: 53
File comments: 272
Uploads: 1
Originally Posted by NeuroticPixels
Originally Posted by Baertram
btw: Is the initial error happening if you reset your SavedVariables and start with a clean SV file?
The errors happen even on a clean install and fresh saved variables.
I get the same, FWIW.
Report comment to moderator  
Reply With Quote
Unread 07/27/23, 01:44 PM  
NeuroticPixels
Addon Addict
 
NeuroticPixels's Avatar
Premium Member

Forum posts: 211
File comments: 869
Uploads: 0
Originally Posted by Baertram
btw: Is the initial error happening if you reset your SavedVariables and start with a clean SV file?
Or is it only happening after adding a NPC to the list, or only after adding a NPC AND a text to the muted list? (if this can be done separately)?
The errors happen even on a clean install and fresh saved variables.

Edit: Errors happen even on clean install and fresh saved variables, with or without your edits. With the edits, I only get an error about the "Muted Dialogue" dropdown. Without the edits, I get the 2 errors.
Last edited by NeuroticPixels : 07/27/23 at 02:06 PM.
Report comment to moderator  
Reply With Quote
Unread 07/27/23, 01:47 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4979
File comments: 6039
Uploads: 78
Originally Posted by NeuroticPixels
[15:48:53] [LAM2] Could not create dropdown 'Muted Dialogue' of Shut Yer Trap.
Okay, guess I broke the code in function SetUnmuteDialogueChoices() then
The func is used in that dropdown control and if it fails or got an error it might throw that error now that the LAM control could not be created (like before).

And as the error in LAM code is abou button.lua the function might have been used for another setting's button control too?
Or it's a following error because func SetUnmuteDialogueChoices got errors.

I guess you should revert the code and ask remosito to help with the initial issue then.


btw: Is the initial error happening if you reset your SavedVariables and start with a clean SV file?
Or is it only happening after adding a NPC to the list, or only after adding a NPC AND a text to the muted list? (if this can be done separately)?
Report comment to moderator  
Reply With Quote
Unread 07/25/23, 09:21 PM  
NeuroticPixels
Addon Addict
 
NeuroticPixels's Avatar
Premium Member

Forum posts: 211
File comments: 869
Uploads: 0
Originally Posted by Baertram
And if this does not fix it, logout and check your SV file for
["Muted"]
and see if it is empty or contains any wrong data.
My saved variables:

Code:
SYTVars =
{
    ["NA Megaserver"] = 
    {
        ["@NeuroticPixels"] = 
        {
            ["$AccountWide"] = 
            {
                ["backupLevel"] = "60.00000000",
                ["Muted"] = 
                {
                    ["Raynorien^F"] = 
                    {
                        ["#@ALL@#"] = true,
                        ["Of course, Elden Root has a significant presence of both the Fighters and Mages Guilds. We have sizable halls for both within the tree."] = true,
                    },
                    ["Elwintinar^M"] = 
                    {
                        ["On the branches? Is that safe? Is it easy to stumble off of these areas?"] = true,
                    },
                    ["Shelad^M"] = 
                    {
                        ["#@ALL@#"] = true,
                    },
                },
                ["version"] = 1,
            },
        },
    },
}
The ^ and #@ stuff looks weird to me. But maybe that's how it's supposed to look. I have no idea.
Report comment to moderator  
Reply With Quote
Unread 07/25/23, 02:12 PM  
NeuroticPixels
Addon Addict
 
NeuroticPixels's Avatar
Premium Member

Forum posts: 211
File comments: 869
Uploads: 0
Originally Posted by Baertram
Edit2:
Try to change the function SetUnmuteNPCChoices to this:
Code:
local function SetUnmuteNPCChoices() 

    local i, npc, first
        local choices = {}
        local choicesValues = {}  
    i = 1
    first = nil
    for npc,_ in pairs(SYT.SV.Muted) do 
        if i == 1 then first = npc end
        choices[i] = zo_strformat("<<1>> ", npc) 
        choicesValues[i] = npc
        i = i + 1
    end
    SYTUnmuteNPCDropdown:UpdateChoices(choices, choicesValues, nil) 
    if not SYT.UnmuteNPC_CurrentChoice then SYT.UnmuteNPC_CurrentChoice = first end
    return SYT.UnmuteNPC_CurrentChoice
end
And similar for function
Code:
local function SetUnmuteDialogueChoices() 

    local i, diag, first 
        local choices = {}
        local choicesValues = {}
    i = 1
    first = nil
        local currentChoice = SYT.UnmuteNPC_CurrentChoice
        local svMuted = SYT.SV.Muted
    if currentChoice  ~= nil and svMuted[currentChoice] ~= nil then 
        for diag,_ in pairs(svMuted[currentChoice]) do 
            if i == 1 then first = diag end
            choices[i] = zo_strformat("<<1>> ", diag) 
            choicesValues[i] = diag
            i = i + 1
        end
    end
    SYTUnmuteDialogueDropdown:UpdateChoices(choices, choicesValues) 
    if not currentChoice then SYT.UnmuteDialogue_CurrentChoice = first end
        currentChoice = SYT.UnmuteNPC_CurrentChoice
    if first == nil then svMuted[currentChoice ] = nil end
    return currentChoice 
end
And if this does not fix it, logout and check your SV file for
["Muted"]
and see if it is empty or contains any wrong data.
Made those changes, and now when I open the settings of the addon, I get:
[15:48:53] [LAM2] Could not create dropdown 'Muted Dialogue' of Shut Yer Trap.
The buttons at the bottom have moved, as well. It seems like there's a drop-down menu that's missing. I feel like there should be 2 drop-down menus under the "Unmute" settings. One that populates with Muted NPCs and one that populates with the specific Dialogues we've chosen to mute.

After trying to add NPCs from the drop-down menu at the top to the "Mute NPC" option, I got this error:

Code:
user:/AddOns/ShutYerTrap/Settings.lua:106: attempt to index a nil value
stack traceback:
user:/AddOns/ShutYerTrap/Settings.lua:106: in function 'func'
user:/AddOns/LibAddonMenu-2.0/controls/button.lua:64: in function 'callback'
user:/AddOns/LibAddonMenu-2.0/controls/button.lua:73: in function '(anonymous)'
|caaaaaa<Locals> args = [table:1]{2 = 1}, callback = user:/AddOns/LibAddonMenu-2.0/controls/button.lua:63 </Locals>|r
Report comment to moderator  
Reply With Quote
Unread 07/25/23, 10:53 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4979
File comments: 6039
Uploads: 78
Dropdowns got the choices tables where you define the entries.
If you also define choicesValues (which represent the value to save to the savedvariables e.g. for each of the entry in choices) and/or choicesTooltips (the tooltips of each dropdown entry) they must match the same key and number of entries!

Else you will get an error like this e.g.

So if here is a list like
Code:
choices = {
[1] = "Foo",
[2] = "Bar",
}
choicesValues and choicesTooltips MUST have the same keys [1] and [2].
-> Note:

Code:
choices = {
[1] = "Foo",
[2] = "Bar",
}
and

Code:
choices = {
"Foo",
"Bar",
}
is the same. You do not have to explicitly define non-gap number keys in an array.


And the name of the dropdown, if not written into the LAM data definition directly as name = "Muted NPCs",
will be found in language files like en.lua or strings.lua or de.lua at the defined string constants.
e.g. if the LAM entry contains something like name = GetString(MyAddonName_Mute_NPC) then you will find something like MyAddonName_Mute_NPC = "Muted NPCs" in the en.lua, and a translation for the constant MyAddonName_Mute_NPC in the de.lua for the German string then.

So search for that "Muted NPCs" in the language files to find the string constant and then for the string constant in the LAM settings definiton to find the correct dropdown box that errors, and then check the choices and other entries there.

edit:
Within this addon it's defined at locale/en.lua
SYT.S_SETTINGS_UNMUTENPC_DROPDOWN_NAME = "Muted NPCs"

If you search for S_SETTINGS_UNMUTENPC_DROPDOWN_NAMEin the other files you will find in settings.lua
Code:
SYT.UnmuteNPC_DropDown = { 
		type = "dropdown",  
		name = SYT.S_SETTINGS_UNMUTENPC_DROPDOWN_NAME,  
		tooltip = SYT.S_SETTINGS_UNMUTENPC_DROPDOWN_TOOLTIP,  
		choices = {},  
		choicesValues = {}, 
		getFunc = function() return SetUnmuteNPCChoices() end,  
		setFunc = function(var) SYT.UnmuteNPC_CurrentChoice = var SYT.UnmuteDialogue_CurrentChoice = nil SetUnmuteDialogueChoices() end, 
		reference = "SYTUnmuteNPCDropdown",
		width = "half", 
	}	
	table.insert(entries, SYT.UnmuteNPC_DropDown)

Both, choices and choicesValues are defined as empty tables there {}
So they will get filled later as it seem, and you need to find where it will be filled.

In order to access a LAm control later (as it get's created dereffered FIRST as you open the LAM settings panel of that addon!!! Before it is nil) you can define a reference = "stringNameHere" at that lam control:
reference = "SYTUnmuteNPCDropdown",

And if you search for SYTUnmuteNPCDropdown somewhere in the code you can find where it gets filled then.

Settings.lua
Code:
local function SetUnmuteNPCChoices() 

	local i, npc, first 
	i = 1
	first = nil
	SYT.UnmuteNPC_DropDown.choices = {}
	SYT.UnmuteNPC_DropDown.choicesValues = {}
	for npc,_ in pairs(SYT.SV.Muted) do 
		if i == 1 then first = npc end
		table.insert(SYT.UnmuteNPC_DropDown.choices, zo_strformat("<<1>> ", npc)) 
		table.insert(SYT.UnmuteNPC_DropDown.choicesValues, npc)
		i = i + 1
	end
	SYTUnmuteNPCDropdown:UpdateChoices() 
	if not SYT.UnmuteNPC_CurrentChoice then SYT.UnmuteNPC_CurrentChoice = first end
	return SYT.UnmuteNPC_CurrentChoice
end

It will fill in entries from SYT.SV.Muted (maybe SavedVariables of saved muted NPCs you had added?).
And this function is called directly from the
getFunc = function() return SetUnmuteNPCChoices() end,
of that dropdown itsself.

So basically it reads all the entries of the dropdown each time the getFunc is called and that's actually not a great way to solve it, despite it works.
Should be read once at the start of LAM creation, and then updated once as LAm panel shows maybe (there exists a LAM callback for that).
Else it would be calling that internal function SetUnmuteNPCChoices on each refresh of the panel (if panel's registerForRefresh is set to true) which could happen on each change of each of the LAM settings (to check if any control needs to get disabled e.g.).


So if you add debug messages d("choice added: " .. tostring(npc) .. "; index: " .. tostring(i) ) before the i = i + 1 there to the choices and choicesValues build up in function SetUnmuteNPCChoices you can see what happens when and if the entries are read properly.


Edit2:
Try to change the function SetUnmuteNPCChoices to this:
Code:
local function SetUnmuteNPCChoices() 

	local i, npc, first
        local choices = {}
        local choicesValues = {}  
	i = 1
	first = nil
	for npc,_ in pairs(SYT.SV.Muted) do 
		if i == 1 then first = npc end
		choices[i] = zo_strformat("<<1>> ", npc) 
		choicesValues[i] = npc
		i = i + 1
	end
	SYTUnmuteNPCDropdown:UpdateChoices(choices, choicesValues, nil) 
	if not SYT.UnmuteNPC_CurrentChoice then SYT.UnmuteNPC_CurrentChoice = first end
	return SYT.UnmuteNPC_CurrentChoice
end
And similar for function
Code:
local function SetUnmuteDialogueChoices() 

	local i, diag, first 
        local choices = {}
        local choicesValues = {}
	i = 1
	first = nil
        local currentChoice = SYT.UnmuteNPC_CurrentChoice
        local svMuted = SYT.SV.Muted
	if currentChoice  ~= nil and svMuted[currentChoice] ~= nil then 
		for diag,_ in pairs(svMuted[currentChoice]) do 
			if i == 1 then first = diag end
			choices[i] = zo_strformat("<<1>> ", diag) 
			choicesValues[i] = diag
			i = i + 1
		end
	end
	SYTUnmuteDialogueDropdown:UpdateChoices(choices, choicesValues) 
	if not currentChoice then SYT.UnmuteDialogue_CurrentChoice = first end
        currentChoice = SYT.UnmuteNPC_CurrentChoice
	if first == nil then svMuted[currentChoice ] = nil end
	return currentChoice 
end

And if this does not fix it, logout and check your SV file for
["Muted"]
and see if it is empty or contains any wrong data.


Originally Posted by NeuroticPixels
[22:52:23] [LAM2] Could not create dropdown 'Muted NPCs' of Shut Yer Trap.
[22:52:24] [LAM2] Could not create dropdown 'Muted Dialogue' of Shut Yer Trap.


Still getting these messages in chat. Can I get some ideas on troubleshooting?
I stopped using this for months due to this bug. But I'd really like to use this mod. I made sure no other addons had a lib folder with LibAddonMenu-2.0. So i don't know why "LAM2" is bugged out for those dropdown menus.
Last edited by Baertram : 07/25/23 at 11:48 AM.
Report comment to moderator  
Reply With Quote
Unread 07/25/23, 10:21 AM  
NeuroticPixels
Addon Addict
 
NeuroticPixels's Avatar
Premium Member

Forum posts: 211
File comments: 869
Uploads: 0
Originally Posted by NeuroticPixels
[22:52:23] [LAM2] Could not create dropdown 'Muted NPCs' of Shut Yer Trap.
[22:52:24] [LAM2] Could not create dropdown 'Muted Dialogue' of Shut Yer Trap.


Still getting these messages in chat. Can I get some ideas on troubleshooting?
I stopped using this for months due to this bug. But I'd really like to use this mod. I made sure no other addons had a lib folder with LibAddonMenu-2.0. So i don't know why "LAM2" is bugged out for those dropdown menus.
Tried muting Cartirinque at Khenarthi's Roost ("Halt! Come no closer!") and neither the "Mute NPC" nor "Mute Dialogue" worked when selecting that line from the "Chatterings" drop-down menu.

Sadly, this addon doesn't work for me. I assume from the LAM2 issues.
Report comment to moderator  
Reply With Quote
Unread 07/14/23, 09:08 PM  
NeuroticPixels
Addon Addict
 
NeuroticPixels's Avatar
Premium Member

Forum posts: 211
File comments: 869
Uploads: 0
[22:52:23] [LAM2] Could not create dropdown 'Muted NPCs' of Shut Yer Trap.
[22:52:24] [LAM2] Could not create dropdown 'Muted Dialogue' of Shut Yer Trap.


Still getting these messages in chat. Can I get some ideas on troubleshooting?
I stopped using this for months due to this bug. But I'd really like to use this mod. I made sure no other addons had a lib folder with LibAddonMenu-2.0. So i don't know why "LAM2" is bugged out for those dropdown menus.
Report comment to moderator  
Reply With Quote
Unread 05/10/23, 04:49 AM  
Kiasmalyn
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 9
Uploads: 1
just downloaded, cannot create dropdown error

just downloaded this due to that annoying npc 'halt, come no closer!'

I cant get this to work at all, instead I just get the error:

Could not create dropdown 'Muted Dialogue' of Shut Yer Trap.
Im also a little unsure on how to use this.

Do we just open settings after we've heard an NPC speak? Some basic instructions on the description page would be really helpful.

thanks.
Report comment to moderator  
Reply With Quote
Unread 03/20/23, 01:48 AM  
Kriana

Forum posts: 0
File comments: 9
Uploads: 0
Also using bandit's UI

Hi there! Also using Bandit's UI here. It seems like I can get lines to show up/mute properly, but the second half, displaying what's already muted, is still not functioning (Could not create dropdown error)

Not really a huge issue, I can just edit the variable file later if I need to unmute someone (unlikely!).

Just wanted to give you the feedback that it seems to be muting the proper line now, even with Bandits.

Thanks for this! <3
Report comment to moderator  
Reply With Quote
Unread 03/19/23, 10:31 AM  
remosito
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 295
Uploads: 6
thanks a bunch for the report. helped me understand one more case of why it happens...hopefully fixed now...


Originally Posted by Masteroshi430
Hi!
Sometimes the volume doesn't come back to what it was set to and all NPC dialogues become sound muted, it happens rarely and apparently a reload UI fixes the problem.
Report comment to moderator  
Reply With Quote
Unread 03/16/23, 03:06 AM  
Masteroshi430
 
Masteroshi430's Avatar
AddOn Author - Click to view AddOns

Forum posts: 185
File comments: 700
Uploads: 20
Hi!
Sometimes the volume doesn't come back to what it was set to and all NPC dialogues become sound muted, it happens rarely and apparently a reload UI fixes the problem.
Report comment to moderator  
Reply With Quote
Unread 12/22/22, 07:14 AM  
al-Khizr
 
al-Khizr's Avatar

Forum posts: 2
File comments: 46
Uploads: 0
Re: new version with some fixes

I think I've found the drop-down issue's origin and indeed it's an interaction with another add-on: Disabling Bandit's User Interface enables Shut Yer Trap's drop-downs, FWIW.

I'm still using Shut Yer Trap, though. Very needed add-on! ty! For the time being, if I need the drop-downs, I'll just temporarily disable Bandit's.

Originally Posted by remosito
Natakiro, Tes96: just uploaded new version which fixes an issue with not resetting selection variable.

depending on what y'all where doing in what order. might explain the nil error and wrong dialogue mutation.

still possible your errors was caused by some other bug I have not found yet...


cheers

remosito
Report comment to moderator  
Reply With Quote
Unread 12/17/22, 05:01 AM  
remosito
AddOn Author - Click to view AddOns

Forum posts: 30
File comments: 295
Uploads: 6
new version with some fixes

Natakiro, Tes96: just uploaded new version which fixes an issue with not resetting selection variable.

depending on what y'all where doing in what order. might explain the nil error and wrong dialogue mutation.

still possible your errors was caused by some other bug I have not found yet...


cheers

remosito
Last edited by remosito : 12/20/22 at 07:57 AM.
Report comment to moderator  
Reply With Quote
Unread 12/14/22, 03:01 PM  
Natakiro

Forum posts: 0
File comments: 39
Uploads: 0
Originally Posted by NeuroticPixels
...I couldn't properly select the NPCs from the dropdown menu to mute. I would select one, and it would mute a totally different one in the list. Bizarre.

After reloading, the dropdown menu for removing things I've muted had disappeared. Seems I'd have to log out and back in to get Shut Yer Trap to reset its settings menu.
I just started using this addon, since Harven's Mute NPCs was a little too aggressive, but I am having the same issue where when I select and mute someone, it mutes the wrong person. However, I don't get any errors.
Last edited by Natakiro : 12/14/22 at 04:11 PM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: