Conception for a tree Mod

User avatar
mauvebic
Member
 
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Tue Jul 31, 2012 12:51

Dont bother putting this in 4seasons, its discontinued, im only looking to save the 2 trees in it.

Post your nodebox model ill see if i can help
"Fuck the hat." - Paulie Gualtieri
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Tue Jul 31, 2012 19:20

tkerwel wrote:to do:
- make sure that a tree dont grow where already something is build (this realy gives me some pain ....)

I was thinking about this. Before a tree grows a node, could you check to see if where it wants to grow is nodetype of "air"? If it is, let it grow, otherwise don't grow there.
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Aug 01, 2012 06:51

@Neuromancer

thats not that easy.... i dont have a problem to check if the node above is air or not... but this is not the whole truth.

normaly you have to check the whole shape of the tree to see if there is something interfearing with the node you want to place. as i use random shapes for different grows with the abm its hard to write a routine for that.

so the tree grow routine has to run 2 times, first to check if every node i want to place something is free and then if there is no interfearing with something place them.

my trys so far are all not working well.


if i dont get a "glory" idea today i think i will offer this as mod in a kind of alpha version. cause i think if other can work with this code, they might have this "glory" idea to put into this mod.
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Aug 01, 2012 09:50

So here is a test version for download, cause i dont find a good routine for the proof that the whole tree dont grow into some building..

tk.zip

it would be fine, if i get some comments or tips what still is to change. in a few days i will open a "tk Tree Mod" as beta version. i hope up to that time, i got some comments so i have some more goals for this little mod.

whats still missing in this test version.

there are no crafts, so for testing you have to get the saplings with

\giveme tk:tk_birch_sapling value
\giveme tk:tk_pine_sapling value

Notice: for testing the saplings will grow at once when you place them, this will be removed later in beta version



known mistakes:
- i dont get why i can go thru the birch leaves but not thru the pine leaves, maybe somebody can find this mistake
- if detail is to high i get a meshbuffer error after to many pinetrees, no solution for that, so if that occurs the detail level must be reduced
- still no routine for checking if there is something in the way
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

by Neuromancer » Wed Aug 01, 2012 11:44

tkerwel wrote:@Neuromancer

thats not that easy.... i dont have a problem to check if the node above is air or not... but this is not the whole truth.

normaly you have to check the whole shape of the tree to see if there is something interfearing with the node you want to place. as i use random shapes for different grows with the abm its hard to write a routine for that.

so the tree grow routine has to run 2 times, first to check if every node i want to place something is free and then if there is no interfearing with something place them.

my trys so far are all not working well.


if i dont get a "glory" idea today i think i will offer this as mod in a kind of alpha version. cause i think if other can work with this code, they might have this "glory" idea to put into this mod.


No worries, if you can't figure it out, it won't be any worse than the conifers mod. I find it odd that the conifers will replace nodes in your structure, but the regular trees won't. Either it's just because the conifers are just so much wider than regular trees, or it is because regular trees have some sort of algorithm telling them not to replace structures. I think it is the latter, because I have placed regular tree saplings right next to my structures and they haven't replaced nodes in them. It might be worth a look at the regular tree algorithm if that is written in Lua, or is it part of the C++?
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Aug 01, 2012 12:00

@Neuromancer
i dont know if the tree algorithm is lua or c++ but i guess its c++..
anyway soon i have holiday, then i have somer more time for this. in the moment the only solution is a kind of this
routine.

first run to check if there is in a certain area (like the tree shape) a node different then air, ckecking node for node and always give back the value of yes/no ... soon as i get a "NO" that means no tree can grow here.
if the whole routine is running without a no, then the abm can start growing the tree...

normaly i like to code a kinde of node_box generator for minetest as external programm, which produce as output lines witch can directly used in the node_box defenition. look like this plan has to wait....

i like to develop this in dev ++ (free c++ IDE) and as 3d engine irrlicht 1.7... i already download this, but still need my time to get this running. biggest problem is to know where/how the liberieas and includes are defined. so i am not even able in the moment to get a simple "hello Minetest" programm working together with the irrlicht engine...

anyway...somebody already had the chance to look into this "tk Tree Mod" and can give me some comments ?
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Wed Aug 01, 2012 14:02

tkerwel wrote:known mistakes:
- i dont get why i can go thru the birch leaves but not thru the pine leaves, maybe somebody can find this mistake


Under: minetest.register_node("tk:tk_birch_leaves", {

put "--" before the lines 99, 100 and 101 like this

node_box = { --node_box = {
type = "fixed", --type = "fixed",
}, --},

then walkable = true, will work and won't let you walk through the birch-leaves

I guess the nodebox misses some specifications if you want it to be a nodebox. Now it treats it as a normal "node"
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Thu Aug 02, 2012 06:25

@Topywo

i did (see code below)... but still i can walk inside the leaves .... i am really lost with this.. :-((

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("tk:tk_birch_leaves", {
    description = "tk_birch_leaves",
    tile_images = {"tk_birch_leaves.png"},
    inventory_image = "tk_birch_leaves.png",
    wield_image = "tk_birch_leaves.png",
    paramtype = "light",
    paramtype2 = "facedir",
    walkable = true,
    selection_box = {
        type = "fixed",
        fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
    },
    --[[
    node_box = {
    type = "fixed",
    },

    --]]
    groups = {tree=1,snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=2},
    drop = {
        max_items = 1,
        items = {
            {
                -- player will get sapling with 1/10 chance
                items = {'tk:tk_birch_sapling'},
                rarity = 10,
            },
            {
                -- player will get leaves only if he get no saplings,
                -- this is because max_items is 1
                items = {'default:leaves'},
            }
        }
    },
    sounds = default.node_sound_leaves_defaults()
   
})
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

by Topywo » Thu Aug 02, 2012 11:01

I just tried with the --[[ --]] twice, installing it from the zip.
Third time I copied your text (post 38) over the (leaves) text in birch.lua

Al 3 times I couldn't walk through the birch leaves...

I use the latest version of minetest 0.4.2, downloaded it a few hours after release. I work on a Linux/Lubuntu 11.10.

The only other way I know how you can walk through the leaves is by using free move/fly.
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Thu Aug 02, 2012 11:38

strange...

i use the minetest-0.4.2-rc1-d38b465-win32 version since a few days... and i am sure i dont use the fly command...cause the next tree is a pinetree and there i hit always my "singelplayer head" when i try to walkt there...

looks like i have to test this on my eeepc with the kubuntu 12.04 version if that happens there too......maybe a bug in the windows build ?
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
Bas080
Member
 
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080

by Bas080 » Thu Aug 02, 2012 15:23

mauvebic wrote:Assuming he's using an ABM to spawn the tree, how does he use the tree/trunk to assign a facedir to the leaves? (could come in handy :-))


My plants mod in (signature) has the spawning for plants. Could be used for trees too. It's not completely done yet. It uses the on generate to spawn nodes on "surfaces".
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Thu Aug 02, 2012 17:28

@Bas080

prob already solved, see post a bit above

thx anyway for the tip and help
Last edited by tkerwel on Thu Aug 02, 2012 17:29, edited 1 time in total.
++++ Kung walang tiyaga, walang nilaga. ++++
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Fri Aug 03, 2012 06:46

So littel Update...

i had to make a deccision, as my time is limited and i want to learn a bit more abt programming. So whats the plan fopr my limited time and holiday? (cuse this might be the last chance this year to make progress in comming back into programming)

should i put more time into the trees or spent time for my node_box generator for minetest ?

as i know lots of you guys are really good in creating mods for minetest and most of the things i like are already done, it was easy.

i stop puting time into the tree mod and go one to use other mods, modifiy them if there is something i dont like or want to be working different. and i will know concentrating into the node_box generator.

so feel free to use my example and code for your own purpose and if you have questions feel free to ask.

good luck and have fun with this free and for your use Code Snippet of the tree concept.
++++ Kung walang tiyaga, walang nilaga. ++++
 

Dragonop
Member
 
Posts: 1178
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop

by Dragonop » Wed Oct 31, 2012 15:17

THERE IS A WAY TO DISABLE ROUNDED TRUNK?
It's "Drag" for the friends.

Sorry I haven't been online as much lately, I'm real busy.
https://forum.minetest.net/download/file.php?id=4472
 

User avatar
tkerwel
Member
 
Posts: 213
Joined: Fri Jan 13, 2012 07:35

by tkerwel » Wed Oct 31, 2012 15:30

this question we had before already in this topic... look at this, hope this helps

tkerwel wrote:
Stef wrote:nice but i want a blocky trunk


thats no problem just delete in the code the fixed = slopebox

from
node_box = {
type = "fixed",
fixed = slopebox,
},

to

node_box = {
type = "fixed",
},

and the mod use a cube/blocky trunk again....

hmm maybe i should build in a posibility to switch between round/blocky trunk's ...one more point on my feature list for that mod....

thanks Stef
++++ Kung walang tiyaga, walang nilaga. ++++
 

sda97
Member
 
Posts: 33
Joined: Fri Jul 06, 2012 07:45

by sda97 » Fri Nov 23, 2012 14:41

RealTest and your mod have similar goals. You can see trees in our repository on github(just watch the branch of a tree, not a master).
 

Previous

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 46 guests

cron