Floating wood node?

Post Reply
petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Floating wood node?

by petra2201 » Post

Any suggestions to make a floating wood node? Like if you threw a piece of wood on some water what would I need to do to make a subtype of wood that would always stay on the top of water. Like if the water level rose or fell it would follow the top of the water.
Last edited by petra2201 on Mon Jul 06, 2015 19:52, edited 1 time in total.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Floating wood node?

by ABJ » Post

You mean like how we throw? Drop or place?

User avatar
Calinou
Moderator
Posts: 3166
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: Floating wood node?

by Calinou » Post

You can use WorldEdit to place floating nodes.
  • Enable all WorldEdit mods (except GUI, you don't need it).
  • Type //1 then //2 while staying at the same location.
  • Type //set default:wood.

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

What I was thinking was making a new type of wood that you could place on water and if the water level rose, the wood node would always stay on top of the water. Like the way the boat behaves.

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

This is it what I had in mind but I'm hoping to expand it to a node type and not just an object.
viewtopic.php?f=9&t=12442&hilit=float+on+water

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: Floating wood node?

by kaeza » Post

You could simply take the "floating" code from the boats mod, and replace the boat model with whatever you want (a full block, some kind of log, etc).
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

Will is be all lua code?

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: Floating wood node?

by kaeza » Post

Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

Cool, ill compare that with the floaty mod I linked to above and see if I can copy it to a wood node.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: Floating wood node?

by Evergreen » Post

You could probably make a "floating" wood node that always moves up to the surface when under water. (and make it move any non water nodes above it upwards as well)
Back from the dead!

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Floating wood node?

by ABJ » Post

That would be funny.
/me floods MrGr8Builder's water bungalow.
:p

EDIT: Easy fountain in teh middle of teh ocean.

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

Well it would let us build huge floating ships that we could build stuff inside of. That's what I'm aiming towards.

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

I teased this out of the float mod, It uses a lua entity, that makes me think I can't apply it to a single node the way I'm thinking. In Minetest when we place two blocks beside each other they are seen as separate entities and unless we mark them as one entity they would all behave and float differently (I think). If you made a large wooden boat wouldn't it fall apart if the front hit water that was flowing in a different direction? Here's the code in case I'm wrong.

Code: Select all

--make it float
	if minetest.get_item_group(node.name, "water") ~= 0 and y == 0 then
		if object:get_luaentity().in_water == false then
			--do sounds and particles for water bounces
			if velocity.y < 0 and velocity.y > -3 then
				minetest.sound_play("soft_splash", {
					pos = {object:getpos()},
					max_hear_distance = 20,
					gain = 0.01,
				})
				minetest.add_particlespawner({
					amount = 10,
					time = 1,
					minpos = {x=realpos.x-1, y=realpos.y, z=realpos.z-1},
					maxpos = {x=realpos.x+1, y=realpos.y, z=realpos.z+1},
					minvel = {x=0, y=0, z=0},
					maxvel = {x=0, y=0, z=0},
					minacc = {x=0, y=0, z=0},
					maxacc = {x=0, y=1, z=0},
					minexptime = 1,
					maxexptime = 1,
					minsize = 1,
					maxsize = 1,
					collisiondetection = false,
					vertical = false,
					texture = "bubble.png",
				})


			elseif velocity.y <= -3 and velocity.y > -10 then
				minetest.sound_play("medium_splash", {
					pos = {object:getpos()},
					max_hear_distance = 20,
					gain = 0.05,
				})
				minetest.add_particlespawner({
					amount = 15,
					time = 1,
					minpos = {x=realpos.x-1, y=realpos.y, z=realpos.z-1},
					maxpos = {x=realpos.x+1, y=realpos.y, z=realpos.z+1},
					minvel = {x=0, y=0, z=0},
					maxvel = {x=0, y=0, z=0},
					minacc = {x=0, y=0, z=0},
					maxacc = {x=0, y=2, z=0},
					minexptime = 1,
					maxexptime = 1,
					minsize = 1,
					maxsize = 1,
					collisiondetection = false,
					vertical = false,
					texture = "bubble.png",
				})

			elseif velocity.y <= -10 then
				minetest.sound_play("big_splash", {
					pos = {object:getpos()},
					max_hear_distance = 20,
					gain = 0.07,
				})
				minetest.add_particlespawner({
					amount = 20,
					time = 0.5,
					minpos = {x=realpos.x-1, y=realpos.y, z=realpos.z-1},
					maxpos = {x=realpos.x+1, y=realpos.y, z=realpos.z+1},
					minvel = {x=0, y=0, z=0},
					maxvel = {x=0, y=0, z=0},
					minacc = {x=0, y=0, z=0},
					maxacc = {x=0, y=3, z=0},
					minexptime = 1,
					maxexptime = 1,
					minsize = 1,
					maxsize = 1,
					collisiondetection = false,
					vertical = false,
					texture = "bubble.png",
				})
			
			end
		end
		object:get_luaentity().in_water = true
		object:setacceleration({x=x,y=4,z=z})
		--slow down boats that fall into water smoothly
		if velocity.y < 0 then
			object:setacceleration({x=x,y=10,z=z})
		end
	end

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Floating wood node?

by ABJ » Post

Boat?
Ohhhhhh this is getting interesting.
I actually at first thought this was actually rather dumb.

User avatar
texmex
Member
Posts: 1752
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Floating wood node?

by texmex » Post

Also looking for this. Perhaps a simpler version that checks for water above a new type of buoyant block, and rises it until water is not above it anymore. I can't program but I've seen the mechanic in other mods such as vines and also the builtin falling.lua feature.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

Fred Brighton
Member
Posts: 28
Joined: Wed Feb 08, 2017 13:52

Re: Floating wood node?

by Fred Brighton » Post

I have just recently gotten on board MineTest. I am 67 years old, retired drafting tech and ex-Norse recreationist, used to making things like armor, chainmail, kilns etc as I love to duplicate old tech. Years ago I built a clinker-built boat in the style of the Norse karfi... basically a small version of the dragon ship. I loved that thing and now that I have moved out of the desert to upstate NY I have lots of lakes and rivers which would have been great for building a bigger one. But I am now disabled with broken back parts and fibronyalgia. So it is I decided that building a dragonship in Minetest would be a fine project. I do a lot of time on the raft exploring my worlds in single player mode... I love the design and build aspects but have no interest in combat, engagement, monsters etc. I use it as a clunky CADD program. I am also a sculptor in ceramics/stone/wood/metals and want to be able to sculpt the wood in such a way as to create credible dragon heads for the prow of the boat, given the chunky nature of the blocks. So, with floating wood knitted together to form ship sides and sculpted heads/tails, we should be able to produce a decent ship.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Floating wood node?

by ABJ » Post

Sculpting blocks? Not needed. You've got a 20 by 20 by 20 mile world - why not just build the ship on a gigantic scale?

User avatar
twoelk
Member
Posts: 1411
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: Floating wood node?

by twoelk » Post

in the "moving attached nodes" section of Vehicle Mods we list: some of these should contain some ideas how to code a collection of attached nodes on water.
The biggest problem would probably be how to handle displacing water nodes.
When you would build some thing bigger that actually swims in the water and not only floats right on top, you would want to replace the water nodes that are under the waterline with nodes of your structure so that you might indeed be able to venture under deck. Once you move your structure the nodes behind you will of course have to turn to water again. So how will you manage that when your ship makes a nice smooth turn with all them in between angles? Sounds like some heavy calculating to me, at least for a voxel based game.

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

Based on the behavior of water I've seen before I'd think that the water would take care of itself. We'd have to use an abm to remove the water. The original mod I linked to the node just always positioned itself on the top of the water. Now that I think about it it would only work to make a flat bottom boat.

ABJ
Member
Posts: 3015
Joined: Sun Jan 18, 2015 13:02
GitHub: ABJ-MV
In-game: ABJ
Location: In Earth orbit, with a perigee of 1048 km and an apogee of 1337 km and an inclination of 69 degrees.

Re: Floating wood node?

by ABJ » Post

turning the ship would cause holes in the floor.

petra2201
Member
Posts: 30
Joined: Fri Jun 05, 2015 14:42

Re: Floating wood node?

by petra2201 » Post

So we'd need deeper oceans and maybe an if block for collision detection with not water nodes?

User avatar
Wuzzy
Member
Posts: 4128
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Floating wood node?

by Wuzzy » Post

Are you looking for something like walkable lily pads from MineClone 2?

For coders who are interested, here is the relevant code section:
http://repo.or.cz/MineClone/MineClone2. ... t.lua#l279

I'm pretty sure this can be turned to floating wooden planks or whatever with little modifications.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
texmex
Member
Posts: 1752
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Floating wood node?

by texmex » Post

texmex wrote:Also looking for this. Perhaps a simpler version that checks for water above a new type of buoyant block, and rises it until water is not above it anymore. I can't program but I've seen the mechanic in other mods such as vines and also the builtin falling.lua feature.
This now exists in the pontoons mod, but the whole featureset is not finished yet.
Last edited by texmex on Wed Mar 08, 2017 14:27, edited 1 time in total.
Mods | Support Mesehub: bc1qluuests9rxmlnvpjrhsnyjg9ucwy6z3r0y3srw

User avatar
Sergey
Member
Posts: 784
Joined: Wed Jan 11, 2017 13:28
Location: Russia

Re: Floating wood node?

by Sergey » Post

Floating wood node?
Sorry for off-topic, but "wood node" reminded me Mr. Woodnote and this.

https://www.youtube.com/watch?v=WhBoR_tgXCI

Mr. Woodnote with saxophone

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests