Thread Tools Display Modes
05/23/16, 01:18 PM   #1
Jimmon89
 
Jimmon89's Avatar
Join Date: May 2016
Posts: 2
Question Help with automaticly centering camera through chat command

This is what i have so far
Lua Code:
  1. JCC = {}
  2. JCC.name = "CenteredCamera"
  3.  
  4. local CENTER_CAMERA = {
  5.     [SETTING_TYPE_CAMERA] = {
  6.         [CAMERA_SETTING_THIRD_PERSON_HORIZONTAL_POSITION_MULTIPLIER] = 0,
  7.         [CAMERA_SETTING_THIRD_PERSON_HORIZONTAL_OFFSET] = 0,
  8.         [CAMERA_SETTING_THIRD_PERSON_VERTICAL_OFFSET] = 0,
  9.     }
  10. }
  11.  
  12. local function ApplyCustomSettings(settings)
  13.     for system, entry in pairs(settings) do
  14.         for settingId, value in pairs(entry) do
  15.             SetSetting(system, settingId, tostring(value))
  16.         end
  17.     end
  18.     ApplySettings()
  19. end
  20.  
  21. SLASH_COMMANDS["/jcc"] = function (extra)
  22. ApplyCustomSettings(CENTER_CAMERA)
  23. end
I can't for the life of me figure out why it does nothing when it type /jcc in chat with my addon enabled

Last edited by Jimmon89 : 05/23/16 at 01:26 PM. Reason: More Info
  Reply With Quote
05/23/16, 01:47 PM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
The code works fine for me and does what you describe.
Are you sure your addon is loading correctly?
Try to put
Lua Code:
  1. error("this is a test")
in the first line of the file to see if it gets loaded.
If that works, add some debug output to the slash command to see if it is executed.
Lua Code:
  1. SLASH_COMMANDS["/jcc"] = function (extra)
  2. d("before")
  3. ApplyCustomSettings(CENTER_CAMERA)
  4. d("after")
  5. end
  Reply With Quote
05/23/16, 02:13 PM   #3
Jimmon89
 
Jimmon89's Avatar
Join Date: May 2016
Posts: 2
got it working

and of course my lua code works properly, that is, if my addon manifest were properly formatted lol
had the old file listed as the lua file to load instead of my current one
herrr derrr
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Help with automaticly centering camera through chat command


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