Jump to content

[OCEAN] How to figure out if tile is an ocean?


Recommended Posts

The quiestion is actually more complex.

I am making a mod that allows you to move objects attaching them to mouse cursor. But I don't want players to be able to throw objects into ocean. Mainly because I can't figure out to make items on water play their floating animation. (Second problem is - drowning enemies is just too easy.)

Is it possible to detect those invisible walls that separate ocean and island? (So I can force drop grabbed object before it goes into ocean). 

I want to prevent this:

image.thumb.png.83580b91ceafef391031249e46755fa5.png

Link to comment
Share on other sites

18 hours ago, Serpens said:

usually you simply use functions from within components/map.lua , there you have for example:
Map:IsAboveGroundAtPoint(x, y, z, allow_water)

You call it with
TheWorld.Map:IsAboveGroundAtPoint(x, y, z, allow_water)

Good thanks!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...