• 0

    posted a message on Issues Associating Guardians With Players
    Quote from egingell
    How does your script acquire the guardian's info?

    If they don't count as combat pets, in that partypetN doesn't exist, then you'll have to get it from the tooltip.

    If they do count as combat pets and show up on the party/raid frame, then "partyN" == the owner of "partypetN" and "raidN" == the owner of "raidpetN".

    Edit: If you're talking about enemy's guardians, then you're out of luck.


    I'm talking about guardians, not actual pets. An actual pet is easy, can just (as you said) lookup partyX/raidXpet. Guardians, most of them, show up via a COMBAT_LOG_EVENT_UNFILTERED subevent called SPELL_SUMMON which includes the GUID/name of the guardian and the guid/name of the summoner. Thats not a problem either, the problem is that -some- guardians don't trigger this event, like Ebon Imps for a Warlock's Bane of Doom. I'm looking for a way to track these as well without having to just have my mod say "I dunno, there was a mob here, somebody owns it!".
    Posted in: AddOn HELP!
  • 0

    posted a message on Issues Associating Guardians With Players
    I've been working on a mod that needs to track who guardian pets belong to. For most guardians, this is easily done by the SPELL_SUMMON event, but some don't trigger this and i'm at a loss as to how to work out whose they are.

    For the player themselves I can use the UnitFlags, but thats useless for working out other peoples, my question if anyone knows is, how do I work out what guardian belongs to who if its not mine and doesn't trigger SPELL_SUMMON? (preferably without requiring communication with other clients)

    * For reference, i'm using Ebon Imps (summoned by a Warlock's Bane of Doom) which don't trigger the event.
    Posted in: AddOn HELP!
  • 0

    posted a message on Finding What Zone I'm In (ID Based?)
    Quote from kagaro
    GetCurrentMapAreaId()

    Is locale independent map id. Wow head uses it's own numbering system


    Any idea if theres a formulaic conversion between WoWHead and GetCurrentMapAreaID()?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Finding What Zone I'm In (ID Based?)
    Is there anyway to find out what zone (instance) your in, preferably via a non-localized ID, that doesn't involve visiting every zone manually and noting it down?

    My first though was to use WowHead as it gives each Zone an ID, but I could find no WoWAPI that gave an ID that worked with theirs. Is there a conversion they do somewhere that could be used to match them up and if so, does anyone know where I could find such a code chunk?

    Any help with either of the two questions would be great thanks.

    * For reference, the mod scans the combat log for Boss ID's and I want to pair back the scanning table to only the local zone rather than a large table with every boss ID currently in game.
    Posted in: Lua Code Discussion
  • 0

    posted a message on AceDB Resetting, Help Please
    Quote from Phanx
    As for the mysterious resetting, there may be an actual cause for it in your code, but since you didn't post all of your code, there's no way for anyone but you to look into that. It's also possible that the people reporting "halp my settingz is gone" are failing to mention that WoW crashed or they quit WoW by pressing Alt-F4. If the game client doesn't quit normally, it doesn't go through the "shutdown" process that includes writing saved variables to disk.


    I didn't want to post the whole mod, but if you're willing, the code is downloadable in the mod itself (ShivvAudio on Curse(forge)) though I went through it myself looking for anything that alters things in the .global table and the only things were additions/deltions in the form of self.db.global.mediaDB[var] = {} (or nil).

    Could it be a timing issue with WoW and Ace3 where somethings maybe aren't entirely loaded by the time Mod:OnInitialize() is called, so dumping it down to OnEnable would be beneficial? Or more to the point, is there anything that will go wrong if the db is setup in Enable instead of Init (of course, assuming I don't look at anything til OnEnable which is currently the case anyhow).
    Posted in: Ace3
  • 0

    posted a message on AceDB Resetting, Help Please
    Thanks for all the replies, though it seems like the consensus it "no idea", same as I had before :/

    For the problems in my code, I had actually had global.mediaDB defined in the defaults table but wasn't sure if that was removing it when a new character was used and the defautls used for them, will move it back to where it was as that seems to not be the case.

    As for profiles resetting, am I right in understanding that may mess with something in .global as well as .profile? It shouldn't matter at the moment though because the mod offers no way to change profile, each character gets one (should really be using .char but I left in the profile option so I can add profiling at a later date should people ask for it).

    I've had a few more people get back to me on it as well, it looks like its very intermittant, one friend who is an altoholic was playing for the last 2 days with no issues, but today suddenly the DB was gone and this time ReloadUI did nothing to fix it and i've still yet to have the problem myself.
    Posted in: Ace3
  • 0

    posted a message on AceDB Resetting, Help Please
    Quote from Phanx
    Well, there are two obvious problems, one of which is triggering a Lua syntax error. The Blizzard error tool doesn't show errors that occur early in the loading sequence, such as syntax errors; install BugSack.

    *snip*

    Finally, due to the way upvalues (your "speed references") work, you can use them for writing as well as reading. They both point to the same table object in memory.


    I'm not sure I understand why the code that creates the mediaDB needs to be removed; as I make references to mediaDB quite frequently elsewhere in the code, surely that just moves the creation of it to those locations as you can't reference something in a table without making the table first. As for the syntax error, thats been fixed and the missing eventDB was just because I snipped out a few vars that weren't relevant and caught that one by mistake.
    Posted in: Ace3
  • 0

    posted a message on AceDB Resetting, Help Please
    I've recently finished a mod that uses AceDB-3.0 to store settings. It creates a profile for each character as well as a global DB for, well, global options. However, some people are reporting that all settings get cleared when logging in a different character from the first they used (the SavedVariables .lua file is reset back to base when this happens), but I have been unable to replicate this with a bunch of different login/out combinations so i'm at a loss as to whats wrong. Any help please.

    local defaults = {
    	profile = {
    		-- global options
    		auraEnableTracking = false,
    		vitalEnableHealthTracking = false,
    		vitalEnablePowerTracking = false,
    		gameMusicControl = false,
    		-- aura data
    		auraDB = {},
    		},
    	},
    }
    
    function ShivvAudio:OnInitialize()
    	self.db = LibStub('AceDB-3.0'):New('ShivvAudioDB', defaults)
    	self:RegisterChatCommand('shivv', 'ChatHandler')
    
    	if (not self.db.global.mediaDB) then
    		self.db.global.mediaDB = {}
    	end
    
    	mediaDB, auraDB, eventDB = self.db.global.mediaDB, self.db.profile.auraDB, self.db.profile.eventDB -- local references for speed
    end
    


    * Note: the only time the 3 speed references are, well, referenced is when they are reading data, never modifiying and for the full mod, its ShivvAudio on Curse.

    Any help please, and additionally, while writing this a friend told me doing a ReloadUI sometimes fixes it which would imply to me there was an error on load but no LUA Error message came up for them.
    Posted in: Ace3
  • To post a comment, please or register a new account.