Page 1 of 5

[Mod] Towntest [towntest] - Grow a town in minetest.

Posted: Fri Sep 28, 2012 10:55
by cornernote
Towntest for Minetest

Grow a town in minetest.

Documentation | GitHub Project

Image

About

This module is open source, so it's distributed freely. If you find it useful then I ask not for your wealth, but simply to spare your time to consider the world we share by watching Earthlings, a multi-award winning film available to watch online for free. A must-see for anyone who wishes to make the world a better place.

Credits

PilzAdam - made the initial NPC entity movement code
VanessaE - contributed buildings
kddekadenz - contributed buildings
ACDC - contributed buildings
Nanuk - contributed buildings
irksomeduck - contributed buildings

License

BSD-3-Clause, Copyright © 2014 Brett O'Donnell

Posted: Fri Sep 28, 2012 11:24
by creeper96
Awesome mod corner just one problem where do i put it when i have finished downloading

Posted: Fri Sep 28, 2012 11:53
by tkerwel
first step to Millénaire - NPC village in minetest .... i really love your ideas ... go on like that an i out myself as cornernote fanboy (ups...fanoldy *lol*)

Posted: Fri Sep 28, 2012 13:27
by madchicken13
Im adding this on my Server does it need any other mods?

Posted: Fri Sep 28, 2012 14:07
by GloopMaster
seems good, however would it be possible to instead create villages on mapgen? I believe this is what you are getting at, however, i'm just giving you a... push in the right direction :3

Posted: Fri Sep 28, 2012 15:23
by alexcraft
i put a chest down i right click on it and it was a normal chest give the command for it or how to craft it
please

Posted: Fri Sep 28, 2012 23:36
by madchicken13
There is no Crafting recipe for this And it shouldnt
(I Use this on my server :)

Posted: Fri Sep 28, 2012 23:45
by Casimir
/giveme towntest_chest:chest
and then you have one.

Posted: Sat Sep 29, 2012 01:03
by cornernote
creeper96 wrote:Awesome mod corner just one problem where do i put it when i have finished downloading
Simply download and put the whole download into mods/minetest
tkerwel wrote:first step to Millénaire - NPC village in minetest .... i really love your ideas ... go on like that an i out myself as cornernote fanboy (ups...fanoldy *lol*)
Yes! That was my inspiration. I think coding this in MT/lua will be a LOT easier than coding it in MC/java.

madchicken13 wrote:Im adding this on my Server does it need any other mods?
Yes, it needs default. If your *.we buildings require other nodes then you will need them installed too.

Any other dependancies will be listed in depends.txt and on this page.
GloopMaster wrote:seems good, however would it be possible to instead create villages on mapgen? I believe this is what you are getting at, however, i'm just giving you a... push in the right direction :3
Yep, you guessed it. The plan is for MT to create fully functional NPC villages. However thats a fair way off.

If you would like to help by contributing buildings, npcs, textures, code, etc then please feel free. Any contributors will be added to the credits (when i put them up) on the home page, forum page and readme. Any active contributors will also be given access to write to the git repo.
alexcraft wrote:i put a chest down i right click on it and it was a normal chest give the command for it or how to craft it
please
It's not a normal default:chest. Its a towntest_chest:chest.
madchicken13 wrote:There is no Crafting recipe for this And it shouldnt (I Use this on my server :)
Correct, there is no craft, and the plan is to build it on mapgen, not to craft it.
Casimir wrote:/giveme towntest_chest:chest and then you have one.
Thanks Casimir. Yep thats the only way to get it at the moment. (or use creative inventory)

Posted: Sat Sep 29, 2012 02:49
by Neuromancer
Wow.... This is the most impressed I have been by a mod ever. I know Vanessa's houses depended heavilly on other mods like home decor. What did you do to deal with that? Suppose I don't have home decor installed? What if I do install it?

Posted: Sat Sep 29, 2012 03:15
by cornernote
all the non-standard items are stripped out of the *.we files in this pack. feel free to decorate the house yourself after the NPC builds it

if i decide to include *.we files that need mods then i will add them to the depends.txt

Posted: Sat Sep 29, 2012 03:38
by Neuromancer
cornernote wrote:all the non-standard items are stripped out of the *.we files in this pack. feel free to decorate the house yourself after the NPC builds it

if i decide to include *.we files that need mods then i will add them to the depends.txt
Don't worry about it. I think it's best that you did strip out the non-standard stuff. Mods that depend on too many other mods lead to a to a mod explosion. Simple is good.

Posted: Sat Sep 29, 2012 12:14
by Neuromancer
What about for those of us who want Immediate Gratification. Shouldn't there be a super-chest or a prefab chest, that when you place it the building appears almost immediately like from world edit? (also you don't have to stock it with materials, it comes pre-filled with all the materials it needs.) If you want to build epic villages you might not want to wait for your buildings to be built. Ok, I''m getting impatient for my buildings to be built. I want to see them all. ;)

Posted: Sat Sep 29, 2012 12:36
by cornernote
Neuromancer wrote:What about for those of us who want Immediate Gratification. Shouldn't there be a super-chest or a prefab chest, that when you place it the building appears almost immediately like from world edit? (also you don't have to stock it with materials, it comes pre-filled with all the materials it needs.) If you want to build epic villages you might not want to wait for your buildings to be built. Ok, I''m getting impatient for my buildings to be built. I want to see them all. ;)
Deploy Nodes does that, but there is no gui to choose the buildings, its random (small, medium, large)

feel free to take chunks of code from both to make a new mod that lets you choose which building.

Posted: Sat Sep 29, 2012 13:23
by Neuromancer
Nanuk's_chapel has 2 unknown items in it. Any idea what mod I need for it?

Posted: Sat Sep 29, 2012 16:48
by cornernote

Posted: Sat Sep 29, 2012 16:51
by cornernote
many updated to NPC movement... he now takes items from the chest then moves (instead of instantly teleporting) to within a few nodes of where the block is about to be placed. once he gets there the block is added.

you can kill him, and he will lose his inventory.

be builds from the ground up so it looks more realistic

thanks @PilzAdam for all the help

Posted: Sat Sep 29, 2012 16:53
by PilzAdam
cornernote wrote:many updated to NPC movement... he now takes items from the chest then moves (instead of instantly teleporting) to within a few nodes of where the block is about to be placed. once he gets there the block is added.

you can kill him, and he will lose his inventory.

be builds from the ground up so it looks more realistic

thanks @PilzAdam for all the help
Thank you for this awesome mod!

Posted: Sat Sep 29, 2012 17:02
by cornernote
<PilzAdam> cornernote, add a field for food that the worker can take to be faster for some time

Posted: Sat Sep 29, 2012 17:37
by PilzAdam
Can you remove the items that the worker takes instantly from the items needed list and not if they are placed?

Posted: Sun Sep 30, 2012 03:31
by Neuromancer
Deploy Nodes does that, but there is no gui to choose the buildings, its random (small, medium, large)

feel free to take chunks of code from both to make a new mod that lets you choose which building.
It was easy enough to get him to stop checking to see if I had material

Code: Select all

        if true then
        --if inv:contains_item("main", v.name) then
            -- take from the inv
            --inv:remove_item("main", v.name.." 1")
            inv:remove_item("needed", v.name.." 1")
But I wanted to speed him up.
I tried the following:

Code: Select all

-- register_abm
minetest.register_abm({
    nodenames = {"towntest_chest:chest"},
    interval = .01,  --was orginally 1
    chance = 1,
    action = towntest_chest.build,
})
But he doesn't seem much faster. Do you have any idea where the best place to get him building really fast would be?

Posted: Sun Sep 30, 2012 06:54
by cornernote
https://github.com/cornernote/minetest- ... t.lua#L129

change this:
npc:moveto({x=pos.x,y=pos.y+1.5,z=pos.z},2,2,0,function(self,after_param)

to this:
npc:moveto({x=pos.x,y=pos.y+1.5,z=pos.z},10,2,0,function(self,after_param)

the arg after the pos is the speed at which he will move.

Posted: Sun Sep 30, 2012 07:57
by PilzAdam
Neuromancer wrote:

Code: Select all

-- register_abm
minetest.register_abm({
    nodenames = {"towntest_chest:chest"},
    interval = .01,  --was orginally 1
    chance = 1,
    action = towntest_chest.build,
})
AMBs cant have a interval < 1.

Posted: Sun Sep 30, 2012 09:16
by cornernote
put apples or an item with groups.food=[1|2|3] to make npc move faster

Posted: Sun Sep 30, 2012 09:19
by cornernote
some ideas from IRC:

<PilzAdam> new feature: dont allow him to replace blocks; only if he gets a tool he will try to dig them and bring the result to the chest

<PilzAdam> for the future: you have to create a house where workers live and they go at daytime to work and at the evening you have to give them food

<PilzAdam> hire & fire would be nice
<PilzAdam> "I will build for you for 10 iron"
<PilzAdam> "I will go collect some wood for you for 1 bread"
<PilzAdam> "I will protect you for 1 day for 2 steel ingots"


<cornernote> can object have formspec ?
<PilzAdam> no :-(
<cornernote> i know a hacky way
<cornernote> onpunch, turn him into a node
<cornernote> then abm to turn him back
<cornernote> actually
<cornernote> that will work really well
<cornernote> cos then he stops moving
<cornernote> faces you
<cornernote> and hes a chest
<cornernote> with mapgen, something like 1 or 2 chests per region will be placed
<cornernote> cos each will generate a whole village
<cornernote> will probably have to flatland under it
<cornernote> or the workers can do that
<cornernote> as a player you join a village
<cornernote> and perhaps can rob from other villages