Villager Chat

Villager Chat [Paid] 2.1.4

notwiss
he/him

New member
hi hi! not sure if it has been asked before but I am trying to achieve a mix of some users with custom avatars and the rest without them, so I was wondering is there any way to "Hide Villagers" for ALL viewers except for the ones with a permanent exclusive one set up?
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
hi hi! not sure if it has been asked before but I am trying to achieve a mix of some users with custom avatars and the rest without them, so I was wondering is there any way to "Hide Villagers" for ALL viewers except for the ones with a permanent exclusive one set up?
It will require you to change some of the code, but I think I've made this as simple as possible

  1. Open up script-villager-chat either in a text editor like Notepad or a code editor like Visual Studio Code
  2. Scroll down until you see code like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      const parentClasses = []
  3. Here is the new code you'll be inserting in there:
    JavaScript:
      // hides avatars of users who don't have a permanent villager assignment 
    if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
  4. The result should look something like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      // hides avatars of users who don't have a permanent villager assignment
      if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
    
      const parentClasses = []
  5. Save the file
 

notwiss
he/him

New member
It will require you to change some of the code, but I think I've made this as simple as possible

  1. Open up script-villager-chat either in a text editor like Notepad or a code editor like Visual Studio Code
  2. Scroll down until you see code like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      const parentClasses = []
  3. Here is the new code you'll be inserting in there:
    JavaScript:
      // hides avatars of users who don't have a permanent villager assignment
    if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
  4. The result should look something like this:
    JavaScript:
    // set emote size  const emoteSize = calculateEmoteSize(parts)
      messageClone.find('.content').addClass(`emote-${emoteSize}`)
    
      // add message type as a class
      messageClone.find('.message').addClass(`message-${message.type}`)
    
      // add villager colors
      messageClone.find('.message').css({
        '--villagerTextColor': villager.color.text,
        '--villagerBackgroundColor': villager.color.background,
      })
    
      // hides avatars of users who don't have a permanent villager assignment
      if (!permanentVillagerMap.get(user.userName)) {
        messageClone.find('.message').addClass('hide-villagers')
      }
    
      const parentClasses = []
  5. Save the file
thank you so much! it worked perfectly
 

yubyuns
she/her

New member
Hi so i just bought this today and im having trouble. Whenever i type a message, it shows up on browser source and the widget. But whenever my mod or anyone else types, the chat bubble doesn't show up. i included a pic that could maybe id the problem?
 

Attachments

  • sdfsdfs.PNG
    sdfsdfs.PNG
    80.2 KB · Views: 4
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Hi so i just bought this today and im having trouble. Whenever i type a message, it shows up on browser source and the widget. But whenever my mod or anyone else types, the chat bubble doesn't show up. i included a pic that could maybe id the problem?
did you set it so that you have an exclusive villager image? because when you do that and it's the only custom image, it breaks because there's no other image available for anyone else
 

yubyuns
she/her

New member
did you set it so that you have an exclusive villager image? because when you do that and it's the only custom image, it breaks because there's no other image available for anyone else
HI thank you so much for the response! Yes i did have an exclusive image for me and that was the problem! thank you! (also is there any way i can have an image for me? I wanted Celeste as my villager but i think that doesnt count? :') Is there any way to bypass that?) AGAIN THANK YOU!! i love the Villager chat so much <3
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
HI thank you so much for the response! Yes i did have an exclusive image for me and that was the problem! thank you! (also is there any way i can have an image for me? I wanted Celeste as my villager but i think that doesnt count? :') Is there any way to bypass that?) AGAIN THANK YOU!! i love the Villager chat so much <3
If you open up villagers-villager-chat.js in a text editor, you can manually add a villager in to the default villager list
 

Kindabananas

New member
Im stuck on Widget Settings when trying to setup the chat. The tools tab is blank so I am unable to move forward
 

Attachments

  • widget.png
    widget.png
    111.8 KB · Views: 2
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Im stuck on Widget Settings when trying to setup the chat. The tools tab is blank so I am unable to move forward
you're opening it from within the zip file, you gotta fully unzip it all because when you open a file from a compressed folder, it only opens that one file and has no access to the other files
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Is there any chance you'd be able to add support for BTTV/FFZ/7TV emotes for the Villager Chat overlay?
 

sylphrin
she/her

New member
Streamer
Hi hi! I've been using this chat for a while and I absolutely love it, thank you for your hard work!

Unfortunately, there's one slight hitch - I started using serybot recently, which automatically deletes spam messages. But the deleted messages still show up on the chat overlay. If I delete any messages manually, they disappear from the chat overlay as expected, but I think serybot is deleting them too fast for this chat to "catch on" to it, if that makes any sense. Any chance you could look into it sometime?
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Hi hi! I've been using this chat for a while and I absolutely love it, thank you for your hard work!

Unfortunately, there's one slight hitch - I started using serybot recently, which automatically deletes spam messages. But the deleted messages still show up on the chat overlay. If I delete any messages manually, they disappear from the chat overlay as expected, but I think serybot is deleting them too fast for this chat to "catch on" to it, if that makes any sense. Any chance you could look into it sometime?
oh weird
could be a speed thing yea

I'll look into it but it sounds like an issue in the slime2 core
and I'm not going to update that for now because then every chat widget would also need to update to support it, I'm working on a much better desktop app for that purpose
so at the very least I'm going to make sure the issue doesn't exist in the desktop app

for now I hope that a decent workaround for you is to refresh the chat browser source or using /clear in chat if that happens again

thanks for letting me know!
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
oh weird
could be a speed thing yea

I'll look into it but it sounds like an issue in the slime2 core
and I'm not going to update that for now because then every chat widget would also need to update to support it, I'm working on a much better desktop app for that purpose
so at the very least I'm going to make sure the issue doesn't exist in the desktop app

for now I hope that a decent workaround for you is to refresh the chat browser source or using /clear in chat if that happens again

thanks for letting me know!
ok yea the problem is definitely how I manage the state for that, it's possible that if multiple delete requests happen near simultaneously then the last processed delete within that batch overrides all the other deletes

shouldn't be an issue in the desktop app version since instead of having slime2 manage the message list, widgets will be managing those lists instead and deleting elements directly
 

sylphrin
she/her

New member
Streamer
ok yea the problem is definitely how I manage the state for that, it's possible that if multiple delete requests happen near simultaneously then the last processed delete within that batch overrides all the other deletes

shouldn't be an issue in the desktop app version since instead of having slime2 manage the message list, widgets will be managing those lists instead and deleting elements directly
Thank you so much for looking into it!

You mentioned a desktop app version, is that something different to what I have? Sorry if that's a dumb question haha
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Thank you so much for looking into it!

You mentioned a desktop app version, is that something different to what I have? Sorry if that's a dumb question haha
yea, so currently slime2 widgets are just a local webpage that includes the slime2 core code. there's a lot of limitations with that, including being unable to automatically save settings, having to download a key for authentication (which relies on an external server), etc.

i'm working on building a desktop app that makes all of this more intuitive and automatic to improve the user experience, including being an all in one place to manage slime2 widgets, having all the authentication handled locally, and having the core code be separate from widgets, so that they can be updated independently rather than widgets needing to update every time the core updates

it'll also be open source, so that it can continue to live on and be community maintained 💜
 

sylphrin
she/her

New member
Streamer
yea, so currently slime2 widgets are just a local webpage that includes the slime2 core code. there's a lot of limitations with that, including being unable to automatically save settings, having to download a key for authentication (which relies on an external server), etc.

i'm working on building a desktop app that makes all of this more intuitive and automatic to improve the user experience, including being an all in one place to manage slime2 widgets, having all the authentication handled locally, and having the core code be separate from widgets, so that they can be updated independently rather than widgets needing to update every time the core updates

it'll also be open source, so that it can continue to live on and be community maintained 💜
Oh wow that sounds great!! I love that it's open source as well! I look forward to its release, thanks so much for your hard work ♥
 
Back
Top