Need for help with mg_villages questions

Post Reply
oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

Need for help with mg_villages questions

by oddguy117 » Post

I have a little problem. The villages from mg_villages are OP. If I find a village I can grief every chest event though protection is on. This makes the game no fun to play, because finding a village and nearly instantly getting 500 mese crystals and 300 diamonds etc. is just boring. I already set the spawn probability for the villages down to 6.

My wish is to make the villages together with advanced_npc more MC like. Which means, that the cities are not so complex (like wood houses etc.) and there is no protection at all. But for that I need help for how to implement cities myself and ban the other cities from spawning. For that I would also need to know how to deactivate the protection totally and make the inventory of chests a lot less valuable (If you grief a city you get max. 10 diamonds.).

Does somebody know how to do that? If yes, please help me.

For the Moderators of this forum: If I posted this topic somewhere false please don't delete it, just move it. Thanks

oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

Re: Need for help with mg_villages questions

by oddguy117 » Post

Edit: Advanced_npc doesn't work on with my minetest, so I would also need help with that. Since I installed this mod there are sky islands and long stone sticks spawning in the scenery. It looks awful is there a way to fight this? Another problem: To get the newest minetest version I have to use flatpak, but the data file locations are different. At the moment I'm copying the mods in the mod folder of minetest_game. I don't like this, because this way I'm not able to deactivate them in the game. Can sb please help me?

Edit: I found the folder
Last edited by oddguy117 on Sat Nov 23, 2019 17:08, edited 1 time in total.

oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

Re: Need for help with mg_villages questions

by oddguy117 » Post

There's also another problem. I do spawn in the villages. Is there a way to fix that.
Does sb know how to sell items to villagers in the villager mod?

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

Re: Need for help with mg_villages questions

by Sokomine » Post

oddguy117 wrote: If I find a village I can grief every chest event though protection is on.
I wouldn't call that griefing. After all the villagers *might* have used locked chests if they'd have valued their posessions more (...and if they could have afforded the locked chests). Real griefing would be destroying their homes. It'd of course be great if a villager would cry "Thief! Thief!" or beg you to give the things back once he notices illegal chest operations...but I'm afraid that's beyound what current villagers of any kind can do. And trying to attack or chase away the players would be very unhealthy for any normal villager (the ones in AdventureTest might succeed :-)).
oddguy117 wrote: This makes the game no fun to play, because finding a village and nearly instantly getting 500 mese crystals and 300 diamonds etc. is just boring
That...really..sounds like too much. And you've discovered a real problem there: Those valuable ingots, diamonds etc. came into play when I added content for the chests of ships. That random content was also added to normal chests. That's fixed now. Please get the newest version of handle_schematics.
oddguy117 wrote: My wish is to make the villages together with advanced_npc more MC like. Which means, that the cities are not so complex (like wood houses etc.) and there is no protection at all.
I personally don't like the old type of MC villages very much. The structures there are too simplistic. The newer versions are at least better. I wouldn't call mg_villages villages cities either; there's just not enough internal structure for a town or city.

If you want villages to be smaller in general, you can set the max size value to something lower, i.e. 20:

Code: Select all

       for k,v in pairs(mg_villages.village_type_data) do
                if(v and v.max and v.max > 20) then
                        mg_villages.village_type_data[k].max = 20
                end
                if(v and v.max and v.min > 10) then
                        mg_villages.village_type_data[k].min = 10
                end
        end
oddguy117 wrote: But for that I need help for how to implement cities myself
No problem there. Take a look at all the village_* mods in my Github repository. They're examples about how new village types can be created. What you need are the buildings you wish to use there. Best save them using handle_schematic's build_chest (/giveme handle_schematics:build 2) because that takes care of rotation automaticly. Drop all those schematics inside a folder named schems/ in your new mod and create an appropriate init.lua file.
oddguy117 wrote: ban the other cities from spawning
You can do the following to prevent villages of one type from spawning (in this case: village type taoki; the houses there sometimes use valuable blocks because those look aestethicly pleasing; yet griefing them would interfere with your gameplay)

Code: Select all

mg_villages.village_type_data['taoki'].supported = nil
oddguy117 wrote: For that I would also need to know how to deactivate the protection totally
For that, there's even a config variable:

Code: Select all

mg_villages.ENABLE_PROTECTION = false
oddguy117 wrote: and make the inventory of chests a lot less valuable (If you grief a city you get max. 10 diamonds.).
That's difficult to limit. But you have a lot of control about what ends up in the chests. Here are some examples about what you can do:

Code: Select all

for i,v in ipairs(handle_schematics.random_chest_content) do
        -- v is structured like this:
        -- v[1]  stack name
        -- v[2]  probability (0..100); stack will be put in the chest if v[2] > random(1,200)
        -- v[3]  maximum stack size that can be found in each slot of a chest
        -- v[4]  up to this many inventory slots of the chest may recive such a stack
                -- do not let the probability for any stack get too high
                if(v[2] > 50) then
                        handle_schematics.random_chest_content[i][2] = 50
                end
                -- do not let each stack get over 20 items large
                if(v[3] > 20) then
                        handle_schematics.random_chest_content[i][3] = 20
                end
                if(   v[1]=="default:diamondblock"
                   or v[1]=="default:diamond"
                   or v[1]=="default:mese") then
                        -- relatively low probability
                        handle_schematics.random_chest_content[i][2] = 5
                        -- no more than one of these items per stack
                        handle_schematics.random_chest_content[i][3] = 1
                        -- and no more than two stacks inside each chest
                        handle_schematics.random_chest_content[i][4] = 2
                end
        end
        -- add a small chance to find a diamond in a normal chest
        table.insert(handle_schematics.random_chest_content,
                    {"default:diamond", 10, 1, 1, default_chest=1})
You can also discard the entire content of the handle_schematics.random_chest_content variable and just fill it with whatever you like.

The newest handle_schematics also allows you to set i.e.

Code: Select all

handle_schematics.random_chest_probability_factor = 1000
with the default value beeing 200. A chest will get (part of) the stack from above if v[2] > handle_schematics.random_chest_probability_factor.

With the recent changes, you won't find any more diamonds in the chests. The villagers are poor...maybe I ought to add support for the colored clothes one mod adds so that the chests could contain their clothes. Sticks, torches and the occasional book are common contents.
oddguy117 wrote: For the Moderators of this forum: If I posted this topic somewhere false please don't delete it, just move it. Thanks
You might have posted in the mod's thread as that'd help others with similar questsions to locate the solution easier. But I'm sure a link will do.
oddguy117 wrote: Since I installed this mod there are sky islands and long stone sticks spawning in the scenery. It looks awful is there a way to fight this?
Those long sticks ought to be long gone...do you have the latest version of each? Sky islands can't always be prevented. It depends a bit on the mapgen you use. V6 works very well. Others sometimes get a bit exotic and are less good places (though it mostly works).
oddguy117 wrote: There's also another problem. I do spawn in the villages. Is there a way to fix that.
That can be done this way:

Code: Select all

mg_villages.spawnplayer = function(player)  end
oddguy117 wrote: Does sb know how to sell items to villagers in the villager mod?
How about asking in the right thread for the mod? There might be some additional information there anyway.

As some of the changes above need to be done at the right time, I've packed it into a small .zip file for download. The best way to adjust mg_villages to your needs is to add a small mod which does these changes (the name of the mod does not matter).
Attachments
modify_mg_villages.zip
(1.53 KiB) Downloaded 59 times
A list of my mods can be found here.

oddguy117
Member
Posts: 23
Joined: Thu Nov 07, 2019 19:08

Re: Need for help with mg_villages questions

by oddguy117 » Post

I changed your code a little and now I like it. Big THANKS that you used your time to code this. I'm a little into programming, but I am to lazy to really read my "Learn how to program C++ book.". With that said I'm gonna try learning C++ and Lua (maybe Python too ; ) ) at the same time, because as I saw, that the advanced_npc mod doesn't even have a spawning system, I thought I had to make at least a basic one myself.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests