+ Reply to Thread
Results 1 to 8 of 8

Thread: Missing unit details after|during a combat ress?

  1. #1
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default Missing unit details after|during a combat ress?

    Hi guys, having a slight issue with reading units during a combat ress, I upgraded Super Meter's unit combat detection (well I thought). Everything works as intended with group mode enabled until the client is combat ressed then SM starts a new session due to lost details.

    Short version:

    Code:
    function SuperMeter.Combat(params)
    	if not SuperMeter_enabled then return end
    
    	local session = SuperMeter.Session(false, true)
    	local pet = Inspect.Unit.Lookup("player.pet")
    	local player = Inspect.Unit.Detail("player")
    	local instance = SuperMeter_instance
    	local sessions = SuperMeter.Sessions
    	local filters = SuperMeter.Filters
    	local battle = SuperMeter.Battle
    	local forced = SuperMeter_forced
    	local group = SuperMeter_group
    
    	local combat = false
    
    	if not params then
    		params = {[player.id] = not not player.combat}
    	end
    
    	if not instance and player.zone then
    		local zone = Inspect.Zone.Detail(player.zone)
    		
    		if zone and zone.type == "instance" then
    			SuperMeter_instance = true
    			instance = true
    		end
    		
    		for k,v in pairs (params) do
    			if group and not instance then
    				local unit = Inspect.Unit.Detail(k)
    				if unit and unit.tier == "raid" and not filters.tier[unit.name] then
    					SuperMeter_instance = true
    					instance = true
    				end
    			end
    		end
    	end
    
    	for k,v in pairs (params) do
    		if group and instance or k == player.id or k == pet then
    			battle[k] = not not v
    		end
    	end
    
    	for k,v in pairs (battle) do
    		local unit = Inspect.Unit.Detail(k)
    		if forced or player.combat or unit and unit.combat then
    			combat = true
    		end
    	end
    
    	---- If combat start session etc
    	
    	---- If not combat stop session etc
    end
    SuperMeter.Battle is only deleted on combat false or manual end. So I must be losing unit details, or I missed something?

    After the client has died combat continues as intended, which means I am receiving details.

    I found this issue in GA @ Kyzan. Even in a sliver SM can detect instance status (first part of the code) using unit.tier as I has thought of that, combat would not continue after death other wise. Feel free to copy that if you find that useful in you own addons
    Last edited by Ferather; 09-09-2013 at 06:43 PM.

  2. #2
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Hopefully overcome by using a table builder and allowing for last used data during gaps.

    Edit for the above as a fix:

    Code:
    	for k,v in pairs (params) do
    		if group and instance or k == player.id or k == pet then
    			battle[k] = not not v
    		end
    	end
    
    	for k,v in pairs (battle) do
    		local unit = Inspect.Unit.Detail(k)
    		if forced or unit and unit.combat or unit and v then  ---- Fix Here
    			combat = true
    		end
    	end
    Im now allowing for use of the last input from Event.Unit.Detail.Combat()
    Last edited by Ferather; 09-05-2013 at 04:42 PM.

  3. #3
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Thinking over it this morning and I think I have the reason. Do all units with Inspect.Unit.List() become flagged as partial availability during loading screens?

    If so I could improve Super Meter further preventing issues where a unit has been flagged as partial and ends combat and the battle table does not get updated.

    Code:
    	for k,v in pairs (params) do
    		if group and instance or k == player.id or k == pet then
    			battle[k] = not not v
    		end
    	end
    
    	for k,v in pairs (battle) do
    		local unit = Inspect.Unit.Detail(k)
    		if forced or unit and unit.combat or unit and unit.availability == "partial" and v then  ---- Fix Here
    			combat = true
    		end
    	end

  4. #4
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Looking over this again. It seems even when the client respawns (loading screen) and when the client accepts a battles ress (semi loading screen) the addon environment is uneffected as Super Meter continues parsing with all data intact.

    So now I am wondering why any unit held within Inspect.Units.List() become flagged as partial at all at these points, (If that is what is happening). I could understand the client but not other members or possibly hostile units.

    This seems like an unnecessary addon breaking point.

    When "Instance" and the option "Group" is enabled Super Meter will use all available data for units using: Inspect.Unit.Detail, and building a table using: Event.Unit.Detail.Combat.

    When the client has died I have programmed Super Meter to run : SuperMeter.Combat --(Event.Unit.Detail.Combat) privately every second to check units combat status.

    In both the top two examples and mind control mechanics, where details for even group members cannot be received and Event.Unit.Detail.Combat does not become updated.

    Would it not be easier to change the effect of partial flagging or simply allow full table scanning on units held with Inspect.Unit.List() and simply change the unit.availability value and ofc removal on "none".

    Additionally Inspect.Unit.Castbar(unit) does not function after the "Wing Clipping" phase on Crucia.
    Last edited by Ferather; 09-07-2013 at 06:25 AM.

  5. #5
    Sword of Telara Semele's Avatar
    Join Date
    Mar 2011
    Posts
    872

    Default

    Welcome to my world.

    Why do you think I've such a hard time with KBM?! It's not because I can't code it's because I'm constantly working around inconsistency. That and Lua is a bit backwards in places, and pretends to be fast. When I learned about how a table index works, yeah I wish I could code KBM in C++, so messy.

    I gave up mentioning it because I'm not in with the IRC crowd. Go there, apparently you get told things the rest of us are not privy to.

    Just an FYI, if you ever use it. Death events also get lost during the time a client is dealing with resurrection.
    Last edited by Semele; 09-08-2013 at 02:06 AM.
    Rank 76 Guardian Mage

  6. #6
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Well I knew a very long time ago things where missing, Only recently debugged why.

    I was hoping for a de-restriction in the the API. Which Is why I mentioned it now.

    And yes any unit event or unit inspect will have gaps due to partial flagging during client transition, and can only be overcome by table building up to that point and using previously known data.

    Death MAY be over come with the .overkill member of .Damage as you still have unit name and id for partial units, You would need to dummy fill either caster or target though when data is only partial. Additionally .overkill occurs before .Deatth event if that is any help. The damage event AFAIK doesn't require any unit details except name and ID whereas (educated guess) .Death requires the health detail which cannot be found.
    Last edited by Ferather; 09-08-2013 at 08:39 AM.

  7. #7
    Sword of Telara Semele's Avatar
    Join Date
    Mar 2011
    Posts
    872

    Default

    Indeed, Unit caching is the way to go.

    I use LibSUnit, a library for managing all units and unit events for all my addons. It's original purpose was for Group.Join/Leave events for raids, but it quickly expanded to include various missing events including catching missing death events and raid/group combat states.

    It's in the KBM download if you want to use it. But, if you're like me you'll probably want to write your own.
    Rank 76 Guardian Mage

  8. #8
    Rift Chaser Ferather's Avatar
    Join Date
    Jun 2011
    Posts
    341

    Default

    Ok Semele I did the update, sorry ill pass on all Libs I perfer to make my own codes

    If you find this any use you can use SuperMeter_combat , Its a numerical value indicating the start of combat, false if no combat.

    Effected by the user option "group" - See above, where group members will continue combat.
    Last edited by Ferather; 09-09-2013 at 06:43 PM.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts