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

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Villagers for Minetest [villagers]

by LouisCyfer » Post

star'd ;) .. just cuz I like

another question!
Does the WTFPL (license) include the 3 pop sounds?

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

yea, you can do whatever you want to those pop sounds.

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Villagers for Minetest [villagers]

by LouisCyfer » Post

ErrorNull wrote:yea, you can do whatever you want to those pop sounds.
awesome, I might borrow them :)

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

Re: [Mod] Villagers for Minetest [villagers]

by Sokomine » Post

LouisCyfer wrote: thats correct, I downloaded/renamed the folder from HEREso that the minus'es are erased (obviously MT has issues with mods having any "-" in the foldername) so its just villages instead of villages-for-minetest-modpack-master .. is it mandatory/rather important to have the foldername of the villages mg_villages or should i rename the modpack folder to mp_villages?
The renaming of folders to something without - is very important for mods - but not necessary for modpacks. My "villages for minetest" is such a modpack. It contains mg_villages, handle_schematics, cottages, the traders and some other village types. If you are able to, please clone handle_schematics and mg_villages directly from Github as those are the most recent versions. The one in the modpack is severely outdated. I have to manually pack the modpack each time something changes. As there's currently a lot of development going on I didn't get around to that yet.
ErrorNull wrote: I do notice that when using your mobf traders in your villages, that it's fairly consistent it will spawn one trader for each building type. When i try the alternative technique by hooking in mobs redo so that the mobs redo traders spawn on the plotmarkers (which is also advanced_npc technique) it takes some time for the traders/villagers to appear and perhaps do not spawn consistently either. Is that what you're referring to?
Even spawning the mobs at mapgen time did not always get me all the desired mobs. Some houses where left without. A spawner can also check from time to time if "his" mob's still there and respawn it if needed.
ErrorNull wrote: For now i'm pretty happy with how my villagers spawn since it's done during mapgen time of your villages like how your mobf traders get generated. So far it seems i am getting one villager for each building type without fail... and their spawn positions are either inside the building (which is cool) and outside the building (nearby). My next goal is to obtain the position of the beds (and even position of the doors if possible?) that are part of each building and have my villagers optionally spawn near those points.
Try the newest version and click on the mob spawners to see which data is stored about each mob. Clicking on the plotmarker tries to find a path from bed to spawner.
A list of my mods can be found here.

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

I did a minor update: added chat command to manually spawn villager at player's current position. When this mod is more functional and close to official release, I will only allow this command for admins. You can use this command to quickly check out the different chat dialogues that exist so far for each villager of each building type. Those that don't have custom dialogue yet you will see display just the default script.

Usage:

/villagers <region> <building type>

<region> = the climate/region types that dictate villager ethnicity and clothing style:
hot, cold, normal, native, desert

<building type> = the numerous building type available from mg_villagers mod. This dictates the type of dialogue villagers will display:
allmende, bakery, bench, chateau, church, deco, empty, farm_full, farm_tiny, field, forge, fountain, house, hut, library, lumberjack, mill, pasture, pit, sawmill, school, secular, shed, shop, spawn, tavern, tent, tower, trader, village_square, wagon, well

You will notice that you can use this chat command to create villagers that will not 'naturally' exist in the world like...

/villagers desert tower
/villagers cold pit
/villagers native lumberjack
sokomine wrote:Try the newest version and click on the mob spawners to see which data is stored about each mob. Clicking on the plotmarker tries to find a path from bed to spawner.
Thanks again for providing the mob spawners. It will be quite useful and I'll be working with it in the next immediate updates.

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

Sokomine wrote:
ErrorNull wrote: For now i'm pretty happy with how my villagers spawn since it's done during mapgen time of your villages like how your mobf traders get generated. So far it seems i am getting one villager for each building type without fail... and their spawn positions are either inside the building (which is cool) and outside the building (nearby). My next goal is to obtain the position of the beds (and even position of the doors if possible?) that are part of each building and have my villagers optionally spawn near those points.
Try the newest version and click on the mob spawners to see which data is stored about each mob. Clicking on the plotmarker tries to find a path from bed to spawner.
I'm making good progress and I'm able to have my mobs spawn (or simply transport) to the bed positions now. The bed position data was straight forward to find within your main mg_villages.all_villages[village_id] object.

However, I'm having a hard time figuring out how my mod can access the position of the mob spawner or plotmarker. Of course when I right click on either node in-game, it does provide good info. But, for my mod to access the positions directly, the position data doesn't seem to be available within mg_villages.all_villages[village_id] or mg_villages.all_villages[village_id].to_add_data.bpos ... where I found the data for beds. My guess is the positions for mob spawner or plotmarker is respresented within the voxelmanip parameter called 'data' that is passed into the mg_villages.part_of_village_spawned() function.. but my computer blows up when i try to dump it. LOL. What's the best way to get those positions? or is that even possible? Thanks in advance for your help Sokomine.

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

Re: [Mod] Villagers for Minetest [villagers]

by Sokomine » Post

ErrorNull wrote: However, I'm having a hard time figuring out how my mod can access the position of the mob spawner or plotmarker. Of course when I right click on either node in-game, it does provide good info. But, for my mod to access the positions directly, the position data doesn't seem to be available within mg_villages.all_villages[village_id] or mg_villages.all_villages[village_id].to_add_data.bpos ... where I found the data for beds. My guess is the positions for mob spawner or plotmarker is respresented within the voxelmanip parameter called 'data' that is passed into the mg_villages.part_of_village_spawned() function.. but my computer blows up when i try to dump it. LOL. What's the best way to get those positions? or is that even possible? Thanks in advance for your help Sokomine.
The mob spawners are supposed to be operated by abms/lbms. Thus, their position will already be known at the time of execution of the abm/lbm. Metadata of each spawner provides the values village_id, plot_nr and bed_nr. With those you can call the function mg_villages.inhabitants.get_mob_data( village_id, plot_nr, bed_nr ) to get the bed data (incl name etc.) of that particular mob this particular spawner is responsible for.

The position of the plotmarker isn't really helpful for your villagers mod. It's mostly a node that's useful for players who want information about the plot, buy an empty one, admins restoring griefed buildings etc.

Positions of mob spawners can be obtained through handle_schematics.get_pos_in_front_of_house( pos, bed_nr ) with pos beeing the position of the house (can be found in mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ]).

The data field in the spawn function contains the voxelmanip data. It's only of intrest if you want to place or remove nodes.

I'm currently working on the identification of all front door(s) of a house. Calculation does take some time and I might have to cache the data.
A list of my mods can be found here.

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

Sokomine wrote:Positions of mob spawners can be obtained through handle_schematics.get_pos_in_front_of_house( pos, bed_nr ) with pos beeing the position of the house (can be found in mg_villages.all_villages[ village_id ].to_add_data.bpos[ plot_nr ]).

The data field in the spawn function contains the voxelmanip data. It's only of intrest if you want to place or remove nodes.

I'm currently working on the identification of all front door(s) of a house. Calculation does take some time and I might have to cache the data.
Obtaining the positions of the doors would be very cool! Thanks to your help and your mob spawner, my villagers can now easily spawn on said mob spawners, the yaw data that is also a great convenience. This has simplified my previous spawning code, which is great. Image

This also means that buildings that did not have a mob_spawner/bed will not have a villager appear, as was possible before I made this change. Therefore I don't have any villagers automatically spawn next to libraries, forges, fields, etc.

The obvious answer is to start assign jobs to my villagers, have them actually walk to their non-residential work buildings, hang around there for the day, and then return back to their homes and to their beds at night. Wow, this is a much greater scope than I planned for my villagers -- but I can see how satisfying it would be to see them exhibit such realistic behavior. So I will put this on my long term goals for now.

In the meantime, I will have my previous spawning code execute only for those non-residential buildings as a 'shortcut' in order to at least have a villager work at the library, bakery, forge, fields, etc.
Attachments
villagers_on_mob_spawner.png
villagers_on_mob_spawner.png (347.28 KiB) Viewed 985 times

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

Update 0.14
[improved]
- if village generates artificial snow, villagers spawn as cold region inhabitants (light skinned and warmer clothing)
- for each residential building (home, hut, tavern, etc), one villager will spawn for each bed that exists
- these villagers will now spawn on the convenient mob spawners (thanks Sokomine!)
- other villagers still spawn next to the various non-residential buildings (forge, bakery, sawmill, church, etc)
[added]
- chat command to manually spawn a villager at current position (instructions in README.txt on github)

Now that there is a villager spawned per mob spawner, the villagers look much more lively! There are still buildings which do not have beds, which makes sense, and should not have beds. However, I still have my custom villagers that spawn on these plots. In the near future, these villagers that spawn on 'bedless' non-residental plots will be removed as the villagers that spawn from the residential mob spawners will be coded to walk to and work in those non-residential buildings. As always, bugs and comments welcome. My weekend is nearing a close and it will be next week for the next updates...
Image
Here's a nice photo of all the lumberjacks who have just spawned, looking confused, having not started their actions yet. Maybe they are upset because there are no women in this village. >_<
Attachments
lumberjack-villagers-mob-spawner.png
lumberjack-villagers-mob-spawner.png (536.04 KiB) Viewed 985 times

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

Re: [Mod] Villagers for Minetest [villagers]

by Sokomine » Post

ErrorNull wrote: Obtaining the positions of the doors would be very cool!
Calculating all door positions for all buildings once considerably slows down the start of the game for me. I'm afraid I'll have to cache these values. The advantage will be that getting the positions of front doors and paths will then only require applying a function to rotate the data accordingly. Most buildings are updated now in mg_villages so that their front door(s) can be calculated. I've still got to do some adjustments for houses where diffrent doors are closer for diffrent beds (i.e. in the lumberjack hotel). And tents with their sleeping mats as "doors" are somewhat problematic as well. Places where mobs are supposed to work can only rarely be processed automaticly - forges may have anvils, mills might be equipped with additional handmills - but pubs, shops and churches don't have any obvious places. I see no other way than to introduce a marker for "mob wants to stand here most of the time", load each building that has a worker, place the marker and save the building. The mob might still wander around randomly, but there ought to be preferred spots.
ErrorNull wrote: The obvious answer is to start assign jobs to my villagers, have them actually walk to their non-residential work buildings, hang around there for the day, and then return back to their homes and to their beds at night. Wow, this is a much greater scope than I planned for my villagers -- but I can see how satisfying it would be to see them exhibit such realistic behavior. So I will put this on my long term goals for now.
I hope that that will be possible eventually :-) The pathfinding inside the houses works pretty fine thanks to burlis pathfinder. The tiny houses with the many slabs I love to buid are difficult. In many cases redecoration helped. A mob trying to follow such a path may still easily get stuck due to turning too fast or too late and just not standing properly in the center of the node when his on_step function is called.
ErrorNull wrote: In the meantime, I will have my previous spawning code execute only for those non-residential buildings as a 'shortcut' in order to at least have a villager work at the library, bakery, forge, fields, etc.
It's good to see some mobs there for now. Let's hope that the inhabitants will eventually be able to find their workplace and do their job there :-) Gameplay may then still require changes. Adventuretest has all mobs beeing up all night due to the many hostile creatures that spawn there. A lone guard would be dead soon. Maybe as long as the hostile creatures stay out of the houses, all might be fine.

It might be intresting to spawn the workers at their workplace (once they figured out where a convenient place might be) instead of at their homes. Their mob spawner would then remain empty (until they get home at night).
ErrorNull wrote: Tere's a nice photo of all the lumberjacks who have just spawned, looking confused, having not started their actions yet. Maybe they are upset because there are no women in this village. >_<
That is...quite possible. Poor lumberjacks :-) Hopefully they'll have at least a pub in their village. Maybe some children are older than expected and married to a lumberjack who's trying to collect enough money for a home while the wife stays at her parents. Or husbands that work as lumberjacks while their families stay at home.

The villagers look very nice :-)
A list of my mods can be found here.

Cage
Member
Posts: 81
Joined: Mon Oct 24, 2016 21:07
Location: Phoenix, Arizona

Re: [Mod] Villagers for Minetest [villagers]

by Cage » Post

Just installed the latest version of Villagers. When I click on the villager more then once I get this error and game crashes. Any ideas?

2017-07-01 15:49:39: WARNING[Server]: WARNING: minetest.setting_* functions are deprecated. Use methods on the minetest.settings object.
2017-07-01 15:49:40: ACTION[Server]: singleplayer punches object 11: LuaEntitySAO at (-711,7.4,-1876)
2017-07-01 15:49:41: WARNING[Server]: WARNING: minetest.setting_* functions are deprecated. Use methods on the minetest.settings object.
2017-07-01 15:49:42: ACTION[Server]: singleplayer punches object 11: LuaEntitySAO at (-711,7.4,-1876)
2017-07-01 15:49:42: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'villagers' in callback luaentity_Punch(): /mods/villagers/init.lua:1421: attempt to get length of field 'vScriptMain' (a nil value)
2017-07-01 15:49:42: ERROR[Main]: stack traceback:
2017-07-01 15:49:42: ERROR[Main]: /mods/villagers/init.lua:1421: in function 'chatVillager'
2017-07-01 15:49:42: ERROR[Main]: /mods/villagers/init.lua:1897: in function </mods/villagers/init.lua:1871>

I am using MT 0.4.16 in single player mode. Thanks

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

Cage wrote:Just installed the latest version of Villagers. When I click on the villager more then once I get this error and game crashes. Any ideas?

2017-07-01 15:49:39: WARNING[Server]: WARNING: minetest.setting_* functions are deprecated. Use methods on the minetest.settings object.
2017-07-01 15:49:40: ACTION[Server]: singleplayer punches object 11: LuaEntitySAO at (-711,7.4,-1876)
2017-07-01 15:49:41: WARNING[Server]: WARNING: minetest.setting_* functions are deprecated. Use methods on the minetest.settings object.
2017-07-01 15:49:42: ACTION[Server]: singleplayer punches object 11: LuaEntitySAO at (-711,7.4,-1876)
2017-07-01 15:49:42: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'villagers' in callback luaentity_Punch(): /mods/villagers/init.lua:1421: attempt to get length of field 'vScriptMain' (a nil value)
2017-07-01 15:49:42: ERROR[Main]: stack traceback:
2017-07-01 15:49:42: ERROR[Main]: /mods/villagers/init.lua:1421: in function 'chatVillager'
2017-07-01 15:49:42: ERROR[Main]: /mods/villagers/init.lua:1897: in function </mods/villagers/init.lua:1871>

I am using MT 0.4.16 in single player mode. Thanks
Hi Cage. Hmm.. it's strange that 'vScriptMain' is nil. This only happens if player clicks on villager to chat somehow before villager is fully spawned (which i don't think is the case) , or that the initial number of possible 'main' dialogue text for a villager was less than three. Some troubleshooting questions:

- Have you added any of your own chat dialogues into certain villagers types in 'dialogue.lua'? If so, ensure that 'mainchat' table contains at least 3 strings of dialogue.

- Does this error occur 100% of the time after on the 2nd click of the villager? For example, first click is ok and you get the 'hello' greeting. Then 2nd click you get error? Or do you sometimes get a dialogue on 2nd or 3rd click.. then it errors?

- what other mods are you using in addition to 'villagers', 'mg_villages', 'handle_schematics'?

If anyone else is receiving this similar error. let me know. Thanks!

Cage
Member
Posts: 81
Joined: Mon Oct 24, 2016 21:07
Location: Phoenix, Arizona

Re: [Mod] Villagers for Minetest [villagers]

by Cage » Post

- Have you added any of your own chat dialogues into certain villagers types in 'dialogue.lua'? If so, ensure that 'mainchat' table contains at least 3 strings of dialogue.
No haven't changed anything with the dialogue.

[/quote]- Does this error occur 100% of the time after on the 2nd click of the villager? For example, first click is ok and you get the 'hello' greeting. Then 2nd click you get error? Or do you sometimes get a dialogue on 2nd or 3rd click.. then it errors?[/quote]

Usually this happens on the 3rd or 4 click. I did notice that one or two villagers are just all brown entities like the images for that villager are missing.
- what other mods are you using in addition to 'villagers', 'mg_villages', 'handle_schematics'?
I am using both mg_villages, and Handle_schematics. Maybe mine_with_shafts might be the problem and I will remove it to see if it clears up the problem.

Cage
Member
Posts: 81
Joined: Mon Oct 24, 2016 21:07
Location: Phoenix, Arizona

Re: [Mod] Villagers for Minetest [villagers]

by Cage » Post

Okay an update. Removed that mine mod made no difference. Here is the weird part of the whole problem. I can go to a village other then the one I work out of and have no problems with chatting with the villagers. The problem only seems to exist in the village I play the game out of. I told you it was weird LOL. I didn't seem to have this problem until I did the update. It's not a big problem since I don't really interact with the villagers all that often. Just found it strange that all of a sudden the game crashes when I click on them more then once. It may not be a problem with a newly created map, but rather a problem with an existing map when you update the mod. Just a thought. Any ways it's nice to have a village with people in it rather then a ghost town.

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Villagers for Minetest [villagers]

by LouisCyfer » Post

do not kill any villagers (not even by accident) .. it also crashes the server/game. I suppose that belongs to the WIP part, right?

note: i just tried via bow and crossbow .. I did not test any tnt or other exploding things AND to my defense some mob attacked me while the arrow hitted the villager and crashed the game

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

@ Sokomine - thank you for your continued effort in adding features to your villages to make things easier for zorman2000 and i. the mob spawners and beds are perfect and whichever method you decide on getting any door positions will be awesome. thanks for the compliments too, i villagers will look nicer too when i redo the texture to v1.8 format skins. =)

@ Cage - ah yes, as I continue to update villagers mod and add features, they can also contain more data structures behind the scenes that weren't present in a prior version. so when download the latest version, the mod may use new code that an existing villager from an older version does not recognize and crash. since this is WIP, you will want to only work with newest-spawned villagers, like just creating a new map. reusing an old map with older-version villagers might yeild interesting results for sure!

@ LouisCyfer - LOL correct indeed! this is the result of WIP. For now my mod expects that only a player and nothing else will hit a villager and nothing else. I have not tested with any mobs or ranged weapons yet. This is an easy fix though and I'll apply on the next update so you can continue testing without fearing hit-crashing from villagers. please continue to test things out and don't be afraid to crash my mod and let me know, in case it's an issue i'm not aware of...

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]

by azekill_DIABLO » Post

After testing i can totally say that it's the best villager mod, and from far. However, a proper trading system could be added, for example, some villagers get stuff (metal, gold, tools, sword, books) every 4 day and you pay them to get what they have, instead of just stealing their items...

continue working !
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: 274
Joined: Thu Mar 03, 2016 00:43
GitHub: ErrorNull0

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

LouisCyfer wrote:do not kill any villagers (not even by accident) .. it also crashes the server/game. I suppose that belongs to the WIP part, right?

note: i just tried via bow and crossbow .. I did not test any tnt or other exploding things AND to my defense some mob attacked me while the arrow hitted the villager and crashed the game
Just now uploaded a hotfix. You can now shoot arrows at the villagers all you want, and no crashing. As revenge, they are now invincible to you... for now.

You will also notice the 'real' trading formspec taking shape. It's still not usable and clicking on trade button will do nothing, and the items, costs, and stock amounts are just dummy values. Currently for testing, all villagers will have random number of items for trade, but on later updates, only certain villagers will even have items to trade. Also note that the amount of coins 'You Have' should always be the same value on each row of items... but just as test demonstration in the screenshot below, i wanted to show the 'trade' button only appears when you have enough coins for the item in that row.
Image
Attachments
villager-trading.png
villager-trading.png (419.39 KiB) Viewed 985 times

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

azekill_DIABLO wrote:After testing i can totally say that it's the best villager mod, and from far. However, a proper trading system could be added, for example, some villagers get stuff (metal, gold, tools, sword, books) every 4 day and you pay them to get what they have, instead of just stealing their items...

continue working !
LOL. looks like i posted this last update literally at the same time you clicked on submit of your message. ^_^
Thanks for the compliments! especially coming from you as a great modder... i follow your M.I.L.A. mod closely though didn't comment much. The 'stealing' of items from my villagers was not intended for trading really. hehe. just something i threw in there so at least something happens when you right click for trading. Now the trading is taking form...

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]

by azekill_DIABLO » Post

Thank you! your modding skills are far beyond mine at this point! those villagers are really adorable!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

LouisCyfer
Member
Posts: 46
Joined: Sun Jun 25, 2017 02:24
GitHub: LouisCyfer

Re: [Mod] Villagers for Minetest [villagers]

by LouisCyfer » Post

I'm very amazed about the proceed here gotta love the trading of them! very helpful if you just go out exploring aka jack sparrow haha

Cage
Member
Posts: 81
Joined: Mon Oct 24, 2016 21:07
Location: Phoenix, Arizona

Re: [Mod] Villagers for Minetest [villagers]

by Cage » Post

ErrorNull I thought that was the problem. Creating a new map should remove the error. Any ways thanks, and I really think this mod is really a great one.

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

azekill_DIABLO wrote:Thank you! your modding skills are far beyond mine at this point! those villagers are really adorable!
Thanks. I will continue to add more special clothing variations for certain villagers like elders, field workers, smiths, etc. All other villagers will default/normal clothing variations.
LouisCyfer wrote:I'm very amazed about the proceed here gotta love the trading of them! very helpful if you just go out exploring aka jack sparrow haha
I believe trading with the villagers and discovering the random and unexpected things they have to sell and buy will be a big factor to what make the villagers fun!
Cage wrote:ErrorNull I thought that was the problem. Creating a new map should remove the error. Any ways thanks, and I really think this mod is really a great one.
Modding minetest is my primary hobby right now and i'm glad to see people are enjoying it so far. You do raise an interesting issue that i'm curious to explore later as well... concerning the inconvenience and apparent necessity to create a new map for each update i make.

i can think of a way that i can code whenever a villager spawns, it will check if it's using the latest version, and if not it will remove itself and re-spawn with the latest update. this may be an important feature even when the villagers mod is no longer WIP and is official release... as I will continue to improve my mod and do not wish for people to have to re-create their maps...

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

Re: [Mod] Villagers for Minetest [villagers]

by ErrorNull » Post

Update 0.15

[fixed]
- removed crash on non-players punching villagers

[added]
- completed main trading formspec
- traders will show **trader** on their infotext
- added coins as the main form of buying goods
- completed cost table based on coins for common items villagers will trade
- 'quest' traders who give ingots for a large number of items
- 'simplejob' traders who give a coin for small amount of resources
- if player tries to chat/trade while villager is busy (walking, turning about, etc) villager will say 'pardon', 'excuse me', etc.
- added lots of gameplay facts as dialogue that all villagers may say

[improved]
- formspec shows goods based on village and plot schem type
- formspec shows correct values for cost, stock, etc.
- only certain villagers trade (farmers, smiths, barkeeps, etc)
- can trade while in the middle of chatting now
- improved chat bubble interaction a bit
- villager tells player they are busy if player tries to chat or trade while another player is doing so first
- added <village> and <schem> parameter to chat command
- organized all code into their own lua files
- infotext on villager has useful info (and some not)

The main work this time was on the the trading:
Trading system based on coins for now. It's the easiest way for me to begin and will add other trading options later.. but will not get too elaborate. I still want to keep it simple. In order to get some 'starting cash' each village will have a couple villagers that give coins for a few small resources. Each village may also have the 'normal' traders like bakers and farmers that sell the expected items. Each village also might have a villager that will give you a valuable ingot if you gather lots of resources. For now, there is not exchange from ingot to coin, but will add soon.

To easily locate a trader among more numerous villagers, the infotext when pointing on a village will show **Trader** on those who can trade - then just right click! The goods that each trader offers is based on the village type and the actual schem type of the plot. There's not that much variation of items right now since I only support the default tools and farming items. I will soon support Farming Redo, 3D Armor, and one food and drink mod to all much more variation and uniqueness to the trade offerings of each trader.

The custom dialogue is still lacking for villagers who spawn on building/plot types like for lumberjacks, barkeeps, tent dwellers, etc. I'm planning on making the dialogue a bit more unique in variation by basing it on the actual schem type of each plot. Each structure in the village is very beautiful and I want villagers to have many specific things to say about them. ^_^ Please continue to test and report any errors like NIL error crashes - since I'm pretty good at creating those.

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.15

by KCoombes » Post

Villagers 0.15 - crash report:

Code: Select all

2017-07-08 16:07:56: ERROR[Main]: ServerError: AsyncErr: Lua: finishGenRuntime error from mod 'mg_villages' in callback ScriptApiEnv::environment_OnGenerated(): ...est-0.4.16-win32-msvc\bin\..\mods\villagers/spawning.lua:498: attempt to get length of local 'beds_data' (a nil value)
2017-07-08 16:07:56: ERROR[Main]: stack traceback:
2017-07-08 16:07:56: ERROR[Main]: 	...est-0.4.16-win32-msvc\bin\..\mods\villagers/spawning.lua:498: in function 'spawnOnBedPlot'
2017-07-08 16:07:56: ERROR[Main]: 	...est-0.4.16-win32-msvc\bin\..\mods\villagers/spawning.lua:868: in function 'part_of_village_spawned' 

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 32 guests