New fluid/block triggers

Upvotes: 3
Issue description

Add a option to custom fluids to add a animated or non animated texture overlay that comes up on screen ONLY when the player is COMPLETELY UNDERWATER or submerged in the custom fluid. This happens in the attached image below in a mud fluid i may that should be totally opaque. this needs to be fixed as soon as possible.

 

Attachment Size
2019-04-27_20.16.42.png243.5 KB 243.5 KB

Issue comments

Submitted by Klemen on Mon, 04/29/2019 - 11:47

You can set a global session logic variable when the player collides with the fluid to true, and reset it (set to false) on player tick global trigger so when the player leaves the fluid, the variable gets reset.

Use this procedure as a condition for your overlay.

We have animated overlays on our 2.x.x todo list.

it needs to trigger when the player is completely UNDER WATER not just colidding with the fluid.

Submitted by Klemen on Mon, 04/29/2019 - 13:43

I don't think there is a good way to check for this. One idea would be store first collision coorinates and check if the player is still colliding later and if the players height is now below 2 blocks on y axis compared to the stored state at the first collision time.

that's why it needs to be coded as a optional slot to input a animated texture into the fluid builder due to the difficulty of doing this with procedures since we want the flowing mud texture to show up when the player is completely submerged in the quicksand.

Reopen this klemen, this needs to be hard coded into the fluid editor as a custom slot for a animated texture and a checkbox to enable it if used. this will have to be used to create the overlay due to the difficulty of doing this with procedures since we want the flowing mud texture to show up and ONLY show up when the player is completely submerged in the quicksand. For EXAMPLE: the flowing texture would need to show up if you made a 1 block thick layer of mud and used signs to keep it from running down into a 2 block wide and 2 block deep hole, with the signs on the first layer of the hole and the liquid on the top and the overlay would need to come on the screen if the players head was inside the 1 block thick fluid supported by signs, this would be very hard to do with procedures to make it detect if a player was colliding with it if it was only 1 block thick and signs or some kind of non player colliding block were making a 1 block thick layer of fluid float.

Submitted by Klemen on Tue, 04/30/2019 - 14:43

I might add two new triggers: when player submerged and when out of fluid to make this easier to use.

new triggers for custom fluids should be when player / entity submerged and when player / entity out of fluid