-
-
Notifications
You must be signed in to change notification settings - Fork 452
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 a way to use the "underwater camera effect" #1297
Comments
Sounds reasonable. Do you have any suggestion for the API in case it's not obvious from how this would be implemented? |
I wouldn't known. However I think that the intesity of the effect can be changed because it appears to be stronger the further down you go. |
Shared functions: -- Server
setUnderwaterEffectEnabled(element thePlayer, bool state)
setUnderwaterEffectStrength(element thePlayer, int strength) -- strength: 0-255
-- Client
setUnderwaterEffectEnabled(bool state)
setUnderwaterEffectStrength(int strength) -- strength: 0-255 If the underwater effect is disabled using |
What if we just let |
I agree. I think we should also add a new function There is an |
Would this work? (untested) -- Client side only
function isPlayerUnderwater(p)
if not p.inWater then
return false
end
local level = getWaterLevel(p.position)
if not level then
return false -- not close enough to the player
end
return p.position.z < level
end |
Further to my last message, we can't simply let Scenario: Player is out of the water, you set the strength to |
@qaisjp I'd imagine it'd be based on the player's camera being under the water, rather than the player itself. (aside from that it seems like it should work) However come to think of it, your solution does satisfy the function name (isPlayerUnderwater) - so maybe we'd need two functions? (it could be useful to have these built into MTA and allow them to be shared between client and server). |
Ok lets discuss this on the other issue, there's more edge cases than I realised |
The screen also gets dark when the camera moves under water, if we add "setUnderwaterEffectEnabled" we should add this parameter aswell, not just the screen distortion. |
If that's the case we would add the parameters to setUnderwaterEffectStrength(int distortionStrength, int darkenStrength) --all values 0-255 |
Is your feature request related to a problem? Please describe.
It appears to be impossible to generate this effect without shaders or being underwater, and I think it would be a nice simple addition, and it's probably less consuming for the client.
Describe the solution you'd like
Create a function that would disable or enable this effect.
Describe alternatives you've considered
None, the real alternative is to use shaders.
Additional context
What I am talking about (you can see this effect if you get underwater):
Also I'm not entirely sure if this isn't really added to MTA, but I can't find any documentation on the wiki.
The text was updated successfully, but these errors were encountered: