[Mod] Villages for Minetest [mg_villages]

sil_el_mot
Member
Posts: 13
Joined: Sat Feb 11, 2017 17:49
In-game: sil_el_mot

Re: [Mod] Villages for Minetest [mg_villages]

hey and hello
i am new to minetest and hoped smbd can help me, how i can activate npcs of mobs_redo , so they spawn in villages. i read , that others managed to spawn them at the villages-node, but what excactely do i have to do to get this working?

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

* Fixed bug in relation to mod_security.
* The 3d torches from minetest_game are now used.
* Added a new house, a shed with a forge and a shed with a pasture for animals (no animals included so far)
* Fixed some issues with Ethereal biomes and ground types (i.e. bushes) not beeing properly detected.
* Fixed bug with glass looking strange if the node used to have param2 set.
* Added a new village type spawn. If that mod is installed and mg_villages.FIRST_VILLAGE_TYPE = 'spawn'; is set, the first village created will consist of some sort of spawn house sourrounded by empty plots which can be bought by players. There's also a public farm included (without seeds). Creating only a single house in the first village was requested on github and may be needed for Adventuretest in the future as well. The village type looks like this:

hajo wrote: Using commands like "/visit 6", I found at least 2 villages where the teleport-spot was buried in stone, and I had to dig out.

That might still happen. But it ought to be rare. I hope to catch that bug eventually.

hajo wrote: I also found no texture for that on github

Thanks! The handle_schematics_support.png texture was indeed missing. I've added it in the meantime. The texture is used for a scaffolding node used by handle_schematics. The idea was (and still is) for the build_chest to spawn individual buildings with all nodes replaced by those scaffolding nodes first. When the player adds blocks to the chest, those get placed. That used to work to some degree in random_buildings but needs more work.

If you want to craft some of those nodes:

ErrorNull wrote: Sokomine my kids and I love your village mod. It is fantastic. I do have one small request, and probably is easy one... sfan's latest minetest build now uses the updated 3d torches as default. It would be cool to see mt_villages:torch nodes follow this update too!

These 3d torches seem to be loved a lot. And the new ones really don't look bad at all. I've changed the torches to the new 3d ones. It will only affect new worlds and requires updating mg_villages and handle_schematics. If you want the torches in existing worlds to mutate into the new ones, add mg_villages:torch to the register_lbm call in minetest_game/mods/default/torch.lua file:

Code: Select all

nodenames = {"default:torch", "torches:floor", "torches:wall", "mg_villages:torch"]

ErrorNull wrote: I also have another idea. How about small villages that spawn in caves or special structures in the nether? It will enhance the underground and make players want to explore underground even more.
Villages in caves would be very tricky. Please keep in mind that such a setup exceeds the building capabilities of quite a lot of human players. Creating an algorithm for that would be more than difficult. I only got further with my villages once I decided to ignore height level and just flattend the area. It might be possible to just spawn normal villages and adjust the ceiling in a suitable way, but it would be a lot of work and most likely not look convincing. As to the nether - I don't like it very much as it's too dark to see anything. I have no idea which buildings might fit in there. Maybe the best approach would be to stick to very simple shapes and just spawn them randomly using the mapgen.
BirgitLachner wrote: Where can I get this mod? I can't find it!
Sadly, the mods needed for the canadian villages (built by Mauvebics wife) can no longer be obtained. Mauvebic doesn't have a copy anymore, told me that my copy is outdated, and he wasn't willing to give his ok to re-release that old version.
BirgitLachner wrote: Another thing ... I tried it with the Valley-Mapgen and there where terrible errors as the villages are placed "in" mountais that I got huge walls where the village was built in.
The valley mapgen is a great mapgen. It creates huge mountains and valleys. The trouble is: That's not a very convenient place for a village to sit in. Villages try to adjust their height to the sourrounding terrain. If the mountains get too heigh, that'll fail. In order to speed things up, mapchunks are only processed at the height levels at which a village is likely to occour (mostly the mapchunk containing height level 0).
BirgitLachner wrote: There is a problem with the torch as when I added some mods after generating the map the villages torches become unknown (with the special block)
The torches used to be mg_villages:torch torches up until quite recently. It's strange if they mutated. Can you turn on debug and check what they turned into?
BirgitLachner wrote: to me only the doors give problems, I have to break them and add them back to the hotel, I did a little editing and works best but it is not entirely stable. As soon as I work out quite public the modified code.
Doors changed some time ago into a new way of working (2 nodes high instead of one node high). As long as the version of minetest_game and mg_villages and handle_schematics share the same interpretation (by now: 2 nodes high doors), there ought to be no problem. Some doors may still be rotated wrongly, but that's another bug.
CuriousNoob wrote: Mod security: Blocked attempted read from mg_all_villages.data
Took a while, but the bug was hunted down. Apparently reading files from the world folder requires adding the appropriate path now.
CuriousNoob wrote: Definitely no multi-house villages, and nothing at spawn, and nothing at ground-level.
If you don't have my cottages mod installed, you need to change the config.lua file so that you'll get a village type that does work with the default mods alone:

Code: Select all

mg_villages.FIRST_VILLAGE_TYPE = 'nore';

You can also use the village type 'taoki' - or, if you have the corresponding village_* mod installed, 'gambit', 'towntest', 'ruins' and 'sandcity' will most likely work as well as those houses don't require anything apart from what minetest_game comes with. I strongly suggest to install my cottages mod. It adds a lot of nodes that are used for medieval villages, lumberjack settlements, logcabins, tent villages etc. If you install the dryplants mod as well, you'll get additional grasshut villages.
CuriousNoob wrote: As you say, the mod-security is still a bit of a tricky one, as I prefer to run locked-down settings wherever possible. The white-listing ''secure.trusted_mods'' setting doesn't seem to be sufficient to get around it.
Same here. And in general mg_villages as such ought to have no problem with mod_security. That was a very annoying bug and took me some time to find and fix. What I can't fix is that handle_schematics can't provide a file browser for schematics in other worlds and mod folders as security is so tight that reading schems from elsewhere is considered a security violation :-(
Me Me and Me wrote: There doesn't seem to be much of a market for mese (I have more than 30 crystals!)
Er, too much mese? I'm sure people on multiplayer servers could help you get rid of it very fast *veg*. But you're right: Some plots are probably too cheap to buy. I've added more expensive ones in the new village_spawn village type. Costs about 1 mese crystal per square meter.
sil_el_mot wrote: i am new to minetest and hoped smbd can help me, how i can activate npcs of mobs_redo , so they spawn in villages. i read , that others managed to spawn them at the villages-node, but what excactely do i have to do to get this working?
They changed the places where the mobs spawn. Usually that's something like default:dirt_with_grass. Take a look at the mod that belongs to the npc and search for mobs:spawn. Inside there you'll see the nodes entry. Add "handle_schematics:plotmarker" to that list.

I'll see what can be done regarding mobs. It feels a lot better if they run around. Medieval villages are also places where I'd expect loose chicken (and maybe the occasional sheep or goat) to be - and not in the wilderness. Maybe something can be done so that the next release of my villages modpack will include more "life".

Also don't forget to take a look at BrandonReeses Adventuretest subgame. It makes use of my villages and has a lot to offer. His villagers are very active, fight against mobs, offer some quests, replant their fields, and are very entertaining :-)
Attachments
spawn_village2.jpg
craft_scaffolding.jpg
scaffolding.jpg
A list of my mods can be found here.

mr_dean
Member
Posts: 30
Joined: Fri Jan 06, 2017 00:38
In-game: mr_dean
Location: Modding...

Re: [Mod] Villages for Minetest [mg_villages]

Just a question, has anyone else noticed the chests in the villages have no metadata? I love the mod, but, I wish I could get treasure from the villages, as it seems that if there is chests than you should be able to get something from them.
I know you believe you understand what you think I said, but, I am not sure that what you heard is not what I meant. - Author Unknown

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

The chests and shelves ought to have metadata and some content. It's not much - most villagers are rather poor - but there ought to be something (torches, occasional string, stone tools...). Adventuretest fills its chests with more treasure.

Normal chests other than the special ones in medieval and similar villages did not get any content so far. I've changed that so that default chests will get random content now as well. Please update your copy of mg_villages and handle_schematics to the most recent version.
A list of my mods can be found here.

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

Re: [Mod] Villages for Minetest [mg_villages]

* Fixed bug in relation to mod_security.
* The 3d torches from minetest_game are now used.
* Added a new house, a shed with a forge and a shed with a pasture for animals (no animals included so far)
* Fixed some issues with Ethereal biomes and ground types (i.e. bushes) not beeing properly detected.
* Fixed bug with glass looking strange if the node used to have param2 set.
* Added a new village type spawn.
ErrorNull wrote: I also have another idea. How about small villages that spawn in caves or special structures in the nether? It will enhance the underground and make players want to explore underground even more.
Villages in caves would be very tricky. Please keep in mind that such a setup exceeds the building capabilities of quite a lot of human players. Creating an algorithm for that would be more than difficult. I only got further with my villages once I decided to ignore height level and just flattend the area. It might be possible to just spawn normal villages and adjust the ceiling in a suitable way, but it would be a lot of work and most likely not look convincing. As to the nether - I don't like it very much as it's too dark to see anything. I have no idea which buildings might fit in there. Maybe the best approach would be to stick to very simple shapes and just spawn them randomly using the mapgen.
Great to see another update to your villages mod! And yes! 3D torches. You're awesome. I see what you're saying about villages underground and how it's tricky with the varying heights. I would be completely satisfied with very primitive blocky huts down in the nether, hell, caverealms mods, etc. My desire is to see some friendly basic mob villages down there like goblins via mobs-redo and how it links with your villages mod. Tiny mob villages would break up the monotony of the large open expanses and provide more interactivity while adventuring underground. Keep up the great work!
My Villagers Mod: [villagers]

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

ErrorNull wrote:
* Added a new house, a shed with a forge and a shed with a pasture for animals
* Added a new village type spawn.
ErrorNull wrote: I also have another idea. How about small villages that spawn in caves or special structures in the nether?
It will enhance the underground and make players want to explore underground even more.
Villages in caves would be very tricky. .. Creating an algorithm for that would be more than difficult.
I see what you're saying about villages underground and how it's tricky with the varying heights.
I would be completely satisfied with very primitive blocky huts down in the nether, hell, caverealms mods, etc.
Maybe have a look at pueblos.
I think those could be done fairly easy, given a cave with some height,
and a cavewall that can be 'caved out' for another 6-8 blocks.

zorman2000
Member
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Villages for Minetest [mg_villages]

Hello Sokomine,

First of all, a huge thanks for this awesome mod and for keeping it up-to-date! I really love this mod and use it in almost every world I create!

Now, the only thing I would really like to have in villages that would make it perfect is to have villagers. I'm working currently on a mod to do exactly that (https://github.com/hkzorman/advanced_npc) and while working on it I came up with a question about mg_villages.

I know you fill up the chests and shelves with random items. Is there a way for external mods to add items so that they come up as well in the chests and shelves randomly? Is there some API or function I can call to add an item from my mod so that it also spawns on chests and shelves?

In the same topic, I know that a few villages (not medieval though) have bookshelves on the buildings. Can bookshelves be filled as well?

Thanks!

mase
Member
Posts: 63
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Villages for Minetest [mg_villages]

Can't I configure the mod via minetest.conf, instead of config.lua only? I think, it would
be better to have this central config file. This ensures persistance after mod updates.

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

zorman2000 wrote: Now, the only thing I would really like to have in villages that would make it perfect is to have villagers. I'm working currently on a mod to do exactly that (https://github.com/hkzorman/advanced_npc) and while working on it I came up with a question about mg_villages.
I'm waiting for such a mod :-) The villages are a lot nicer if mobs are roaming around there. Please create a thread for your mod (even if it's not finished yet) so that it can be properly discussed - and located by other players. Sadly, I didn't get your mod to run. Including it in secure.trusted_mods didn't seem to work for me (and it didn't work for my handle_schematics mod anymore either). I'd love to test your mod. Do you have any ideas what might cause the security problems?
zorman2000 wrote: I know you fill up the chests and shelves with random items. Is there a way for external mods to add items so that they come up as well in the chests and shelves randomly? Is there some API or function I can call to add an item from my mod so that it also spawns on chests and shelves?
In theory, adding further entries to mg_villages.random_chest_content like in fill_chest.lua ought to be enough as long as you just want to add something.
zorman2000 wrote: n the same topic, I know that a few villages (not medieval though) have bookshelves on the buildings. Can bookshelves be filled as well?
The medieval villages got bookshelves some time ago as well :-) There are two of them hidden inside the church. That seemed to be the only fitting place in a medieval village. The subgame adventuretest relies on bookshelves as tools for managing experience points. I'll see what can be done in order to fill bookshelves as well.
mase wrote: Can't I configure the mod via minetest.conf, instead of config.lua only? I think, it would
be better to have this central config file. This ensures persistance after mod updates.
You may be right about that. I'll try to figure out how complicated such a change would be.
A list of my mods can be found here.

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

Bookshelves are now filled with (empty) books.

The function mg_villages.fill_one_chest_random is used for filling chests, shelves, bookshelves etc. with content and can be exchanged/overwritten by other mods if there is any need.
A list of my mods can be found here.

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

Re: [Mod] Villages for Minetest [mg_villages]

Hi Sokomine - I'm working on a villagers mod that spawns into your beautiful villages. I'm doing this by hooking directly into your API function "mg_villages.part_of_village_spawned = function( village, minp, maxp, data, param2_data, a, cid )"

I'm making good progress. Each villager now spawns next to their building (except for roads) standing on an open area and with the following random characteristics: gender, height, eye color, clothing based on gender, names based on gender, upper body and lower body clothing, shoes/boots, and clothing type and color.

The next feature I want to add is for the villager's clothing to correspond to the village/town's climate. I already have the code implemented in my mod where I can give a parameter (eg. hot, cold, normal) and the villagers clothing matches that climate.

All I'm wondering now is if your mg_villages mod has a variable or parameter available that tracks the climate of the region where that village/town is generated. I would like to pass that parameter to my mod so my villagers can wear long-sleeved clothing and jackets for snowy towns and shorts and sleeveless tops for desert towns!
screenshot.PNG
My Villagers Mod: [villagers]

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

ErrorNull wrote: Hi Sokomine - I'm working on a villagers mod that spawns into your beautiful villages. I'm doing this by hooking directly into your API function "mg_villages.part_of_village_spawned = function( village, minp, maxp, data, param2_data, a, cid )"
I'm glad that the funcion is of use.
ErrorNull wrote: I'm making good progress. Each villager now spawns next to their building (except for roads) standing on an open area and with the following random characteristics: gender, height, eye color, clothing based on gender, names based on gender, upper body and lower body clothing, shoes/boots, and clothing type and color.
That sounds excellent! My mobf_traders are far too boring with the few skins they have - and i'm not good at creating skins. Mixing them up and giving each villager individual clothing and appearance sounds very fine. I'm looking forward to see it in action.
ErrorNull wrote: The next feature I want to add is for the villager's clothing to correspond to the village/town's climate. I already have the code implemented in my mod where I can give a parameter (eg. hot, cold, normal) and the villagers clothing matches that climate.
Ahh. Mobs with fitting clothes. That's a very good idea! But I'm afraid you'll mostly have to invent your own climates or try to derive them from mapgen/biomes. mg_villages is built so that it can deal with almost any mapgen. It has no idea about the climate in the region. It just keeps the ground the way it was before.

There are only few exceptions: Some random villages are covered with snow. Those have mg_villages.all_villages[ village_id ].artificial_snow set to true. Another exception are villages of the type sandcity - those are desert villages (they never get artificial snow covers). Most other village types are set somewhere in temperate climate. The types medieval and charachoal stand for medieval european/German villages and sourroundings (definitely temperate climate). lumberjack and logcabin may be slightly more modern (settlement of the USA?). The wood has to come from somewhere, so it's probably neither a desert nor permafrost. Type grasshut will probably be seen very rarely as it requires further mods. The climate there would be savannah or similar. Villages of the type taoki grow cotton, so they'll probably sit in a suitable climate. Claytrader, tent, nore (that's the type shown in the screenshot), gambit, modern houses, ruins and towntest could be anywhere.
ErrorNull wrote: All I'm wondering now is if your mg_villages mod has a variable or parameter available that tracks the climate of the region where that village/town is generated. I would like to pass that parameter to my mod so my villagers can wear long-sleeved clothing and jackets for snowy towns and shorts and sleeveless tops for desert towns!
Very nice :-) Hope your mod will be available soon. And as long as all of the villagers of one settlement wear one type of clothing, it ought to be convincing enough. There might be a desert next to a glacier behind the next hill anyway.
A list of my mods can be found here.

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

Re: [Mod] Villages for Minetest [mg_villages]

thanks for the clarification Sokomine. i'm not familiar with how to work with biomes at this time. so I will have my villager's clothing types be chosen based on your village types - grasshut, lumberjack, tent, medieval, etc.

my clothing types are only very basic, like for cold weather, hot weather, 'normal' weather. which means in cold weather the villagers have long sleeves and jackets and boots and hot weather they have on shorts, skirts and sandals, and 'normal' is combination. villager's skin color is also variable, where hot weather tend to have darker skinned villagers.

i have now updated my mod to look for your artificial_snow parameter.. and when it is value of '1' my mod will show villagers' clothing for cold climate. but i have found a strange behavior with your 'moresnow' mod. i am using your latest version from december 2016.

when i try to dig farming crops in the villages that have the artificial snow, the adjacent snow nodes suddenly show as snow drops for a split second then it disappears, then the entire row of crops disappear! i notice that all the crops have the node 'moresnow:snow_top' inside them.. so when i aim at the crops, it is this 'snow_top' node i'm actually hitting. is this a glitch that is known and can something be done to fix it? i had TenPlus1 farming redo mod installed, so when i removed it, the strange behavior is still there. Refer to images below. thank you!

UPDATE: actually i realized that only server admin can dig the village crops. so during normal gameplay, regular players will not have that privilege to dig them so i suppose this issue would not occur.

Attachments
03.png
02.png
01.png
My Villagers Mod: [villagers]

FaceDeer
Member
Posts: 491
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Villages for Minetest [mg_villages]

If anyone's still interested in the villages-in-caves idea, I just recently did some work on another mod that might be of use here. I wanted to make my own version of Caverealms with different cave decor and in the process of pulling Caverealms apart to get the useful pieces out of it I created the utility mod Subterrane.

It provides an API that might allow for village buildings to be added in the giant caverns it produces. I haven't looked at Village's code so I'm not sure how it goes about deciding where to position stuff, though, so I make no guarantees. I'm still pretty new at the mapgen side of Minetest modding so Subterrane is likely to need some refinement.

Edit: Just skimmed through Villages' massive mapgen.lua. Yow. :) Hooking Subterrane up to this directly will likely be a lot of trouble, but maybe I can steal some ideas and add a simplified building-placement function for the caverns that could cobble together some villages. I'll have the advantage that no real-life villages were ever built in an environment like that, so I can use workarounds to make things easier and pretend that that's just how cave-dwellers build their villages.

zorman2000
Member
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Villages for Minetest [mg_villages]

Sokomine wrote:Bookshelves are now filled with (empty) books.

The function mg_villages.fill_one_chest_random is used for filling chests, shelves, bookshelves etc. with content and can be exchanged/overwritten by other mods if there is any need.
Hello Sokomine! Thanks for your very comprehensive answer; it's very appreciated. And also, thanks for pointing me out to this, really helpful!

I found an issue with mod security as well, I will let you know when I have fixed it... And yes, will soon create a thread!

zorman2000
Member
Posts: 83
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Villages for Minetest [mg_villages]

EDIT: Nevermind, I found out how! The plot has "brotate"!

Hello Sokomine!

Currently working on my mod, and noticed I need to know the "orientation" of a plot in order to scan the nodes inside the building... the purpose of this is that I want to find how many and in which positions are furnaces, beds, etc. inside a building.
I basically want to scan an area starting from the plotmarker to the end of the building, using the building's x, y and z-size. However, I can't add up properly to get the end coordinate without knowing in which direction the plotmarker is "facing".

I have seen that in mg_villages.all_villages.to_add_data.bpos there is an "orients" key, but it seems to be zero regardless of orientation, so I guess this doesn't really is.

In short, is there a way to know the "orientation" (meaning, facing at +x, -x, +z or -z) of a plot in a village?

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

ErrorNull wrote: my clothing types are only very basic, like for cold weather, hot weather, 'normal' weather. which means in cold weather the villagers have long sleeves and jackets and boots and hot weather they have on shorts, skirts and sandals, and 'normal' is combination. villager's skin color is also variable, where hot weather tend to have darker skinned villagers.
Sounds execllent! Can't wait to see them running around. Hope you'll release a version soon.
ErrorNull wrote: when i try to dig farming crops in the villages that have the artificial snow, the adjacent snow nodes suddenly show as snow drops for a split second then it disappears, then the entire row of crops disappear! i notice that all the crops have the node 'moresnow:snow_top' inside them.. so when i aim at the crops, it is this 'snow_top' node i'm actually hitting. is this a glitch that is known and can something be done to fix it? i had TenPlus1 farming redo mod installed, so when i removed it, the strange behavior is still there. Refer to images below. thank you!
I'm aware of this bug but don't have a real solution yet. Moresnow stores the actual snow cover node in the node above the wheat node, but that's not the real problem here. Snow - and also moresnow snow covers - are falling nodes. And wheat gets destroyed if anything falls on it. If you place or dig something, the nodes around get updated. And then the moresnow node decides it has to move into falling mode because the wheat below thinks it can't sustain anything on it, and so they conspire to let the snow fall...and it will propagate through the entire field. It's not nice and may even be bad on servers. It's not easy to solve as sand blocks for example can't be kept up in mid-air by a flower below...but snow can.
ErrorNull wrote: UPDATE: actually i realized that only server admin can dig the village crops. so during normal gameplay, regular players will not have that privilege to dig them so i suppose this issue would not occur.
Regular players can buy a plot in the village and will then be allowed to modify the common area (streets, fields, all that is not another plot). It's also possible to throw a snowball so that it will come to rest right next to a field. That will cause the cascade as well.
FaceDeer wrote: It provides an API that might allow for village buildings to be added in the giant caverns it produces. I haven't looked at Village's code so I'm not sure how it goes about deciding where to position stuff
The decision where to place a village is taken at mapgen time and determined by some sort of (perlin?) noise. It's taken from nores mg mapgen; thus, nore might be able to tell you more. Provided you have the area loaded in a voxelmanip datastructure and can tell if a particular set of x/z-coordinates ought to be part of a village or not, the code might be adjusted.
FaceDeer wrote: I'll have the advantage that no real-life villages were ever built in an environment like that, so I can use workarounds to make things easier and pretend that that's just how cave-dwellers build their villages.
That's an excellent idea. In general, it is easier to place smaller houses. The uneven floor might make things very tricky. It helped a lot to decide to flatten the area first. Truely integrating a building into the environment requires more skill from a human player than just build on flat land. Maybe your houses could be set into the wall, with the roats beeing more or less floating bridges, sometimes supported by pillars. As the landscape is sometimes very tricky, this might not be an easy task at all.
zorman2000 wrote: Currently working on my mod, and noticed I need to know the "orientation" of a plot in order to scan the nodes inside the building... the purpose of this is that I want to find how many and in which positions are furnaces, beds, etc. inside a building.
I basically want to scan an area starting from the plotmarker to the end of the building, using the building's x, y and z-size.
Some of these positions are already collected and processed when the building is placed. Furnaces and chests have formspecs and inventories - those can't be handled by voxelmanip. Their positions are collected in some .extra_calls tables, and the necessary metadata is set up after all has been placed. Perhaps these tables might be of help to you. Positions of beds aren't stored there yet. Weather a mob will be able to reach his bed might also be debateable. Some of my houses are rather small inside and have complicated, narrow paths to the bedrooms, with beds beeing below the roof. Works fine for beds in reality, but in MT, the mob's collusion box might collide with the roof once the mob wants to sleep.
zorman2000 wrote: EDIT: Nevermind, I found out how! The plot has "brotate"!
Glad you found it out. I'm still trying to catch up with the forum and working through the treads. At least there's light now at the end of the tunnel...slowly getting it all read. Sorry I didn't answer earlier.
A list of my mods can be found here.

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

Re: [Mod] Villages for Minetest [mg_villages]

Hi Sokomine,

I got an error when right-clicking on any plotmarker:

Code: Select all

2017-05-31 02:15:47: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'default' in callback item_OnPlace(): C:\games\minetest\bin\..\mods\mg_villages/protection.lua:238: attempt to index a nil value
2017-05-31 02:15:47: ERROR[Main]: stack traceback:
2017-05-31 02:15:47: ERROR[Main]:       C:\games\minetest\bin\..\mods\mg_villages/protection.lua:238: in function 'on_rightclick'
2017-05-31 02:15:47: ERROR[Main]:       C:\games\minetest\bin\..\builtin\game\item.lua:347: in function <C:\games\minetest\bin\..\builtin\game\item.lua:340>

Is this something you are already aware?
I am using the latest build by sfan viewtopic.php?p=272966#p272966 and i'm only using the default settings (no creative mode, and yes enable damage) from the Local Game tab in Minetest Game UI screen.
Attachments
mt-screenshot.png
My Villagers Mod: [villagers]

BirgitLachner
Member
Posts: 391
Joined: Thu May 05, 2016 10:18
In-game: Bibs

Re: [Mod] Villages for Minetest [mg_villages]

@ErrorNull ... what texture are you using. Looks interesting ;-)

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

Re: [Mod] Villages for Minetest [mg_villages]

Hi BirgitLachner - the texturepack is the John Smith texturepack. I prefer a bit more realism in the textures: viewtopic.php?f=4&t=5383

HI SOKOMINE!!! I am very close to uploading the beginings of my villagers mod onto the WIP MODs area of our forum. Should be ok by next week. I did come across an issue. It looks like garden beds and some strips of ground next to a few buildings are missing. I noticed this only after this latest 4.16 minetest build. Could this be something with your mod or an issue for minetest game?

Here are my parameters:
- spawn in default village: NORE
- NORE village configuration size: min=40, max=40
- Minetest world seed: 13465
- no other mods installed
Attachments
mg_villages_03.PNG
mg_villages_02.PNG
mg_villages_01.PNG
My Villagers Mod: [villagers]

azekill_DIABLO
Member
Posts: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: ＯＭＩＣＲＯＮ
Contact:

Re: [Mod] Villages for Minetest [mg_villages]

unknown blocks

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

ErrorNull wrote: I got an error when right-clicking on any plotmarker:
That error message indicates an error related to the traders. I've changed a lot in that area recently and it may no longer be relevant.
ErrorNull wrote: I am very close to uploading the beginings of my villagers mod onto the WIP MODs area of our forum. Should be ok by next week.
That's great! I look forward to see them.
ErrorNull wrote: I did come across an issue. It looks like garden beds and some strips of ground next to a few buildings are missing.
Those are really missing. The error might have crept in when I changed those houses from .we to .mts file format. There are also changes in minetest_game that sum up: upside_down stairs and slabs no longer really exist, doors are diffrent, bookshelves have been changed, and last but not least there are no beds in the old houses. I've reloaded and slightly adjusted the old houses from nore. Please update mg_villages in order to get the newer versions where the bug will no longer occour.

In preparation for real inhabitants, several changes where done. handle_schematics now stores the positions of beds in an array. mg_villages assigns jobs to houses (i.e. a bakery needs a baker, a forge needs some sort of smith). If a house provides a job but no beds to sleep in, a worker in another house will get the job. If there are leftover houses with no jobs assigned but beds for mobs to sleep in, those will get a random (medieval) job assigned. In general, the first inhabitant of a house will always be a male and take on whatever job there is to take. If there's a second bed, the male mob will get a wife. Further beds will be randomly filled with children, the worker's parents or guests (in case of hotels and the like).

If mobf_trader is installed, the inhabitants will be spawned as traders. They will be placed in their respective beds and sleep there forever. They havn't learned how to walk yet. Males get one texture, females another. Children do look a bit...odd. They might need their own model or mob prototype. Names are not yet passed on to the mobs - they don't know how they're called.

If you want to know more about who lives at a given house, click on the plotmarker and then on "Who lives here". You'll get a list in chat with the inhabitants. The first entry is the mob's id, followed by the position of its bed, first name, first letter of middle initial, age and profession/family relationship. If mobf_trader is installed, clicking on "Who lives here" will also reset the mobs to their positions inside their beds. Sometimes they fail to spawn during mapgen.
A list of my mods can be found here.

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

Re: [Mod] Villages for Minetest [mg_villages]

i'm also looking forward to see your inhabitants. i see the new beds and the new information shown from the plotmarkers. very exciting. is there a way for me to obtain the position of each bed from within my mod? sounds like it would be from your handle_schematics mod?
Attachments
mg-villages-02.PNG
My Villagers Mod: [villagers]

Sokomine
Member
Posts: 4184
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Villages for Minetest [mg_villages]

ErrorNull wrote: i'm also looking forward to see your inhabitants. i see the new beds and the new information shown from the plotmarkers. very exciting. is there a way for me to obtain the position of each bed from within my mod? sounds like it would be from your handle_schematics mod?
You'll get the (always sleeping) inhabitants if you install my mobf_trader mod. handle_schematics itshelf only finds out where beds are. All that job assignment and naming and configuration of npc is done in mg_villages. Plese take a look at mg_villages/inhabitants.lua. I've documented the new fields in its header. If you want to spawn your own villagers, just create a new function and store it under mg_villages.inhabitants.spawn_one_mob The function gets a table "beds" with the values as described in the file's header and ought to return a uniq id for each mob it spawned. The function is called whenever a new house is generated by mapgen or when a player clicks on "Who lives here".

Sleeping in a bed is a new function of mobf_trader and can be found in mobf_trader/mob_sitting.lua. Handling of doors is done in my fork of npcf in npcf/mob_door_handling.lua. They're both relatively small helper functions that could be useful for all npc-like mobs. I'm just unsure where to place them. A library for mob utils would be great, but libraries are often too complex to understand for users who just want to use a mod and barely managed to download and install one. mob_sitting.lua is called that way for a reason. A more extensive older version of it allowed mobs to sit on many types of furniture. Using door handling in my fork of npcf only works if you also install burlis pathfinder and change the local (I hate local functions) "walkable" there.
A list of my mods can be found here.

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

Re: [Mod] Villages for Minetest [mg_villages]

Sokomine - thank you for the pointers. i will be reviewing the code in inhabitants.lua and in the mob mobf_trader mod. i have another question. can you clarify for me what are the types of buildings it encompasses and/or its purposes for the following building types:

- secular
- deco
- mill
- pit
- chateau
- allmende

Your info will help me construct more relevant chat dialogue for my villagers that spawn on these building types. =)
My Villagers Mod: [villagers]

Who is online

Users browsing this forum: No registered users and 4 guests