Closed Timmy-the-nobody closed 2 years ago
Hello! Thank you for the suggestion!
What do you mean by "water level"?
Hey, you can think of it as a state indicating how immersed an actor is in a volume of water. Like is the actor out of the water? partially in the water? completely in the water? etc..
Ah got it!
For Characters, we have something like that already: https://docs.nanos.world/docs/next/scripting-reference/classes/character#swimmingmodechanged
For actors in general I think I can add an event for entering/leaving water, but I'm not sure if I would like to add an event for "how submerse" the actor is, as this value is not something straight neither sent to servers.
Thanks I didn't knew there was a SwimmingModeChanged
event!
About the third state I think that "only" having in/out states would be more than enough (and lighter, as you said).
But that makes me think of another addition now, it could probably be usefull to be able to enable/disable a character's ability to swim with a method like SetCanSwim
, and separate swimming and submersion into two distinct things ?
Maybe the planned buoyance control methods will be more adapted for this, but this could for exemple allow scripters to make players drown if their inventory is too full, a bit like how SCUM's developers managed it on their game.
Describe the solution you'd like
WaterLevelChanged
events available for all actors classes, returning :New enums for water levels could also be useful if these new events were added:
WaterLevel.NotInWater
= 0WaterLevel.InWater
= 1WaterLevel.UnderWater
= 2Describe alternatives you've considered
This could be done with frequent
Actor:IsInWater()
checks but would require more resources than if events were triggered at the beginning or end of a collision with a water volume.