[protomod] Treecapitator (tree falls down) [treecapitator]

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

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by sirrobzeroone » Post

I'm still slowly working on this, got a bit busy over easter doing garden/yard work, family :).

Currently working on adding damage so when the tree falls on you, you take damage, thought raycast was the way to go there but unless I cast a lot of rays its a little to specific. Anyways need to rework that, at the moment the tree falls on you and more often than not it misses even though the tree smacked you square in the head.

Ground detection is sort of mostly working so the trees dont fall through ground any more...to a point had some issues with near vertical surfaces and subterrainian caves....I think this code might be on git master I need to refresh myself about what I had uploaded and what i kept stashed locally as the codes a bit dodgy.

Also tried to track the bug from Vindelle but I havent had much luck replicating the issue either with a hand or axe, I might have to give it a try on a fresh world.

Vindelle_Pounze
Member
Posts: 26
Joined: Thu Jan 05, 2017 22:06

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by Vindelle_Pounze » Post

Oops. Sorry, I am not online that often and I am just testing lots of mods and stuff from time to time and then keep forgetting about them. As this has been quite some time ago, I can not say for sure what kind of tree (if any specific one) made my minetest crash. I believe, though, that I had some apple and aspen trees in my vicintiy.
Just for the sake of it I just tried again. Vanilla world in Minetest 5.4.1 which was installed via my distribution's repositories and the latest iteration of the mod via git.
This time I can say for sure that I punched an apple tree. Same error message, regardless if I used a tool or not.
Everything works fine in "creative", in "normal" mode it doesn't. Still the same, more than one piece of tree above the one I am trying to dig makes the game crash with the same error message.

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

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by sirrobzeroone » Post

Cool thanks I have an idea what might be causing the issue as I came across something similar when I was trying something unrelated.

I'm just wrapping some other items up then I am going to have another go at this, see if I can get it to a more stable working level.

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by ShadMOrdre » Post

sirrobzeroone,

Sorry I've not responded much as of late.

You previously mentioned you were working on lib_ecology support, and I may or may not have indicated that I've dropped lib_ecology for gal_ecology_plants / gal_ecology_trees. This allowed me add the remaining content from farming, australia, and aotearoa.

All of the trees are in lua table schems, including the mushroom and coral trees. They are all registered as decorations.

So my issue is mainly that even with dependencies in place, I cannot get a tree to "fall over". I am using a standard defined axe, and have tried multiple tree types. I assumed that because you read the registered decorations for anything named "tree", that my registered trees would be found and used. I know I've got to be missing something, just not sure what it is.

I run a heavily modified custom game, GAL. There could be any number of overrides that I've not tracked down, but item_drop code, tool use code, and tree node definition code could be at issue. I just could see where you used anything that could conflict.

Any ideas?

Shad

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

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by sirrobzeroone » Post

Hi ShadMOrdre,
yes if the decoration name is registered as something_tree they should be picked up so it's a bit odd they aren't being recognised, I'll have a dig in the code as well.

I got a bit sidetracked with elepower as I had a bit of a direction change with the game I was working on and need power but not mese type power....I really need to stick to a theme so many unfinished game ideas cluttering up my hdd.

Edit I tried loading gal-lite and although I could get it to open, there was no ground/world just all blue sky, do I need the Gal world files as well. I did pickup that I have default in depends still although removing that didnt seem to help to much as I couldnt get the mod to ouput to debug so somethings a bit wrong still with the mod. I'll keep tinkering as well.

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by ShadMOrdre » Post

sirrobzeroone,

Thanks for the reminder. I'm rethinking how I register decorations in gal_ecology_* mods. Plants and trees aren't necessarily registered with a name, and the .csv data file has always felt more than "unmanageable".

Looking forward to seeing this work.

Shad

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by j0j0n4th4n » Post

I'm playing in 5.6 and the game did crash a few times when cutting a tree with the axe, the error I got is:

Code: Select all

AsyncErr: Lua: Runtime error from mod 'falling_tree_capitator' in callback luaentity_Step(): ..._trees/falling_tree_capitator/i_register_tree_entity.lua:77: attempt to index a nil value
stack traceback:
	..._trees/falling_tree_capitator/i_register_tree_entity.lua:77: in function <..._trees/falling_tree_capitator/i_register_tree_entity.lua:51>
It happened when I try to cut an Aspen tree who was very close to another, to the point their leaves were interwoven together. When I cut the, it fell with all the leaves from both trees, so it may be related to that?
cdb_894a100ddd76

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

Re: [protomod] Treecapitator (tree falls down) [treecapitator]

by sirrobzeroone » Post

j0j0n4th4n wrote:
Mon Aug 01, 2022 16:24
I'm playing in 5.6 and the game did crash a few times when cutting a tree with the axe, the error I got is:

Code: Select all

AsyncErr: Lua: Runtime error from mod 'falling_tree_capitator' in callback luaentity_Step(): ..._trees/falling_tree_capitator/i_register_tree_entity.lua:77: attempt to index a nil value
stack traceback:
	..._trees/falling_tree_capitator/i_register_tree_entity.lua:77: in function <..._trees/falling_tree_capitator/i_register_tree_entity.lua:51>
It happened when I try to cut an Aspen tree who was very close to another, to the point their leaves were interwoven together. When I cut the, it fell with all the leaves from both trees, so it may be related to that?
Looks like my code couldn't find the ground and then my catch for that event failed....which is a little strange. I think I see the issue minetest.find_nodes_in_area_under_air may have returned nil and then that borked up line 77 as the code assumes the variable is a table which it may not be. Can't say I've ever had the above function find nothing before so I'm unsure what happens in that event and api has no info either. I'll make a minor fix on the above assumption and hopefully that will fix the event.

The leaves shouldn't matter normally just ends up stripping leaves from the neighbouring tree :)

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests