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

Add swimable property to node #15645

Open
SnoutBug opened this issue Jan 6, 2025 · 5 comments
Open

Add swimable property to node #15645

SnoutBug opened this issue Jan 6, 2025 · 5 comments
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API

Comments

@SnoutBug
Copy link

SnoutBug commented Jan 6, 2025

Problem

Currently nodes support various properties such as

  • climbable
  • walkable
    etc.

Wether you can swim in a node is defined by the liquid type, however.
Something like swimable quicksand is not possible to code with ease. Sand is not a liquid.

Solutions

Add swimable as a property to a node, and detach it from the liquid property.

Alternatives

Using climbable, but this does not behave like swimming

Additional context

No response

@SnoutBug SnoutBug added the Feature request Issues that request the addition or enhancement of a feature label Jan 6, 2025
@grorp
Copy link
Contributor

grorp commented Jan 6, 2025

There already is a liquid_move_physics node definition field.

@SnoutBug
Copy link
Author

SnoutBug commented Jan 6, 2025

If I'm not mistaken, this requires for the node to still be a liquid.
This did not work in minetest game when creating a nodebox and copying the definition from default:water_source.

@SmallJoker
Copy link
Contributor

SmallJoker commented Jan 12, 2025

How about
https://github.com/minetest/minetest/blob/d15214af522387c118010c24c391d785a3985c3f/doc/lua_api.md?plain=1#L9844-L9849
?
Your issue does not state what exactly you'd like to have. I assume it's to slow down the player movement in quicksand, which is what this NodeDef field does.

@grorp
Copy link
Contributor

grorp commented Jan 12, 2025

If I'm not mistaken, this requires for the node to still be a liquid.

See #10810 which decoupled these and introduced the mentioned liquid_move_physics and move_resistance fields. ("Liquid" node is ambiguous, I assume you refer to liquidtype. Nice comment on the same PR: #10810 (comment))

@SnoutBug
Copy link
Author

SnoutBug commented Jan 13, 2025

To answer the usecase:

I originally intended to create a node which behaves like a liquid, e.g. allows for swimming, reduces movement etc. But without it's spreading.

When I originally created this issue, it was not clear to me how to stop liquid spreading, which was solved in #15647.

However: swimming is still coupled to liquidtype = "source" or "flowing". This is what I noticed in my tests anyways.

This is why I suggested that liquid_move_physics is not contributing to my usecase - which is still unclear if it does to be honest.

Can you provide an example how liquid_move_physics works on a node with liquidtype = ""?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API
Projects
None yet
Development

No branches or pull requests

4 participants