Villager Chat

Villager Chat [Paid] 2.1.5

OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer

ethan_rawkes
he/him

New member
Hi there! Love this chat overlay so much. However, I was wondering if it's possible to set a default villager for all chatters and then assign villagers manually later per chatter?

I could probably noodle around and figure something out, but I was wondering if that was an approved way that wouldn't break everything.
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Hi there! Love this chat overlay so much. However, I was wondering if it's possible to set a default villager for all chatters and then assign villagers manually later per chatter?

I could probably noodle around and figure something out, but I was wondering if that was an approved way that wouldn't break everything.
hmmm, yea I guess if you wanted to remove the randomness entirely then you can do this:

open villager.js and find the getVillager function:
JavaScript:
// gets the user's randomly assigned villager
function getVillager(user) {
  const { userName } = user

  // get the assigned villager from this session
  let storedUserData = userData[userName]

  // if this was the first chat from the user during this session, they
  // don't have any stored data, so create new stored data for them
  if (!storedUserData) {
    storedUserData = { villagerName: randomVillagerName() }

    // store the user data so that the user will always have the same color
    userData[userName] = storedUserData
  }

  return villagerData[storedUserData.villagerName]
}

and on the line where it uses randomVillagerName(), give it a specific villager name surrounded in quotes instead, like this:
JavaScript:
storedUserData = { villagerName: 'Ankha' }
 

GoldenGirlJay
She/Her

New member
Is it possible to have certain Villagers from the villager chat only be available to people who have it as their Permanent Villager Assignment? so for example if I had 1 person manually set to Coco, could I make it that no one else could be Coco through simply joining and/or rerolling?
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Is it possible to have certain Villagers from the villager chat only be available to people who have it as their Permanent Villager Assignment? so for example if I had 1 person manually set to Coco, could I make it that no one else could be Coco through simply joining and/or rerolling?
Alright it requires a bit of JavaScript modification but I figured it out. So in villager.js, first you want to find this:
JavaScript:
const userData = {
  zaytri: {
    villagerName: 'Ankha',
  },
}


And change it to this:
JavaScript:
const permanentUserData = {
  zaytri: {
    villagerName: 'Ankha',
  },
}

const userData = { ...permanentUserData }

This allows the code to keep a copy of the initial permanent user data separate from the user data used for random assignment.

Then, find the randomVillagerName function, which looks like this:
JavaScript:
function randomVillagerName() {
  const villagers = Object.values(villagerData)
  const villagerCount = villagers.length

  return villagers[randomInteger(0, villagerCount - 1)].name
}

And change it to this:
JavaScript:
function randomVillagerName() {
  const permanentVillagers = Object.values(permanentUserData).map(user => user.villagerName)
  const villagers = Object.values(villagerData).filter((villager) => {
    return !permanentVillagers.includes(villager.name)
  })
  const villagerCount = villagers.length

  return villagers[randomInteger(0, villagerCount - 1)].name
}

Which lets it filter out the villager names used in the permanent villager assignment.
 

Telliam
She/Her

New member
Hi!
I'm super interested by your villager overlay, for the customizable options... also I don't know anything about coding 😅
I would like to know if it's possible to fix the position of the bubbles? I would like them to pop randomly but between several places on my overlay, were caracters are drawn 🧐
(Edit: i've not bought it yet because I would really need that option for my new overlay project)
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Hi!
I'm super interested by your villager overlay, for the customizable options... also I don't know anything about coding 😅
I would like to know if it's possible to fix the position of the bubbles? I would like them to pop randomly but between several places on my overlay, were caracters are drawn 🧐
(Edit: i've not bought it yet because I would really need that option for my new overlay project)
Could you show me a sketch of what that would look like?
 

Telliam
She/Her

New member
Hi!
Here is a part of the project I'm working on ↓

What I'm looking for is to make the chat bubble pop and desappear randomly between defined places, with the viewer name and other options your allowed (VIP badges...). That would be "fixing" the places where they can appear on the overlay, like anchors 🧐
I would like to add the caracters we use too insted of the villager faces, I'm not sure if it would work, like this one : archer animé vid telliam émote.gif test.jpg
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Hi!
Here is a part of the project I'm working on ↓

What I'm looking for is to make the chat bubble pop and desappear randomly between defined places, with the viewer name and other options your allowed (VIP badges...). That would be "fixing" the places where they can appear on the overlay, like anchors 🧐
I would like to add the caracters we use too insted of the villager faces, I'm not sure if it would work, like this one : View attachment 24View attachment 23
perfect I understand it now

I can make that work, but due to the technical complexity and personalization of this request, it would need to be done as a custom commission. My commission details are here: https://ko-fi.com/zaytri/commissions
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
Zaytri updated Villager Chat with a new update entry:

Now with settings!

v2.0.0 introduces a settings screen, where you can customize Villager Chat all you want!

PltOW77.png

Read the rest of this update entry...
 

jaakii
she/her

New member
hiii <3
im trying to figure out how to add sound effects to the messages, i also tried to add a custom villager image.
for both it always showed 1700053281251.png
for the sound i tried both mp3 and wav, for the image i tried png and a link from imgur

i put it into the chat folder and i tried create a folder within there called Assets but both did not work too :c

where is this widget assets folder?
i cant seem to find it.
 
OP
OP
Zaytri

Zaytri
she/her

Glitch Witch
Admin
Developer
Streamer
hiii <3
im trying to figure out how to add sound effects to the messages, i also tried to add a custom villager image.
for both it always showed View attachment 27
for the sound i tried both mp3 and wav, for the image i tried png and a link from imgur

i put it into the chat folder and i tried create a folder within there called Assets but both did not work too :c

where is this widget assets folder?
i cant seem to find it.
you'll need to create the assets folder
make sure it's lowercase, like this:

dJ3iKg2.png


Edit: I added an assets folder with a README.txt inside there for v2.0.1 (can't put empty folders in a ZIP file), hopefully that should clear up future confusion.
 
Last edited:

slashie101
she/her

Moderator
Moderator
Streamer
Back
Top