View Single Post
04/30/20, 02:37 AM   #8
EscherechiaColi
Join Date: Apr 2020
Posts: 9
First error message:
Code:
user:/AddOns/RemiCustomAddon/RemiCustomAddon.lua:12: attempt to index a nil value /* <== this line is: RemiCustomAddonIndicator:ClearAnchors() */
stack traceback:
user:/AddOns/RemiCustomAddon/RemiCustomAddon.lua:12: in function 'RemiCustomAddon:RestorePositionBagSpace'
user:/AddOns/RemiCustomAddon/RemiCustomAddon.lua:34: in function 'RemiCustomAddon:Initialize'
user:/AddOns/RemiCustomAddon/RemiCustomAddon.lua:77: in function 'RemiCustomAddon.OnAddOnLoaded'
Second error message is basically the same but line uh... 43 if I recall correctly (this line)
Code:
        RemiCustomAddonIndicator:SetHidden(false)
Here is the "Bag" portion of the .lua file:
Lua Code:
  1. function RemiCustomAddon:RestorePositionBagSpace()
  2.     local leftBagSpace = self.savedVariables.leftBagSpace
  3.     local topBagSpace = self.savedVariables.topBagSpace
  4.    
  5.     RemiCustomAddonIndicator:ClearAnchors()
  6.     RemiCustomAddonIndicator:SetAnchor(TOPLEFT, GuiRoot, TOPLEFT, leftBagSpace, topBagSpace)
  7. end
  8. [...]
  9. function RemiCustomAddon:Initialize()
  10.     self.inCombat = IsUnitInCombat("player");
  11.    
  12.  
  13.     EVENT_MANAGER:RegisterForEvent(self.name, EVENT_PLAYER_COMBAT_STATE, self.OnPlayerCombatState)
  14.     EVENT_MANAGER:RegisterForEvent(self.name, EVENT_GROUPING_TOOLS_READY_CHECK_UPDATED, self.OnLFGReadyCheckState)
  15.     EVENT_MANAGER:RegisterForEvent(self.name, EVENT_PLAYER_ACTIVATED, self.DoesBagHaveSpace)
  16.  
  17.     self.savedVariables = ZO_SavedVars:New("RemiCustomAddonSavedVariables", 1, nil, {})
  18.     self:RestorePositionBagSpace()
  19.     self:RestorePositionFight()
  20. end
  21. [...]
  22. function RemiCustomAddon.DoesBagHaveSpace(eventCode, initial)
  23.     itemSpace = GetNumBagFreeSlots(1)
  24.     if itemSpace < 10 then
  25.         RemiCustomAddonIndicator:SetHidden(false)
  26.    end
  27. end
  28. [...]
  29. function RemiCustomAddon.OnIndicatorMoveStopBagSpace()
  30.     RemiCustomAddon.savedVariables.leftBagSpace = RemiCustomAddonIndicator:GetLeft()
  31.     RemiCustomAddon.savedVariables.topBagSpace = RemiCustomAddonIndicator:GetTop()
  32. end

And finally, here is the addon tbug test that you required:
"tbug: No inspector for 'RemiCustomAddonIndicator' ("nil")

Once again, thank you for your time, and sorry for my replies hours, I currently live in Korea

Last edited by EscherechiaColi : 04/30/20 at 02:39 AM. Reason: Added faulty line for error 1
  Reply With Quote