Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

Desblat

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

Recommended Posts

Desblat    476

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

Share this post


Link to post
Share on other sites
Serpens    523

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)

Share this post


Link to post
Share on other sites
Desblat    476
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!

Share this post


Link to post
Share on other sites