[mod] Stripped tree trunks [stripped_tree]

Post Reply
User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

[mod] Stripped tree trunks [stripped_tree]

by 1faco » Post

Hi, this is my first mod. it allows to remove tree bark. (Now it work with axe)


Image

How to use: Just right clic with an axe at tree trunk.(Default axes only. but you can easily add support for other mods.)
In survival you can get tree bark that you can use as fuel.

License

Code
by minefaco GPLv3.0 (License for code and media)
contributed to by wsor4035

Depends: Default.
Optional depends: moretrees

Download zip: https://github.com/minefaco/chisel_tree ... e/main.zip
Github: https://github.com/minefaco/chisel_tree
Last edited by 1faco on Wed Dec 23, 2020 17:12, edited 7 times in total.

HighPopes
Member
Posts: 48
Joined: Tue Sep 22, 2020 01:38
GitHub: HighPopes

Re: [mod] Chisel for tree trunks [chisel_tree]

by HighPopes » Post

Really like the textures.

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: [mod] Chisel for tree trunks [chisel_tree]

by wsor4035 » Post

looks very nice

are the textures GPL-3.0 as well?
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Re: [mod] Chisel for tree trunks [chisel_tree]

by 1faco » Post

wsor4035 wrote:
Wed Nov 04, 2020 17:12
looks very nice

are the textures GPL-3.0 as well?
Edit: Now it is.
Last edited by 1faco on Sat Nov 07, 2020 23:28, edited 1 time in total.

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: [mod] Chisel for tree trunks [chisel_tree]

by wsor4035 » Post

I forked the repo and added a few features you may be interested in, submitted a PR request
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Re: [mod] Chisel for tree trunks [chisel_tree]

by 1faco » Post

wsor4035 wrote:
Thu Nov 05, 2020 01:56
I forked the repo and added a few features you may be interested in, submitted a PR request
Really interesting!. merged, thank you for the contribution.

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: [mod] Chisel for tree trunks [chisel_tree]

by wsor4035 » Post

no problem
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

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

Re: [mod] Chisel for tree trunks [chisel_tree]

by Sokomine » Post

Nice! Perhaps you could also carve things in trees, i.e. a heart or just a landmark? And the bark might be useful for some things as well, though probably not without further changes in the game (bowls, ships, first house..).
A list of my mods can be found here.

User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Re: [mod] Chisel for tree trunks [chisel_tree]

by 1faco » Post

Sokomine wrote:
Sat Nov 07, 2020 23:42
Nice! Perhaps you could also carve things in trees, i.e. a heart or just a landmark? And the bark might be useful for some things as well, though probably not without further changes in the game (bowls, ships, first house..).
I was thinking of getting paper from bark, you can craft bowls if you have the farming_redo, carving sounds exciting, maybe I'll add it

Merak
Member
Posts: 116
Joined: Sat Nov 05, 2016 20:34

Re: [mod] Stripped tree trunks [stripped_tree]

by Merak » Post

I play with HDX textures. This won't do for me or people with texture packs other than default.I guess it would be possible to generate textures at run time, but that would be much work.

User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Re: [mod] Stripped tree trunks [stripped_tree]

by 1faco » Post

Merak wrote:
Wed Nov 18, 2020 13:16
I play with HDX textures. This won't do for me or people with texture packs other than default.I guess it would be possible to generate textures at run time, but that would be much work.
Or maybe you can do a hd textures and add it to your hdx textures, so it will be applied at runtime.

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [mod] Stripped tree trunks [stripped_tree]

by ThorfinnS » Post

Cool idea. A few things:

1. Can't do anything with the stripped logs. You need to add the recipe for planks. Easiest way I saw while retaining your base code was:

Code: Select all

...
local trunk_names = {
	"tree", "jungletree", "aspen_tree", "acacia_tree", "pine_tree",
}
local plank_names = {"wood","junglewood","aspen_wood","acacia_wood","pine_wood"}
local i, name

for i=1, #trunk_names do
	
	
	name=trunk_names[i]
    minetest.register_node(":default:stripped_" .. name, {
	    description = "Stripped "..trunk_names[i],
	    tiles = {
		    "stripped_"..name.."_top.png",
		    "stripped_"..name.."_top.png",
		    "stripped_"..name..".png"
	    },
	    groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1},
	    sounds = default.node_sound_wood_defaults(),
	    paramtype2 = "facedir",
	    on_place = minetest.rotate_node,
    })
	minetest.register_craft({
		output = "default:"..plank_names[i].." 4",
		recipe = {
			{"default:stripped_" ..name},
		}
	})
end
...
2. One of the students decided that tree bark would be a great source of farming:string. It's hard to justify filling an inventory slot for just an additional 15 seconds of burn time.

3. If you still have the original chisel code and art, might want to option that. We already have right-click assigned to something else. It would solve a lot of issues to just craft the bark from the trunks, similar to how TenPlus1's Farming Redo does pineapple tops.

4. Why did you choose to add it to default instead of chisel_tree? Makes it more difficult for players to figure out what was added.

5. Need to make it a function call (API) so other mod's trees can be supported.

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: [mod] Stripped tree trunks [stripped_tree]

by wsor4035 » Post

@ThorinnS what do you have right click assigned to? i.e. what mod?
also can submit a PR to add support for other mods, probably better as it can avoid circular dependencies if support for that mod is added in the future
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [mod] Stripped tree trunks [stripped_tree]

by ThorfinnS » Post

Place torch, assuming there's one in inventory. It's a work in progress one of the students is working on, so there's no code uploaded anywhere yet.

Re: API, I was just suggesting that it be handled like stairs and farming redo and most of the other popular mods do -- the person who creates the new node just calls the function and doesn't require PRs or anything else. Alternatively, it also makes it possible for individual users to make tweak mods for their particular server.

I'll see if I can talk one of the kids into making the textures for [cool_trees] and maybe [moretrees]. I think [add_trees] just uses default nodes, but I can check.

User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Re: [mod] Stripped tree trunks [stripped_tree]

by 1faco » Post

ThorfinnS wrote:
Sat Dec 05, 2020 10:51
Cool idea. A few things:

1. Can't do anything with the stripped logs. You need to add the recipe for planks. Easiest way I saw while retaining your base code was:

Code: Select all

...
local trunk_names = {
	"tree", "jungletree", "aspen_tree", "acacia_tree", "pine_tree",
}
local plank_names = {"wood","junglewood","aspen_wood","acacia_wood","pine_wood"}
local i, name

for i=1, #trunk_names do
	
	
	name=trunk_names[i]
    minetest.register_node(":default:stripped_" .. name, {
	    description = "Stripped "..trunk_names[i],
	    tiles = {
		    "stripped_"..name.."_top.png",
		    "stripped_"..name.."_top.png",
		    "stripped_"..name..".png"
	    },
	    groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1},
	    sounds = default.node_sound_wood_defaults(),
	    paramtype2 = "facedir",
	    on_place = minetest.rotate_node,
    })
	minetest.register_craft({
		output = "default:"..plank_names[i].." 4",
		recipe = {
			{"default:stripped_" ..name},
		}
	})
end
...
Interesting... probably in the next update, now i'm working and i don't have too many free time. you can make a PR.
ThorfinnS wrote:
Sat Dec 05, 2020 10:51
2. One of the students decided that tree bark would be a great source of farming:string. It's hard to justify filling an inventory slot for just an additional 15 seconds of burn time.
That's a nice idea, maybe 8 tree barks and 1 water bucket for paper and just 6 tree barks for 3 strings. :D.
ThorfinnS wrote:
Sat Dec 05, 2020 10:51
3. If you still have the original chisel code and art, might want to option that. We already have right-click assigned to something else. It would solve a lot of issues to just craft the bark from the trunks, similar to how TenPlus1's Farming Redo does pineapple tops.
i was thinking about that, i mean that i can make optional the use of axes or a chisel. althought the code just rewrite the axes, it don't affects other tools, and if you don't have an axe in hands the right clic is free to use for any mod.
ThorfinnS wrote:
Sat Dec 05, 2020 10:51
4. Why did you choose to add it to default instead of chisel_tree? Makes it more difficult for players to figure out what was added.
to allow add any trees mod easily. you don't need to make functions to register each node, just create your stripped tree.
ThorfinnS wrote:
Sat Dec 05, 2020 10:51
5. Need to make it a function call (API) so other mod's trees can be supported.
You only need to register your stripped trees with this format:

Code: Select all

...
minetest.register_node("mod_name:stripped_trunkname", {
	        description = "Stripped trunk name.",
	        tiles = {
		        "stripped_mod_name_trunkname_top.png",
		        "stripped_mod_name_trunkname_top.png"
		        "stripped_mod_name_trunkname.png"
	        },
	        groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, not_in_creative_inventory = 1},
	        sounds = default.node_sound_wood_defaults(),
	        paramtype2 = "facedir",
	        on_place = minetest.rotate_node,
        })
mod_name = your mod.
trunkname = your trunk.
Is so easy. In the stripped_trees/textures folder you can find a base.png and base_top.png that you can use to make your own stripped textures, you only need to colorize.

If you want add support directly in the stripped_trees mod folder you can see the moretrees.lua, ethereal.lua and just need to replace the mod name and add the textures to the stripped_tree/textures folder. save the file as mod_name.lua and add it to init.lua. but i think is more easy only create the stripped trees in your mod. you don't need to make functions or calls for the stripped tree, this mod adds automaticly any node with the <stripped_> format, so... maybe you would add a

Code: Select all

if minetest.get_modpath("stripped_tree") then
	--register your stripped tree trunks.
End
and add stripped_tree to your optional dependencies, you can register the nodes without that but if you don't have the stripped_tree you can't get the stripped_trees (without the give priv)
Last edited by 1faco on Mon Dec 07, 2020 00:19, edited 1 time in total.

User avatar
1faco
Member
Posts: 84
Joined: Tue Sep 08, 2020 20:32
GitHub: minefaco
In-game: faco

Re: [mod] Stripped tree trunks [stripped_tree]

by 1faco » Post

ThorfinnS wrote:
Sun Dec 06, 2020 16:38
Place torch, assuming there's one in inventory. It's a work in progress one of the students is working on, so there's no code uploaded anywhere yet.

Re: API, I was just suggesting that it be handled like stairs and farming redo and most of the other popular mods do -- the person who creates the new node just calls the function and doesn't require PRs or anything else. Alternatively, it also makes it possible for individual users to make tweak mods for their particular server.

I'll see if I can talk one of the kids into making the textures for [cool_trees] and maybe [moretrees]. I think [add_trees] just uses default nodes, but I can check.
moretrees is already supported. update from contentDB please.

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [mod] Stripped tree trunks [stripped_tree]

by ThorfinnS » Post

I knew it was easy, as we'd already put a beta together for [cool_trees] and some of the unreleased trees one of the students here made. It's actually two steps, though. Register the node, then register the recipe to make planks from stripped. Three, since we use [round_trunks] in most servers.

The update script I use to grab the most recent gits for everything the mods directory must have crashed or something, because I've now run it at least twice since your last git update. Sometimes happens, but usually it's because someone moved his repo. In any event, I must have missed seeing the error message.

Incidentally, going to the repo, I see you've already done exactly what I was suggesting. Well, all except to add the recipe for crafting planks. It could be done with a lot of conditionals to account for the inconsistent naming schemes, but it's probably best to just pass in a third array with the plank_names.

User avatar
LRV
Helper
Posts: 378
Joined: Mon Dec 19, 2016 17:29
GitHub: Mooncarguy
In-game: Mooncarman Mooncarguy

Re: [mod] Stripped tree trunks [stripped_tree]

by LRV » Post

Moved to Mod Releases since this follows the guidelines.
This is a cool signature. :)

User avatar
LRV
Helper
Posts: 378
Joined: Mon Dec 19, 2016 17:29
GitHub: Mooncarguy
In-game: Mooncarman Mooncarguy

Re: [mod] Stripped tree trunks [stripped_tree]

by LRV » Post

Nice mod. I included it in my W.I.P. subgame Mcg Minetest Game.
This is a cool signature. :)

QBSteve
Member
Posts: 19
Joined: Wed Mar 15, 2023 00:00
In-game: QBSteve

Re: [mod] Stripped tree trunks [stripped_tree]

by QBSteve » Post

I would like to see support for the trees in the ebiome mod! :)
Hello! I'm just some random person with an ancient 7 year old potato that is my laptop :)

QBSteve
Member
Posts: 19
Joined: Wed Mar 15, 2023 00:00
In-game: QBSteve

Re: [mod] Stripped tree trunks [stripped_tree]

by QBSteve » Post

I disabled the chisel, but when I try to strip a trunk with an axe, I get this error:

Code: Select all

AsyncErr: Lua: Runtime error from mod 'default' in callback item_OnPlace(): ...test-5.6.1-win64\bin\..\mods\stripped_tree/functions.lua:17: attempt to concatenate global 'node_name' (a nil value)
stack traceback:
	...test-5.6.1-win64\bin\..\mods\stripped_tree/functions.lua:17: in function 'swap_node'
	...test-5.6.1-win64\bin\..\mods\stripped_tree/functions.lua:79: in function <...test-5.6.1-win64\bin\..\mods\stripped_tree/functions.lua:65>
Hello! I'm just some random person with an ancient 7 year old potato that is my laptop :)

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

Re: [mod] Stripped tree trunks [stripped_tree]

by sirrobzeroone » Post

Had a quick look at this and then spotted "HeyITGuyFixIt" had already raised an issue for this and added a note on that issue and then done a patch fix pull request:

https://github.com/HeyITGuyFixIt/stripp ... ee/patch-1

He's actually done 4 patches from what I can tell all 4 fix issues but patch-1 branch would be a good start. download, unzip, copy functions.lua across to existing mods folder.

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests