WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   Camera Zoom script (https://www.wowinterface.com/forums/showthread.php?t=58245)

hasnogaems 10-02-20 06:47 AM

Camera Zoom script
 
There is setting in char specific config-cache.wtf
SET cameraSavedDistance "14.000398"
How I can change it in game with a script? What script would do the job?
Tried

CVar changed but camera did not reacted at all neither the config-cache.wtf .

Ketho 10-02-20 01:29 PM

If you just want the set the current camera zoom level, can't you just do this
Lua Code:
  1. local function SetCameraZoom(level)
  2.     local zoom = GetCameraZoom()
  3.     local delta = zoom-level
  4.     if delta > 0 then
  5.         CameraZoomIn(delta)
  6.     else
  7.         CameraZoomOut(-delta)
  8.     end
  9. end

hasnogaems 10-03-20 04:48 AM


Here my struggles.

Command suppose to be
Code:

SetCameraZoom()
with number in parentheses?

Also is it enough to just put your code on top form and press run in WowLua or I must create addon files?

Is
Code:

GetCameraZoom()
a real function?

Xrystal 10-03-20 05:22 AM

I've never used WowLua so can't answer that question myself..

As to Camera Functions.. this is wowpedia's page. Short of any Shadowlands additions these should be the functions available within addns for camera work.

https://wow.gamepedia.com/World_of_Warcraft_API#Camera

GetCameraZoom is one of the functions so yes, it is a valid function.

Ketho 10-03-20 07:11 AM

Quote:

Originally Posted by hasnogaems (Post 337004)
Is
Code:

GetCameraZoom()
a real function?


You're using a private server, aren't you :rolleyes:

Seerah 10-03-20 11:17 AM

Quote:

Originally Posted by hasnogaems (Post 337004)

Here my struggles.

Command suppose to be
Code:

SetCameraZoom()
with number in parentheses?

Also is it enough to just put your code on top form and press run in WowLua or I must create addon files?

Is
Code:

GetCameraZoom()
a real function?

You have to run that code in the top half of WowLua in order to create the function before you can try to use the function in the bottom half of WowLua. ;)


All times are GMT -6. The time now is 08:28 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI