Skip to content
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

setCameraShakeLevel(0) setting wrong camera shake level #723

Open
Brian9221 opened this issue Dec 3, 2018 · 11 comments
Open

setCameraShakeLevel(0) setting wrong camera shake level #723

Brian9221 opened this issue Dec 3, 2018 · 11 comments
Labels
bug Something isn't working
Milestone

Comments

@Brian9221
Copy link

Describe the bug
When setting setCameraShakeLevel(0) camera will not always stop shaking, instead it will act like if you used setCameraShakeLevel(255).

To reproduce

  1. crun setCameraShakeLevel(255)
  2. crun setCameraShakeLevel(0)
  3. Repeat points 1 and 2 multiple times until when setting camera shake level 0 the camera will start shaking again.
  4. crun getCameraShakeLevel() will return 0 when it's obvious the camera isn't steady, but still shaking.

Expected behaviour
I'm expecting the camera to stop shaking when doing crun setCameraShakeLevel(0)

Version
Executing client-side command: for i, v in pairs(getVersion( )) do outputChatBox(tostring(i)..": "..tostring(v)) end
number: 342
netcode: 474
name: MTA:SA Client
sortable: 1.5.6-9.16068.0
mta: 1.5.6
type: Release
os: Windows
tag: 1.5.6-release-16068
Command executed!

@ArranTuna ArranTuna added the bug Something isn't working label Dec 3, 2018
@Einheit-101
Copy link

I have discovered the same issue a long time ago, i never reported it tho... Thanks.

@Brian9221
Copy link
Author

  • Seems that srun setElementDimension(plr, 1) actually resets the camera to the actual shake level. Works for any other dimension.

  • Player's death seems to cause bugging of the effect most of times.

@Einheit-101
Copy link

I can confirm the player death bugs this very often

@Unde-R
Copy link
Contributor

Unde-R commented Aug 6, 2020

I can't reproduce it, maybe a video or something?

@Patrick2562
Copy link
Member

Patrick2562 commented Aug 6, 2020

I can't reproduce it, maybe a video or something?

I can confirm it, happens really often, next time I record it.

@Patrick2562
Copy link
Member

@Unde-R https://streamable.com/bz3hdr

@Unde-R
Copy link
Contributor

Unde-R commented Aug 6, 2020

Oh well I'll see about it

@Unde-R
Copy link
Contributor

Unde-R commented Aug 7, 2020

@Unde-R https://streamable.com/bz3hdr

how did you manage to get it stuck, so I can test?

@Patrick2562
Copy link
Member

how did you manage to get it stuck, so I can test?

I use this camera-shake as "hunger-effect", when player's character is hungry/thirsty.
The script checks and overwrites it in every 15 seconds, and after a short time gets bugged.

@Unde-R
Copy link
Contributor

Unde-R commented Aug 7, 2020

how did you manage to get it stuck, so I can test?

I use this camera-shake as "hunger-effect", when player's character is hungry/thirsty.
The script checks and overwrites it in every 15 seconds, and after a short time gets bugged.

oh alright, gonna check

Unde-R added a commit to Unde-R/mtasa-blue that referenced this issue Aug 8, 2020
This may fix multitheftauto#723 since it prevents overwritting the drunk level incase entered same value.
Also in addition to what Lpsd said in multitheftauto#1197 I renamed it.
Unde-R added a commit to Unde-R/mtasa-blue that referenced this issue Aug 8, 2020
This may fix multitheftauto#723 since it prevents overwritting the drunk level incase entered same value.
Also in addition to what Lpsd said in multitheftauto#1197 I renamed it.
@RatajVaver
Copy link

RatajVaver commented Jan 10, 2021

It seems that changing dimension resets this effect, so there is a temporary workaround to remove camera shaking:

local currDimension = getElementDimension(localPlayer)
setElementDimension(localPlayer, currDimension+1)
setElementDimension(localPlayer, currDimension)

Unfortunately this is not the ideal solution, since it has some side effects. For example map objects disappear for a sec and also as I found out, some map objects loose its collision for some reason after using this. And I think you might even disappear for other players for a sec (but I haven't tested that).

But yeah, it's something until setCameraShakeLevel gets fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants