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

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

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

by KCoombes » Mon Aug 07, 2017 20:04

pulled new copy, but not sure if I needed to for this hotfix (not sure if I bothered with the latest MT)

Did not need hotfix after all.

Continued testing trading and got this from a bricklayer in a sandcity village:

Code: Select all
2017-08-07 19:04:10: INFO[Main]: Right-clicked object
2017-08-07 19:04:10: ACTION[Server]: singleplayer right-clicks object 515: LuaEntitySAO at (164,3.7,512)
2017-08-07 19:04:10: 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:760: attempt to concatenate local 'item_stock' (a nil value)
2017-08-07 19:04:10: ERROR[Main]: stack traceback:
2017-08-07 19:04:10: ERROR[Main]:    ...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:760: in function 'getTradingFormspec'
2017-08-07 19:04:10: ERROR[Main]:    ...test-0.4.16-win32-msvc\bin\..\mods\villagers/trading.lua:809: in function 'tradeVillager'
2017-08-07 19:04:10: ERROR[Main]:    ...test-0.4.16-win32-msvc\bin\..\mods\villagers/actions.lua:641: in function 'on_rightclick'
2017-08-07 19:04:10: ERROR[Main]:    ...netest-0.4.16-win32-msvc\bin\..\mods\villagers/spawn.lua:785: in function <...netest-0.4.16-win32-msvc\bin\..\mods\villagers/spawn.lua:785>
 

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

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

by ErrorNull » Tue Aug 08, 2017 05:30

if you right click on the node located at the village position, does the formspec that pops up show any errors? you can use /villages command to verify what the village position is for the village you're currently in.. then go to that position and right click on it.

note: the next update coming up has the trading inventory algorithm redone to be more efficient and prevent these 'item_stock' errors.
 

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

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

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

by KCoombes » Tue Aug 08, 2017 22:09

Only found two issues this time:

If you sell to a trader, say 'landlord' and wipe out his stock of coins, the next 'landlord' will also have no coins left for the same item... but will have coins for a different item...

and this one:

Image
Attachments
screenshot_20170808_163507.png
(258.04 KiB) Not downloaded yet
 

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

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

by ErrorNull » Wed Aug 09, 2017 05:26

KCoombes - the screenshot shows a job title i didn't anticipate called "soldier". i have added that in now. go ahead and grab the latest from github or just grab the traders.lua which is the only file i altered in this case.

regarding the stock item counts seemingly being updated globally instead of locally for each trader.. i will need to look into that a bit further. thanks for letting me know.
 

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

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

by Sokomine » Wed Aug 09, 2017 15:28

The villagers living and working in castles are called "soldiers" now. The ones working in i.e. towers are called "guards". Seemed most reasonable to me.
A list of my mods can be found here.
 

User avatar
Lord_Vlad
Member
 
Posts: 112
Joined: Thu Jul 20, 2017 07:58

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

by Lord_Vlad » Wed Aug 09, 2017 16:31

Just a little issue here, very specific case so don't pay too much attention : when you blow up the surroundings with says... the nuke mod, the villagers will stay in place, flying where the ground used to be and acting like nothing happened (protection removed, ofc)
 

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

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

by Sokomine » Wed Aug 09, 2017 19:59

Lord_Vlad wrote:Just a little issue here, very specific case so don't pay too much attention : when you blow up the surroundings with says... the nuke mod, the villagers will stay in place, flying where the ground used to be and acting like nothing happened (protection removed, ofc)

Perfectly correct behaviour of them :-) Nukes and TNT and the like are reserved for deep deep mining, far away from any settlements.
A list of my mods can be found here.
 

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

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

by ErrorNull » Thu Aug 10, 2017 00:18

Sokomine wrote:
Lord_Vlad wrote:Just a little issue here, very specific case so don't pay too much attention : when you blow up the surroundings with says... the nuke mod, the villagers will stay in place, flying where the ground used to be and acting like nothing happened (protection removed, ofc)

Perfectly correct behaviour of them :-) Nukes and TNT and the like are reserved for deep deep mining, far away from any settlements.


yes, my code currently agrees!

and lord_vlad, seems like you are so interested in mass pvp. lol. first it was just hitting one villager at a time, and now targeting entire villages. :O at this time, the villagers and invincible and do not follow any rules of gravity. at some point they will.
 

User avatar
ManElevation
Member
 
Posts: 896
Joined: Tue Aug 02, 2016 22:04
Location: Madrid,Spain
GitHub: ManElevation
IRC: ManElevation
In-game: ManElevation

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

by ManElevation » Thu Aug 10, 2017 17:08

ErrorNull wrote:This mod spawns villagers in Sokomine's mg_villages mod. I want to provide a light-weight and simple mod where villagers have enough basic interactivity to make the villages more fun to visit and explore. The villagers will walk around, dig some things, provide random facts or smalltalk by chatting, and buy sell items by trading. They will not befriend you, become your travel buddy, or similate a daily routine or social community.

I also focus on making the villager's appearance (skin, hair, clothing, etc) and chat dialogue random but also based on the region, climate, and type of village and building.

Image
Image

VISAUL FEATURES:
-chat popup bubbles and not player console
-skin, hair, clothing types randomly chosen
-random chat dialogue but also based on job
-random names but also based on region & age
-villagers stay near their assigned plots
-remembers prior position & actions on re-spawn
-continues prior action after chatting/trading
-villagers cannot 'hear you' if chatting to fast

TECHNICAL FEATURES:
-villagers spawn using LBM's and not ABM's
-infrequent action calculations - every 4-6 sec
-minimal walking & standing animation glitches
-checks if multiplayers chat/trade same villager

REQUIREMENTS: Sokomine's main villages mod: [mg_villages]

RECOMMENDED MODS:
[cottages] - adds more village types: medieval, charachoal, lumberjack, claytrader, logcabin, tent
[village_gambit] - adds village type 'gambit'
[village_towntest] - adds village type 'cornernote'
[village_sandcity] - adds village type 'sandcity'
[village_ruins] - adds village type 'ruins'

VERSION: v0.17
Warning! Mod is still very work-on-progress. Expect errors and halfway implemented features. It is available now to simply test and gather your feedback and report errors. Villagers do not yet support the GRASSHUT village type, so it may not work correctly or at all - or crash the game. My expected roadmap:
* v0.18 = playable trading system
* v0.20 = support more farming/food/drinks mods
* v0.25 = create chat dialogue based on each job type
* v0.30 = improve movement & actions algorithm
* v0.35 = hostile mob interaction
* v0.40 = unique clothes for certain jobs

LICENCE: WTFPL
TODO: TODO.txt on GitHub
CHANGELOG: README.txt on GitHub

DOWNLOAD [VILLAGERS] HERE! GitHub page for Villagers

love the priest!
My Public Mods! Discord: Rottweiler Games#3368
 

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

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

by LouisCyfer » Thu Aug 17, 2017 14:50

love the updates!!

I know there's always the option to use this commands "/giveme villagers:coins xxx" and "/giveme villagers:coins_gold xxx" (or via unified inventory search etc :P)

Also the trader hunting you mentioned earlier, I came up with an idea!

What you think of a reasonable coin production via technic compressor for coin making .. or a coin press to produce coins with gold or silver or copper .. also bronze (copper combined with tin)?

possible way in my idea:
metal ingot --> compress --> raw coin --> compress or via coin press --> coin (normal or gold)

EDIT:
additional idea: coin findings via default:dirt_with_grass digging!!

optional items.lua modification (suggestion!)
Code: Select all
minetest.register_craftitem("villagers:coins", {
   description = "Silver Coin",
   inventory_image = "coins.png",
})

minetest.register_craftitem("villagers:coins_gold", {
   description = "Gold Coin",
   inventory_image = "coins_g.png",
})

-- coin findings in 'default:dirt_with_grass'
local set_item_def = {
   { items = {'villagers:coins', 'default:dirt'}, rarity = 30 },
   { items = {'villagers:coins_gold', 'default:dirt'}, rarity = 50 },
   { items = {'default:dirt'} }
}

minetest.override_item("default:dirt_with_grass", { drop = { max_items = 1, items = set_item_def } })


Alternately I could write a small additional mod, including a manual coin press.
Please let me know your feedback!
ty
 

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

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

by ErrorNull » Fri Aug 18, 2017 00:13

ErrorNull wrote:love the priest!
Thanks... and the priest loves you too! :p

LouisCyfer wrote:love the updates!!

I know there's always the option to use this commands "/giveme villagers:coins xxx" and "/giveme villagers:coins_gold xxx" (or via unified inventory search etc :P) Also the trader hunting you mentioned earlier, I came up with an idea!

What you think of a reasonable coin production via technic compressor for coin making .. or a coin press to produce coins with gold or silver or copper .. also bronze (copper combined with tin)? possible way in my idea:
metal ingot --> compress --> raw coin --> compress or via coin press --> coin (normal or gold)

EDIT: additional idea: coin findings via default:dirt_with_grass digging!!

Alternately I could write a small additional mod, including a manual coin press.
I like the idea of dirt dropping some coins. I will incorporate that into my next update as an option that can be enabled/disabled and ability to adjust the drop probability from the config.lua file. Sidenote: I also plan to have dirt drop bones on rare occasions too. That is something my kids enjoy in order to make bonemeal for farming and have bones for crafting other things too.

Regarding the coin press, i personally don't user technic mods when i play, but a coin press seems interesting. I'll be open to include it into my villagers mod as another option that can be enabled or disabled from config.lua. If you can write me the code, i'll throw it in there!
 

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

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

by LouisCyfer » Fri Aug 18, 2017 07:08

@your sidenote: ethereal already adds bones to default:dirt via bonemeal.lua

maybe a routine to read out current drop and add the new drop with rarity would be a great idea! .. like having additional drop on demand. I assume 0 or 1 is very often, 100 is far rare, but haven't found any documentation about item rarity yet.
For the coin press, I'm working on a mesh for that aswell but need a routine for production for a manual way.

If you wish I could write a routine for that both in a seperate lua file, which I could do a PR via GH if thats ok.

@having settings in options menu: built-in incl documnentation

EDIT:

I put everything in a PR, hope you like it!
link
 

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

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

by ErrorNull » Tue Aug 22, 2017 00:56

LouisCyfer wrote:ethereal already adds bones to default:dirt via bonemeal.lua
the ethereal mod is one i'd like to support, won't be until later down the line. but i may just throw in the bonemeal mod in sooner along with the other food mods i'm adding now.

LouisCyfer wrote:I put everything in a PR, hope you like it!
Ok this is cool. didn't get a chance to look through it yet, but will do in the next day or two.. and most likely add it in. Thanks for putting that together!

Past few weeks have been busy with other personal things, but things starting to settle down and so plan to put out my next update this week by thurs or friday.
 

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

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

by LouisCyfer » Tue Aug 22, 2017 05:29

ErrorNull wrote:the ethereal mod is one i'd like to support, won't be until later down the line. but i may just throw in the bonemeal mod in sooner along with the other food mods i'm adding now.

very awesome! (I love the mushroom biome :D)

ErrorNull wrote:Ok this is cool. didn't get a chance to look through it yet, but will do in the next day or two.. and most likely add it in. Thanks for putting that together!

If there is anything plz let me know! I'm glad I can help :)

ErrorNull wrote:Past few weeks have been busy with other personal things, but things starting to settle down and so plan to put out my next update this week by thurs or friday.

no worries, last week had me busy aswell (RL and stuff) .. I know the feeling and no worries, good things need time and enthusiasm, also motivation.
 

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

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

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

by ErrorNull » Thu Aug 24, 2017 14:10

Hey LouisCyfer - I've merged in your pull request. Players now will find coins on rare occasions when digging dirt type nodes. After testing a bit i can see the silver and gold coins count in the player inventory occasionally increase while digging the dirt. I also like how we can enable/disable the coin-drop and startup-coins settings from the main minetest settings menu now. cool cool.
Image

I would like to have the coins sound effect (coins.ogg) play whenever coins are collected this way. Would you like to look into that update for me? That would let make it more apparent when coins are found, what do you think?
Attachments
coin-settings.PNG
(30.71 KiB) Not downloaded yet
 

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

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

by LouisCyfer » Thu Aug 24, 2017 19:09

YAY!!
I'm lad your excited about the PR and how it works .. let me know if there are any issues or something i might need to know anyways.

The sound might just be a function hook while item pickup .. no biggie!

As far I heard the "coins.ogg" does not really sound like a "super mario coin pickup" .. unsure if you planned to replace that file or if this one is a placeholder or something. I could write a small routine with that sound implented. (of course the file string can be exchanged later :) )

regards
 

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

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

by ErrorNull » Fri Aug 25, 2017 00:46

ErrorNull wrote:let me know if there are any issues or something i might need to know anyways.

On line 46 of coins.lua I tweaked the variable declaration to empty string. Otherwise there would be error if it stays nil later in the code...
Code: Select all
local debug = ""


ehh.. i wouldn't want something like the super mario coin pickup sound, which i feel is a bit too artificial or synthesized sounding. the coins.ogg sound that's currently in use (when trading with a villager) sounds like coins hitting each other.. which I prefer. i'd be open to other coin jingle sounds that are similar though.
 

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

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

by LouisCyfer » Fri Aug 25, 2017 04:01

no problem, the debug is just for debug purposes >.< and only ment for that hehe

By any means, I respect the way you design your mod also will follow with whatever your vision floats you!

For me this ogg file sort of sounds like paper to me, maybe another sound would be more appropiate but I would not mind agreeing to exchange. If that's ok I look out for another coins.ogg :)

EDIT:
a quick search gave me this result which is licensed CC0 aswell so we can use it and it is a better sound in my opinion, but it depends on you because your the mod creator.

CoinToJar.mp3
Natural Metal Coin Sound 3.wav
 

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

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

by daddaaddaaad » Tue Jul 24, 2018 11:45

Image

Hello, I really like this villagers mod but I have a problem with the villagers spawning bellow ground.
I changed the value for pos.y = village_data.vh + 0.5 to pos.y = village_data.vh + 2 and the result is in the linked image. (line 345-ish?)
-edit 25/7/18: the edited file is spawn.lua

It looks like the hitbox for the villagers is not at their correct position. Can anyone point which line I should edit? I'm new to editing lua files, but been enjoying minetest since 4.14.

-edit 25/7/18: should I be looking into attributes.lua? There's this "collision box" thing right at the end.
Again, I really like this mod and been playing minetest with my son since 4.14. We'd like to have other things to do besides building and fighting mobs.
 

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

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

by daddaaddaaad » Wed Jul 25, 2018 06:18

Image

So... here's what I did:

In spawn.lua I used this value pos.y = village_data.vh + 1.25
I think the spawned villagers' feet touch the ground closest with this setting (at least for me)
I still have problems with villagers' children who spawned on snow, they float even after the snow was dug (where you get snowballs).
Now the villagers roam and are doing their stuff.

And for the collision box (edit = this is in attributes.lua) since I don't really know which value controls which axis it's a bit of trial and error and here's the values I use:
local new_collision_box = {
- 0.25*new_size, - 0.25*new_size, - 0.25*new_size,
0.25*new_size, 0.5*new_size, 0.25*new_size
}
The result is that small box right around the chest of the villagers themselves, but it's usable for trading I guess.
 

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

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

by Sokomine » Wed Jul 25, 2018 16:25

daddaaddaaad wrote:I still have problems with villagers' children who spawned on snow, they float even after the snow was dug (where you get snowballs).

The 3d models for the children are usually scaled-down versions of the adults. With just the size beeing changed, the model will float in midair. I've seen the effect in my mobf_trader mod as well but don't know a workaround.
A list of my mods can be found here.
 

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

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

by daddaaddaaad » Thu Jul 26, 2018 02:45

Sokomine wrote:The 3d models for the children are usually scaled-down versions of the adults. With just the size beeing changed, the model will float in midair. I've seen the effect in my mobf_trader mod as well but don't know a workaround.


I gues the origin for the axis isn't at their feet? I mean where the coordinates of x,y,z is at 0,0,0

Anyway, it isn't much of a problem because it seems the villagers are doing what they are supposed to do now. And it looks like the floating children only happens in arctic region.
 

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

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

by Sokomine » Thu Jul 26, 2018 14:59

daddaaddaaad wrote:Anyway, it isn't much of a problem because it seems the villagers are doing what they are supposed to do now. And it looks like the floating children only happens in arctic region.

Maybe they don't want to freeze their feet ,-)
A list of my mods can be found here.
 

PreviousNext

Return to WIP Mods



Who is online

Users browsing this forum: MSN [Bot] and 3 guests