Thread Tools Display Modes
10-02-20, 06:47 AM   #1
hasnogaems
A Flamescale Wyrmkin
 
hasnogaems's Avatar
Join Date: Apr 2016
Posts: 109
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 .

Last edited by hasnogaems : 10-02-20 at 11:39 AM.
  Reply With Quote
10-02-20, 01:29 PM   #2
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
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
  Reply With Quote
10-03-20, 04:48 AM   #3
hasnogaems
A Flamescale Wyrmkin
 
hasnogaems's Avatar
Join Date: Apr 2016
Posts: 109

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?

Last edited by hasnogaems : 10-03-20 at 04:57 AM.
  Reply With Quote
10-03-20, 05:22 AM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
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.
__________________
  Reply With Quote
10-03-20, 07:11 AM   #5
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
Originally Posted by hasnogaems View Post
Is
Code:
GetCameraZoom()
a real function?

You're using a private server, aren't you
  Reply With Quote
10-03-20, 11:17 AM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by hasnogaems View Post

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.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Camera Zoom script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off