Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schematic tree trunks destroy existing nodes #652

Closed
mgl512 opened this issue Aug 27, 2015 · 8 comments
Closed

Schematic tree trunks destroy existing nodes #652

mgl512 opened this issue Aug 27, 2015 · 8 comments

Comments

@mgl512
Copy link

mgl512 commented Aug 27, 2015

Plant some trees on a v7 world to use the "new" growing functions that use schematics. Whatever the tree, its trunk nodes will destroy any existing node. The leaves seem to work though: they always preserved existing nodes in my tests.

@paramat
Copy link
Contributor

paramat commented Aug 27, 2015

Yes this is intentional, schematics have per-node force-place that prevents the trunk being chopped by nearby leaves of other trees, and prevents the leaves removing nearby trunks of other trees. Also somewhat realistic, a trunk will often grow through and destroy most structures.

@mgl512
Copy link
Author

mgl512 commented Aug 27, 2015

I see, thank you. It's realistic between trees and it will make forests look better. But when a tree destroys player nodes, you think it's a bug.

@BetterToAutomateTheWorld

Thank you for reported this point @mgl512


This is an very dangerous feature !

We noticed this bug in MFF and tried to avoid it...
Yes, this is a bug (or a very bad feature idea). Players can now destroy protected homes if they seed sapling near houses, with the default subgame Minetest_game, that's a very bad point !

And... My god... They can destroy unbreakable blocks...

Do you have planned a parameter to "desactivate" this grief helper feature ?

@Lymkwi
Copy link
Contributor

Lymkwi commented Aug 28, 2015

I would also like to add that according to the documentation of minetest.place_schematic and the code used to place those new schematic based trees, it should not be placed forcefully. Take a look at this :

  • minetest.place_schematic(pos, schematic, rotation, replacements, force_placement)
    • [...]
    • force_placement is a boolean indicating whether nodes other than air and
      ignore are replaced by the schematic

And then consider this:

minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, path, 0, nil, false)

Unless the documentation is unclear about it, false would mean there would be no forced replacement of nodes other than air and ignore. Yet, that's what happens, and it can destroy every kind of node, including default:chest_locked for example. (note: I'm not the player who placed them)

Placed locked chests I don't own

Placing a jungle sapling

The chests are destroyed

@paramat
Copy link
Contributor

paramat commented Aug 28, 2015

I will move mgv5/mgv7 sapling growing into lua code instead of 'place schematic', just like mgv6 sapling-grown trees, this way we can have precise control over what is replaced.

@paramat
Copy link
Contributor

paramat commented Aug 29, 2015

Unless the documentation is unclear about it, false would mean there would be no forced replacement of nodes other than air and ignore. Yet, that's what happens, and it can destroy every kind of node,

That flag is a global force-place flag. Within the schematic lua table itself (see https://github.com/paramat/saveschems) there is per-node force-place data, which is currently set to force-place trunk nodes.

Instead of moving trees into lua programs perhaps better to add a 'also build to' node field to 'place schematic' that allows defining the nodes (other than air and ignore) that can be replaced. It would be set to group:water (for swamps) and group:leaves. Such a feature would be useful for other uses of 'place schematic'. I will look into this.

@paramat
Copy link
Contributor

paramat commented Aug 31, 2015

See #659
I started moving the appletree into lua, but recreating a tree schematic in lua is a long complex job i would rather avoid, it's also much slower than 'place schematic' and adds load to the lua server.

@paramat
Copy link
Contributor

paramat commented Sep 1, 2015

Merged 73113f3

@paramat paramat closed this as completed Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants