[Mod] Villagers for Minetest [villagers][v0.17]

daddaaddaaad
New member
Posts: 4
Joined: Tue Jul 24, 2018 11:24

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by daddaaddaaad » Post

Sokomine wrote: Maybe they don't want to freeze their feet ,-)
You're probably right :D

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Diamond knight » Post

Is this mod still being developed? I would hate to see one of the few quality villager mods die.

trungus
Member
Posts: 10
Joined: Thu Apr 19, 2018 18:14
In-game: Trungus

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by trungus » Post

Hi Guy

I first place I want to thanks to ErrorNull, this mod is great! I'm testing it for a small home server and I like it a lot.
I have a question, anybody knows any way to lower the quantity of villagers?, the machine used as a server is quite old so if I have too many entities the lag rise up fast.
So far I check the code of villagers and villages looking for a way to do it, without success, I only understand that villagers come to live with a kind of spawner but I couldn't find any that register it o control it.
Mi machine run on a bare Debian Stretch, 1GB Ram with a compiled version of Minetest 0.4.17.1 with LuaJit.

Best Regards and Thank you in advance.
Trungus

User avatar
ErrorNull
Member
Posts: 222
Joined: Thu Mar 03, 2016 00:43

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by ErrorNull » Post

hey guys, thanks for the kind words. it's been a while for sure.. and glad to see my mod is still being poked and prodded around here. i've just been busy with real life stuff. since it appears there's still mild interest in this mod, i'll plan to continue improving my villagers mod soon.
trungus wrote:I have a question, anybody knows any way to lower the quantity of villagers?, the machine used as a server is quite old so if I have too many entities the lag rise up fast. So far I check the code of villagers and villages looking for a way to do it, without success, I only understand that villagers come to live with a kind of spawner but I couldn't find any that register it o control it.
Trungus

the quantity of villagers is automatically determined by Sokomine's villages mod, in which a predetermined number of beds are installed within each spawned building. The quantity of my villagers simply matches the number of beds. i could possibly introduce an option that reduce the 100% bed-correspondence to say 80% or 50%. I'll look into it once i jump back into this...
My Villagers Mod: [villagers]

trungus
Member
Posts: 10
Joined: Thu Apr 19, 2018 18:14
In-game: Trungus

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by trungus » Post

ErrorNull wrote:hey guys, thanks for the kind words. it's been a while for sure.. and glad to see my mod is still being poked and prodded around here. i've just been busy with real life stuff. since it appears there's still mild interest in this mod, i'll plan to continue improving my villagers mod soon.
trungus wrote:I have a question, anybody knows any way to lower the quantity of villagers?, the machine used as a server is quite old so if I have too many entities the lag rise up fast. So far I check the code of villagers and villages looking for a way to do it, without success, I only understand that villagers come to live with a kind of spawner but I couldn't find any that register it o control it.
Trungus

the quantity of villagers is automatically determined by Sokomine's villages mod, in which a predetermined number of beds are installed within each spawned building. The quantity of my villagers simply matches the number of beds. i could possibly introduce an option that reduce the 100% bed-correspondence to say 80% or 50%. I'll look into it once i jump back into this...
You are joking? ... your work is great, I fly around the village and I can see plenty of life if the server, if you found some way to help me to reduce the numbers of villagers, will be great.

About "real life stuff", I know exactly what you say, this is the third time that I working with my childs to assembly a server, is not easy man, I hope your life should be a bit easiers now, we need a time for fun, just fot the sake of the fun.

Best Regards and Thanks again

Meaty
New member
Posts: 4
Joined: Wed May 15, 2019 03:37

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Meaty » Post

Hello and thank you for the awesome mod!

I have, perhaps silly, question: when I enable only mg_villlages, handle_schematics, and villagers on 5.0.1, all works fine except the fact that villagers do not move. They stand still near the buildings, turn around every 3-4 seconds but does not walk. The /villagers list shows Walked 0 for each of them. All mods are taken from the GitHub and have the latest versions.
Is there any way to debug such behavior? What sort of logs should I check in order to troubleshoot that?
Thanks!

User avatar
ErrorNull
Member
Posts: 222
Joined: Thu Mar 03, 2016 00:43

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by ErrorNull » Post

Meaty wrote:Hello and thank you for the awesome mod!

I have, perhaps silly, question: when I enable only mg_villlages, handle_schematics, and villagers on 5.0.1, all works fine except the fact that villagers do not move. They stand still near the buildings, turn around every 3-4 seconds but does not walk. The /villagers list shows Walked 0 for each of them. All mods are taken from the GitHub and have the latest versions.
Is there any way to debug such behavior? What sort of logs should I check in order to troubleshoot that?
Thanks!

Hi Meaty,

I would look into the 'functions.lua' and 'actions.lua' as this is where i defined the code the villager movement. i haven't looked into my code for a while, but suspect that with the latest minetest version, may have something to do with how villagers are [failing] verifying if a node in front of them is clear or not for walking forward. hope that helps.
My Villagers Mod: [villagers]

User avatar
MyordasMineTest
Member
Posts: 17
Joined: Sat Dec 14, 2019 05:57
Location: Bataan Province, Philippines

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by MyordasMineTest » Post

Can you add marrying/loving a villager?

MattCommish
New member
Posts: 8
Joined: Thu Jun 14, 2018 07:33

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by MattCommish » Post

Hi!
I am a teacher running a class for elementary school kids in Minetest. I am not very tech savvy. I have installed your villagers mod. For the curriculum I am trying to do, I'd like to try to spawn villagers in towns that the kids are designing and building? Is that possible to do? If you could let me know how, it would be a huge help!
Thanks so much,
Matt

User avatar
Devy
Member
Posts: 133
Joined: Sat Jan 21, 2017 02:31
GitHub: CoderForTheBetter
In-game: devy

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Devy » Post

MattCommish wrote:Hi!
I am a teacher running a class for elementary school kids in Minetest. I am not very tech savvy. I have installed your villagers mod. For the curriculum I am trying to do, I'd like to try to spawn villagers in towns that the kids are designing and building? Is that possible to do? If you could let me know how, it would be a huge help!
Thanks so much,
Matt
Hi, I looked at the Github here: https://github.com/ErrorNull0/villagers ... s.lua#L150 and doing

Code: Select all

/villagers list
should do something. I have not tested it.

WyomingWill
Member
Posts: 22
Joined: Sun Aug 16, 2020 05:41

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by WyomingWill » Post

Does Villagers work for the newer Minetests like Version 5.3?
I've included only the mods: cottages, handle_schematics, mg_villages, and villagers.

The villagers appear, but they only "turn" and "stand". They do converse and
one can trade with them.

But they do not walk around or budge from their initial spots.

The code appears to imply that they CAN walk around, but I'm unable to get
that behavior no matter what I do to modify the code. Sometimes I've been able
to get a little "leg jitter" from the traders, but that's it.

I found the following video, which indicates that the villagers could walk in the past?

https://www.youtube.com/watch?v=Q7RXlWu3IrA

I do see that "Meaty" asked about this in 2019. Has there been any resolution? If not, I'll poke around some more.

This is a really terrific mod and I appreciate all the work you have done with it. I'm going to introduce this to my grandson this weekend. ;-)

Thanks, Bill

User avatar
Hagrid669
New member
Posts: 4
Joined: Sun Mar 29, 2020 19:32

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by Hagrid669 » Post

It's really a very, very good mod for villagers in mg_village. Unfortunately, with recent minetest updates somethings should have changed (I think) about how position and collision box are determined, and so villagers no longer move themselves from site.
As suggested by the author I'm going to look, as soon as I can, into the 'functions.lua' and 'actions.lua' where the movement code is defined. The suspect that may have something to do with how villagers are [failing] verifying if a node in front of them is clear helped me a lot: if I clear one block below NPC feet they start moving, infact!

Thanks for this great mod!
I'm gonna let you know if I can correct the code to fit Minetest version 5.1.1. I have.

WyomingWill
Member
Posts: 22
Joined: Sun Aug 16, 2020 05:41

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by WyomingWill » Post

I have made a few changes to the code to get the villagers moving. Unfortunately they now can walk over water and in the air, but perhaps this will help people get a start.... at least my grandson was amused by things and it was good enough. Walking over the water was sort of fun, actually, as villagers escaped their little islands.

In actions.lua:

I replaced:
-- if not minetest.registered_nodes[nodenames[1]].walkable then
with:
if false then

Also, I replaced:
-- if not minetest.registered_nodes[nodenames[1]].walkable then
with:
if not nodenames[1] == "air" then

and, I replaced:
-- if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then
with:
if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" or tNodeDrawtype == "normal" then

Please note that these are TOTAL hacks, done in desperation and confusion, as I poked around in the code trying to understand it and they are clearly not the right way to do things.

But, as I said, it might help someone figure the right way to do it, and I've love to hear about that.

I made other small mods to prevent crashes due to "nil" items, but I believe the three changes above made villagers start moving.

stefapi
New member
Posts: 1
Joined: Mon Apr 05, 2021 20:49

Re: [Mod] Villagers for Minetest [villagers][v0.17]

by stefapi » Post

A bug fix for the code of villagers.

@@ -11,7 +11,7 @@
--check vertical pos at villager's lowerbody
+ nodenames = villagers.getNodeName({x=pos.x, y=pos.y+1, z=pos.z})
- nodenames = villagers.getNodeName({x=pos.x, y=pos.y, z=pos.z})

@@ -21,7 +21,7 @@
--check vertical pos at villager's upperbody
+ nodenames = villagers.getNodeName({x=pos.x, y=pos.y+2, z=pos.z})
- nodenames = villagers.getNodeName({x=pos.x, y=pos.y+1, z=pos.z})

@@ -31,7 +31,7 @@
--check vertical pos below villager's feet
+ nodenames = villagers.getNodeName({x=pos.x, y=pos.y, z=pos.z})
- nodenames = villagers.getNodeName({x=pos.x, y=pos.y-1, z=pos.z})
local nodename = nodenames[2]

@@ -434,7 +434,7 @@
-- air, ladders/signs, and torches
- if tNodeDrawtype == "normal" or tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then
- if tNodeDrawtype == "airlike" or tNodeDrawtype == "signlike" or tNodeDrawtype == "torchlike" then

This seems to work great and Mobs are no more falling in water.

Tested with Minetest version 5.3

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests