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

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

no. they are not really related to each other :D
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

Sokomine wrote:mg_villages now provides a road-based pathfinder that can navigate from street/position right next to street to another plot somewhere else in the village.
I saw your latest updates and they will be very useful! when i start to focus on my villagers' movements i can really use those functions you've created:
path = mg_villages.get_path_from_pos_to_plot_via_roads( village_id, pos, target_plot_nr );
path = mg_villages.get_path_from_bed_to_outside( village_id, plot_nr, bed_nr, front_door_nr );
path = mg_villages.get_path_from_outside_to_bed( village_id, plot_nr, bed_nr, front_door_nr );
You've done a great amount of work with your village structures already, I'm am very grateful for your continued effort to make villager interaction easier for the villager mods here in the minetest community as well. Thanks much.
maikerumine wrote:I have a dumb question. If I run mobf_traders will this bug the game?
I'm sure you can load both my villagers mod as well as enable mobf_traders... but get ready for some entertainment i'm sure! I think all the villagers from both mods will spawn, but i don't think either will check the mob spawner position for existing villagers so my villagers will spawn overlapping the mobf_traders and vice versa. In addition to the slowdown of your computer calculating twice as many villagers, i suppose the game will not crash. Of course, my mod is already good at crashing on NIL errors on its own.. so i suppose the game will crash thanks to my villagers. ha. * I am addressing this currently though and an update will arrive shortly! *

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

I am still hard at work at reworking and improving the spawning mechanism of my villagers. After much testing I have pretty much eliminated the nil errors when villages are generated and villagers attempt to spawn. Even though some spawning errors do still exist (which i plan to 100% eliminate eventually) but at least the game does not crash - instead the villagers will tell you the error in the dialogue.. which will be helpful in troubleshooting.

I am currently working on a side-issue that i've described on a post on Sokomine's mg_villages mod page - viewtopic.php?f=9&t=13588&p=283463#p283463 . The good news is that after much studying, i think i've figured out a good solution to that issue and plan to post an big update on github in a couple days. Have a great week.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

Update 0.16!

[fixed]
- Eliminated more NIL errors that crash the game
- Stop any ongoing digging anim by villager when trading

[added]
- Young children villagers tell you they don't know much about trading
- New chat command to list all nearby traders and teleport to them
- Created node metadata formspec at village pos that shows any 'soft' errors

[improved]
- Re-worked entire spawning algorithm to use LBMs! If some villagers do not spawn immediately on the mob spawner, unload/reload map block by walking away about 40m and returning
- Calculate 'region' type based on surrounding nodes at village position
- Villagers adopt attributes directly from mg_villagers: gender, age, and job title. This simplifies my side of things, thanks Sokomine!
- Trader items/goods are now determined by the villager's job title, and is no longer determined by building/schem type.

Okay. I completely redid the villager spawning algorithm, this time taking advantage of LBMs. Learned a bunch. This change solved my entire issue of villagers not spawning on far distant villagers and also solved some villagers not spawning immediately on nearby mob spawners. Thanks to everyone here for the advise.

I also ensured to anticipate potentional NIL error scenarios, and instead of leaving them unhandled and crashing the game, assign default values and allow the game to proceed.. though slightly crippled. To assist with testing, I also created a metadata formspec that is tied to the node located at the village position. An easy way to find out the village position is by using the chat command /villages which comes from the mg_villages mod.

Once you find the node at that pos, right click to show the formspec. I'd like to build upon this formspec to eventually show more interesting village info like population, number of traders, etc. For now it's main function is to display any remaining spawning errors.
Image
Image

I also created a new chat command /villagers list that will list all nearby villagers that can trade. You can click on the GO button next to the desired trader to spawn directly to that villager. This will also help quick test new traders and new functionality.
Image

Trading with villagers are still done primarily with coins. I will be adding traders soon that will give players coins in exchange for small resources. But for now, as an admin player you can just use the command /giveme villagers:coins to get some coins right away and play around with how trading works.

As before, let me know if this update feels better and report those errors! Since I don't expect the game to just crash and burn as often on errors... use that node metadata formspec to quickly check if any errors occurred on newly spawned villagers!
Attachments
villagers list command.png
villagers list command.png (254.81 KiB) Viewed 1298 times
village info and erros formspec.png
village info and erros formspec.png (288.97 KiB) Viewed 1298 times
node meta infotext.png
node meta infotext.png (394.79 KiB) Viewed 1298 times

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

FYI - I am working on the following improvements as of right now...

1) Traders that give players coins for minor resources or other items. Also traders that exchange coins for gold coins and vice versa. Ten coins = 1 gold coin.

2) Adding support for all items from TenPlus1's nice Farming Redo [farming] mod into villager's trading goods - viewtopic.php?t=9019

3) Adding support for all items from very cool 3D Armor mod by Stu into the villager's trading goods - viewtopic.php?t=4654

4) Creating an interactive formspec to manually add villagers onto the map, instead of using a chat command. Then removing dependency on mg_villages mod for those who want to use villagers but without mg_villages.

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

First run-through of 0.16, with clean copy of mg_villages:

Chateau building no longer crashes the game - yay! However, no villagers spawned at the Chateau either - I moved away and returned to no avail.

Villagers no longer 'work' the village fields - or clean up snow/grass/etc. Trading works fine, although I get a few random 'unknown item' issues, possibly due to not having cottages enabled? Only testing with handle_schematics, mg_villages and villagers.

One thing I would like to see is the item name popup (tooltip?) in the trading screen when I hover the mouse over the item icon - hard to tell what the trader is asking for sometimes (bush leaves look very similar).

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

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

by the_raven_262 » Post

Would you make the villagers, or better, the guards wear armor from 3d_armor? It would look nice, and would possibly be useful to them.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

KCoombes wrote:However, no villagers spawned at the Chateau either - I moved away and returned to no avail.
I'll look into that and also into how the villagers are not digging snow, grass, etc. anymore. Had you encountered the chateau by walking from a different village? or you had teleported there or spawned there initially?
KCoombes wrote:Trading works fine, although I get a few random 'unknown item' issues, possibly due to not having cottages enabled?
Ah yes, that's correct. My code erroneously assumes the Cottages mod is installed. I will update it to fallback to minetest_game items.
KCoombes wrote:One thing I would like to see is the item name popup (tooltip?) in the trading screen when I hover the mouse over the item icon - hard to tell what the trader is asking for sometimes (bush leaves look very similar).
I agree too. I will update to use itemstack code soon to represent the items as i think in doing so, it automatically displays the tooltip.
the_raven_262 wrote:Would you make the villagers, or better, the guards wear armor from 3d_armor?
Most definitely. lat month, I did a quick attempt to have villagers hold picks and shovels as they dig but found out it requires a bit more homework using wielditem from 3D Armor mod. so now i have more reason to get to task as having the tower guards use the 3d armors will diversify the guards' outfit quite niecely.

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

ErrorNull wrote:-snip- Had you encountered the chateau by walking from a different village? or you had teleported there or spawned there initially?
I initially teleported to a chateau via the /visit command, then walked away and walked back, trying to get the villagers to spawn.

EDIT: I returned to the same world and the starting village inhabitants had begun to clear the grass around the town, but ignored the fields in town. I then returned to the chateau, hoping to see a change. No villagers spawned, and when I clicked the plotmarker "Who lives here' option, the screen went grey (fatal lockup). Debug log:

Code: Select all

2017-07-25 09:57:16: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'mg_villages' in callback ScriptApiPlayer::on_playerReceiveFields(): ....4.16-win32-msvc\bin\..\mods\mg_villages/inhabitants.lua:444: attempt to concatenate a nil value
2017-07-25 09:57:16: ERROR[Main]: stack traceback:
2017-07-25 09:57:16: ERROR[Main]: 	....4.16-win32-msvc\bin\..\mods\mg_villages/inhabitants.lua:444: in function 'print_house_info'
2017-07-25 09:57:16: ERROR[Main]: 	...n32-msvc\bin\..\mods\mg_villages/plotmarker_formspec.lua:54: in function 'plotmarker_formspec'
2017-07-25 09:57:16: ERROR[Main]: 	...n32-msvc\bin\..\mods\mg_villages/plotmarker_formspec.lua:362: in function <...n32-msvc\bin\..\mods\mg_villages/plotmarker_formspec.lua:355>
2017-07-25 09:57:16: ERROR[Main]: 	...etest-0.4.16-win32-msvc\bin\..\builtin\game\register.lua:412: in function <...etest-0.4.16-win32-msvc\bin\..\builtin\game\register.lua:392>

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

KCoombes - that error is coming from the mg_villages mod from interaction of the plotmarker and not from my villagers mod. this would be something sokomine would be better at troubleshooting. are you playing in singleplayer? creative? or admin as hosting a server?

I'm also now looking into the issue with villagers spawning in chateaus. i'm having a hard time generating a map with chateaus nearby to test. so can you give me the map seed you are using and the x,y,z position of the chateau you are dealing with? thanks!

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

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

by BirgitLachner » Post

Hi,

thanks for your Mod for "mg_Villages".

I try to find a nice setting for a server and installed mg_villages and villagers. This works but sometimes Minetest crashes when I come or faster fly (to investigate how it works):

Code: Select all

2017-07-27 12:36:11: WARNING[Emerge-0]: Assignment to undeclared global "node" inside a function at /home/birgit/.minetest/mods/farming_plus/init.lua:72.
2017-07-27 12:40:43: WARNING[Server]: Map::getNodeMetadata(): Block not found
2017-07-27 12:40:43: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'villagers' in callback LuaLBM::trigger(): /home/birgit/.minetest/mods/villagers/spawn.lua:96: table index is nil
2017-07-27 12:40:43: ERROR[Main]: stack traceback:
2017-07-27 12:40:43: ERROR[Main]: 	/home/birgit/.minetest/mods/villagers/spawn.lua:96: in function 'getRegionFromArea'
2017-07-27 12:40:43: ERROR[Main]: 	/home/birgit/.minetest/mods/villagers/spawn.lua:225: in function </home/birgit/.minetest/mods/villagers/spawn.lua:176>
Another siutation:

Code: Select all

2017-07-27 12:31:32: WARNING[Server]: Map::getNodeMetadata(): Block not found
2017-07-27 12:31:32: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'villagers' in callback LuaLBM::trigger(): /home/birgit/.minetest/mods/villagers/spawn.lua:96: table index is nil
2017-07-27 12:31:32: ERROR[Main]: stack traceback:
2017-07-27 12:31:32: ERROR[Main]: 	/home/birgit/.minetest/mods/villagers/spawn.lua:96: in function 'getRegionFromArea'
2017-07-27 12:31:32: ERROR[Main]: 	/home/birgit/.minetest/mods/villagers/spawn.lua:225: in function </home/birgit/.minetest/mods/villagers/spawn.lua:176>
2017-07-27 12:32:02: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2017-07-27 12:32:02: WARNING[Main]: Not registering alias, item with same name is already defined: farming:cotton -> farming:cotton_3
2017-07-27 12:32:02: WARNING[Main]: Undeclared global variable "cottages_feldweg_mode" accessed at /home/birgit/.minetest/mods/cottages/nodes_feldweg.lua:18
2017-07-27 12:32:02: WARNING[Main]: Not registering alias, item with same name is already defined: mushroom:brown_natural -> flowers:mushroom_fertile_brown
2017-07-27 12:32:02: WARNING[Main]: Not registering alias, item with same name is already defined: mushroom:red_natural -> flowers:mushroom_fertile_red
2017-07-27 12:32:02: WARNING[Main]: Undeclared global variable "moresnow" accessed at /home/birgit/.minetest/mods/mg_villages/nodes.lua:23
... okay, "moresnow" is not installed.

Can you tell, if it is my fault or are some Mods missing!?

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

Hi BirgitLachner - thanks for telling me about this error. This looks like my 'villagers' mod is complaining about something as it tries to analyze nearby nodes to determine the region type for the village. Can you list for me all the mods you have installed? And, was this on a new map or an existing map that you added the villagers mod?

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

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

by BirgitLachner » Post

Well ... this error happend when I came close to the hut. So, it was my presence that caused the error.

It was a new map I created with mg_villagers.

Hmm ... at the moment I'm testing which mod can be used with mg-villages and villagers.
I saved the old world and can give you the list of mods.

Code: Select all

gameid = minetest
backend = sqlite3
creative_mode = true
enable_damage = true
load_mod_3d_armor = false
load_mod_3d_armor_ip = false
load_mod_3d_armor_sfinv = false
load_mod_3d_armor_stand = false
load_mod_3d_armor_ui = false
load_mod_3dmushrooms = false
load_mod_along_shore = false
load_mod_ambience = false
load_mod_areas = false
load_mod_bell = false
load_mod_biome_lib = false
load_mod_boost_cart = false
load_mod_building_blocks = false
load_mod_bushes = false
load_mod_bushes_classic = false
load_mod_cavestuff = false
load_mod_chains = false
load_mod_clams = false
load_mod_computer = false
load_mod_concrete = false
load_mod_cottages = true
load_mod_darkage = true
load_mod_display_lib = false
load_mod_dryplants = false
load_mod_edutest = false
load_mod_edutest_chatcommands = false
load_mod_ethereal = false
load_mod_extranodes = false
load_mod_fake_fire = false
load_mod_farming_plus = true
load_mod_ferns = false
load_mod_flowers_plus = false
load_mod_font_lib = false
load_mod_freeze = false
load_mod_geomoria = false
load_mod_handle_schematics = true
load_mod_hazmat_suit = false
load_mod_homedecor = false
load_mod_homedecor_3d_extras = false
load_mod_homedecor_i18n = false
load_mod_hud = false
load_mod_hunger = false
load_mod_inbox = false
load_mod_itemframes = false
load_mod_junglegrass = false
load_mod_lavalamp = false
load_mod_lrfurn = false
load_mod_markers = false
load_mod_mccompat = false
load_mod_mesecons = false
load_mod_mesecons_alias = false
load_mod_mesecons_blinkyplant = false
load_mod_mesecons_button = false
load_mod_mesecons_commandblock = false
load_mod_mesecons_delayer = false
load_mod_mesecons_detector = false
load_mod_mesecons_doors = false
load_mod_mesecons_extrawires = false
load_mod_mesecons_fpga = false
load_mod_mesecons_gates = false
load_mod_mesecons_hydroturbine = false
load_mod_mesecons_insulated = false
load_mod_mesecons_lamp = false
load_mod_mesecons_lightstone = false
load_mod_mesecons_luacontroller = false
load_mod_mesecons_materials = false
load_mod_mesecons_microcontroller = false
load_mod_mesecons_movestones = false
load_mod_mesecons_mvps = false
load_mod_mesecons_noteblock = false
load_mod_mesecons_pistons = false
load_mod_mesecons_powerplant = false
load_mod_mesecons_pressureplates = false
load_mod_mesecons_random = false
load_mod_mesecons_receiver = false
load_mod_mesecons_solarpanel = false
load_mod_mesecons_stickyblocks = false
load_mod_mesecons_switch = false
load_mod_mesecons_torch = false
load_mod_mesecons_walllever = false
load_mod_mesecons_wires = false
load_mod_mg_villages = true
load_mod_mob_horse = false
load_mod_mobf_trader = false
load_mod_mobs = false
load_mod_mobs_animal = false
load_mod_mobs_bat = false
load_mod_mobs_birds = false
load_mod_mobs_butterfly = false
load_mod_mobs_crocs = false
load_mod_mobs_fish = false
load_mod_mobs_jellyfish = false
load_mod_mobs_monster = false
load_mod_mobs_sharks = false
load_mod_mobs_turtles = false
load_mod_molehills = false
load_mod_moreblocks = false
load_mod_moreores = false
load_mod_moresnow = false
load_mod_moretrees = false
load_mod_nature_classic = false
load_mod_nether = false
load_mod_noairblocks = false
load_mod_ontime_clocks = false
load_mod_pipeworks = false
load_mod_pkarcs = false
load_mod_plasmascreen = false
load_mod_poisonivy = false
load_mod_pyramids = false
load_mod_quartz = false
load_mod_seacobble = false
load_mod_seacoral = false
load_mod_seaglass = false
load_mod_seagravel = false
load_mod_sealamps = false
load_mod_seaplants = false
load_mod_seastone = false
load_mod_seastonebrick = false
load_mod_seawrecks = false
load_mod_shields = false
load_mod_signs = false
load_mod_signs_road = false
load_mod_stained_glass = false
load_mod_stairsshine = false
load_mod_steles = false
load_mod_technic = false
load_mod_technic_armor = false
load_mod_technic_chests = false
load_mod_technic_worldgen = false
load_mod_travelnet = false
load_mod_treasurer = false
load_mod_trm_boats = false
load_mod_trm_bucket = false
load_mod_trm_default = false
load_mod_trm_default_example = false
load_mod_trm_doors = false
load_mod_trm_dye = false
load_mod_trm_farming = false
load_mod_trm_screwdriver = false
load_mod_trm_tnt = false
load_mod_trm_vessels = false
load_mod_trm_xpanes = false
load_mod_trunks = false
load_mod_tsm_chests_dungeon = false
load_mod_tsm_chests_example = false
load_mod_tsm_gift_example = false
load_mod_tsm_mines = false
load_mod_tsm_pyramids = false
load_mod_tsm_railcorridors = false
load_mod_turtleminer = false
load_mod_u_skins = false
load_mod_unified_inventory = true
load_mod_unifieddyes = false
load_mod_village_gambit = true
load_mod_village_towntest = true
load_mod_villagers = true
load_mod_vines = false
load_mod_whiteshell = false
load_mod_wieldview = false
load_mod_woodsoils = false
load_mod_worldedit = false
load_mod_worldedit_commands = false
load_mod_worldedit_gui = false
load_mod_worldedit_infinity = false
load_mod_worldedit_limited = false
load_mod_worldedit_shortcommands = false
load_mod_wrench = false
load_mod_xconnected = false
load_mod_xdecor = false
load_mod_youngtrees = false
player_backend = files
server_announce = false

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

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

by azekill_DIABLO » Post

nice progress!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

ErrorNull wrote:-snip-

I'm also now looking into the issue with villagers spawning in chateaus. i'm having a hard time generating a map with chateaus nearby to test. so can you give me the map seed you are using and the x,y,z position of the chateau you are dealing with? thanks!
Seed 92768 at 80,2,41; singleplayer, not creative

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

Hi KCoombes - I tested several times and the villagers seems to spawn each time okay for me. I made a youtube video to show what I got when i arrived at the chateau at position 80,2,41. i also demonstrate how far i move away from the building for the villagers to disappear and then reappear. Are there other buildings that have mob spawner nodes that also do not seem to spawn villagers for you? Anyone else out there try this same setup and get the same behavior?

Note: I did play as host server admin so i can quickly navigate however.

new map: seed 92768
installed mods: mg_villages, handle_schematics, cottages, villagers
youtube link: https://www.youtube.com/watch?v=-DJNFkT4Nlw

Image
Attachments
minetest-chateau-villagers.jpg
minetest-chateau-villagers.jpg (166.01 KiB) Viewed 1298 times
Last edited by ErrorNull on Thu Jul 27, 2017 16:45, edited 1 time in total.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

BirgitLachner wrote:Well ... this error happend when I came close to the hut. So, it was my presence that caused the error. It was a new map I created with mg_villagers.

Hmm ... at the moment I'm testing which mod can be used with mg-villages and villagers.
I saved the old world and can give you the list of mods.
I see you have farming_plusplus modpack and the darkage mod installed. I did several tests with those mods too and was unable to duplicate that error. Here's the mods I used on a new map: mg_villagers, handle_schematics, cottages, villagers, farming_plusplus, and darkage. I downloaded darkage from Addi's latest post here. And, I downloaded the farming_plus modpack here - the link right above the screenshot.

Some questions:

Was this a lone hut?
Or was the hut part of a larger village?
Do you get the error with any other buildings other than a hut?
Can you tell me the map seed you used?
And, your x,y,z position when the error came about?

I can test further with that information. Below you can see i am next to a building with villagers that spawned and next to some strawberries from the farming_plus mod.Image
Attachments
farming_plus strawberries.png
farming_plus strawberries.png (565.03 KiB) Viewed 1298 times

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

ErrorNull wrote:Hi KCoombes - I tested several times and the villagers seems to spawn each time okay for me. I made a youtube video to show what I got when i arrived at the chateau at position 80,2,41. i also demonstrate how far i move away from the building for the villagers to disappear and then reappear. Are there other buildings that have mob spawner nodes that also do not seem to spawn villagers for you? Anyone else out there try this same setup and get the same behavior?

Note: I did play as host server admin so i can quickly navigate however.

new map: seed 92768
installed mods: mg_villages, handle_schematics, cottages, villagers
youtube link: https://www.youtube.com/watch?v=-DJNFkT4Nlw

Image
Please try again without cottages enabled.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

KCoombes wrote:Please try again without cottages enabled.
Ah, my mistake. Now without the cottages mods installed, the villagers in fact fail to spawn! It's a haunted chateau now...Image

That is strange, as it seems there's a difference between the chateau with cottages installed and without cottages.... aside from the building materials (desert cobble vs stone bricks). This is something I'll need help from Sokomine as I discovered this has to do with the following object table:

village_data.to_add_data.bpos[plot_nr].beds

For some reason, when cottages mod is removed, the above parameter for this chateau is an empty table. But, when cottages mod is installed, this contains all the beds data necessary (bed pos, generation, age, gender, etc) for each of my villagers to spawn.

* poking Sokomine *
Attachments
chateau-no-villagers.png
chateau-no-villagers.png (591.02 KiB) Viewed 1298 times

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

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

by Sokomine » Post

ErrorNull wrote: For some reason, when cottages mod is removed, the above parameter for this chateau is an empty table. But, when cottages mod is installed, this contains all the beds data necessary (bed pos, generation, age, gender, etc) for each of my villagers to spawn.
Did you ever look into the chateau and check if the beds are there? The "old" (current) version of mg_villages stores where it did place any head

of a bed. These positions then get mobs assigned. The new one I'm currently working on analyzes the blueprint once, stores where that got its beds and workplaces, calculates the paths from beds and workplaces to the front door(s) and stores them. If stored data about a blueprint is found the data is not calculated anew.

Most buildings that rely on cottages don't appear on the map at all if cottages is not installed. The chateau is missing some - mostly not critical - nodes when cottages is missing. It spawns but lacks its beds. Therefore, mobs decide not to live there. The floor is too hard for them.

Hopefully I got all the other buildings right. Those in nore and taoki ought to use "normal" beds from default.
A list of my mods can be found here.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

Update 0.17

v0.17
[added]
- Added item description to trading formspec
- Villagers can offer multiple of the same item at once for trade
- Added initial coins for player which you can disable from config.lua file
- Villager 'goodbye' dialogue after trading changes if player actually trades something

[improved]
- Improved looks of trading formspec
- Cleaned up code for villager trading

Notes about coins: Ten silver coins equal 1 gold coin. A new player will start with a few coins - if that setting was not disabled from config.lua. To get more coins, look for villagers of the following job types that will trade you coins for certain items: ore_seller, potterer, saddler, stoneminer, servant, and schoolteacher. Use the '/villagers list' command below to quickly find some traders while in a village. Also, villagers with job types of "major" can exchange silver coins for gold coins and vice versa.

Send me errors and let me know what you think! Adding items from Farming Redo and 3D Armor now...

Image
Attachments
updated-formspec.png
updated-formspec.png (406.41 KiB) Viewed 1298 times
Last edited by ErrorNull on Fri Jul 28, 2017 23:43, edited 2 times in total.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

Sokomine wrote:Did you ever look into the chateau and check if the beds are there?
I see... I checked and there are no beds inside the cottage-less chateau. Thanks for clearing that up sokomine!

@ KCoombes - That explains the issue - even though a building may have mob spawners outside, if there are no beds inside, my villagers have nowhere to sleep, so they don't spawn. ;)

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

ErrorNull wrote:
Sokomine wrote:Did you ever look into the chateau and check if the beds are there?
I see... I checked and there are no beds inside the cottage-less chateau. Thanks for clearing that up sokomine!

@ KCoombes - That explains the issue - even though a building may have mob spawners outside, if there are no beds inside, my villagers have nowhere to sleep, so they don't spawn. ;)
Sokomine - thanks!

ErrorNull - So we wait for Sokomine's update, or add dependency on cottages, assuming the chateau is desired. That's fine with me. I've pulled a fresh copy and will test today. Keep up the good work!

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

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

by KCoombes » Post

Ok - new world with cottages, handle_schematics, mg_villages, unified_inventory and villagers mods enabled. Same seed as before.

Upon entering the world, I noticed the start village was not populated as fully as before. I stood still, waiting to see if additional villagers would spawn. I did not see any spawn until I walked away from the start location, and even then there were not as many villagers spawning in town. I navigated to the Chateau (same location as before) and it was populated, but slowly (only a few when I arrived). I entered the Chateau and roamed around a bit, used a bed to pass the night (which failed - might be an issue with the cottages_bed), then went back outside to find a huge gathering of villagers (apparently they all spawned). I began checking the trading formspec for different traders and eventually got this:

Code: Select all

2017-07-29 08:29:43: ACTION[Server]: singleplayer right-clicks object 214: LuaEntitySAO at (90,2.55,55)
2017-07-29 08:29:43: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'villagers' in callback ScriptApiEntity::luaentity_Rightclick(): ...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:654: attempt to concatenate local 'item_stock' (a nil value)
2017-07-29 08:29:43: ERROR[Main]: stack traceback:
2017-07-29 08:29:43: ERROR[Main]: 	...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:654: in function 'getTradingFormspec'
2017-07-29 08:29:43: ERROR[Main]: 	...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:703: in function 'tradeVillager'
2017-07-29 08:29:43: ERROR[Main]: 	...test-0.4.16-win32-msvc\bin\..\mods\villagers/actions.lua:641: in function 'on_rightclick'
2017-07-29 08:29:43: ERROR[Main]: 	...netest-0.4.16-win32-msvc\bin\..\mods\villagers/spawn.lua:781: in function <...netest-0.4.16-win32-msvc\bin\..\mods\villagers/spawn.lua:781>
Not sure why this particular trader errored when others did not, unless he had an unknown item to offer.

User avatar
ErrorNull
Member
Posts: 271
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

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

by ErrorNull » Post

KCoombes wrote:I began checking the trading formspec for different traders and eventually got this:

Code: Select all

2017-07-29 08:29:43: ACTION[Server]: singleplayer right-clicks object 214: LuaEntitySAO at (90,2.55,55)
2017-07-29 08:29:43: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'villagers' in callback ScriptApiEntity::luaentity_Rightclick(): ...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:654: attempt to concatenate local 'item_stock' (a nil value)
2017-07-29 08:29:43: ERROR[Main]: stack traceback:
2017-07-29 08:29:43: ERROR[Main]: 	...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:654: in function 'getTradingFormspec'
2017-07-29 08:29:43: ERROR[Main]: 	...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:703: in function 'tradeVillager'
2017-07-29 08:29:43: ERROR[Main]: 	...test-0.4.16-win32-msvc\bin\..\mods\villagers/actions.lua:641: in function 'on_rightclick'
2017-07-29 08:29:43: ERROR[Main]: 	...netest-0.4.16-win32-msvc\bin\..\mods\villagers/spawn.lua:781: in function <...netest-0.4.16-win32-msvc\bin\..\mods\villagers/spawn.lua:781>
Not sure why this particular trader errored when others did not, unless he had an unknown item to offer.
Hmm.. right click on the node at the village position -- should be @ (80, 2, 41). The node formspec should provide more info on any strange errors while that specific chateaus trader was being setup.

UPDATE: I'm troubleshooting this now. Actually I found the official village position for that chateau is x=75, z=57.. To get there you need to find your way near some barrels in the building. I got some nifty errors when i inspected the node formspec. I will correct and update soon!

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests