• 0

    posted a message on Phased content and GetPlayerMapPosition()
    Quote from Phanx
    From the changelogs and forum threads of several other addons, I've gotten the impression that coordinates are simply broken once the platform collapses, and that no workaround is available.


    Hmm, that's too bad then. Lichking is a fight where positioning is key in handling the various abilities, this addon would be great for analysing it.

    I'll try the SetMapToCurrentZone thing the next time we're fighting Arthas; if successful, I'll post it in this thread.
    Posted in: Lua Code Discussion
  • 0

    posted a message on Phased content and GetPlayerMapPosition()
    I've written a addon to capture a raid to replay the fight later. This is the result of our 25man Lich King raid yesterday (yay! we killed him!)
    http://www.elysiumraidforce.net/raidreplay/lichking.html
    I took a snapshot every 2 seconds. Frame 20 shows raidicon support and frame 198 shows alive/dead status.

    You'll notice however that the GetPlayerMapPosition() function returned 0,0 when the outer ring broke; leaving the most interesting part of the fight blank. :(
    Not sure if calling SetMapToCurrentZone() would fix that (I assume it is due to phasing) then again; how else would the WoWheadlooter be able to capture coordinates of (the player looting) the LichKing's corpse. It would mean I have to call that function every two seconds (more often if I want to capture the fight in better details).

    Anyone know how phasing of terrain affects the mapposition? (I assume it's phasing that's happening here) How bad would it be to call SetMapToCurrentZone() every second?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Handling large strings
    Quote from jerry
    Lua handles strings as entities that only exists once in the virtual machine. This means that each time a string is introduced in the virtual machine (via concat), lua must first check if that particular string already exists so that it can return a reference to it, and if not found, it must insert the string in its internal table. As the size of the internal table grows, the check takes more time. So you should avoid as much as possible introducing new strings to the VM.


    Yeah, that was what I was thinking- a bit why in .net has a stringbuilder class; new memory is allocated for each new concat.

    I'll rewrite some parts to concat tables of strings.

    One more question: I assume it is better to use
    strValue = string.format("%s:%s",strName,strClass)

    than
    strValue = strName .. ":" .. strClass

    ??
    Posted in: Lua Code Discussion
  • 0

    posted a message on Handling large strings
    I'm working on an addon that stores various data during a raidencounter. At the end of the encounter I popup a large editbox with the data in it (as a JSON string). The data is then imported in my website and the raidencounter is replayed in the browser window.
    When I create the JSON based on the tables, my WoW freezes while manipulating the data. I create the JSON once (as the export data window pops up).

    To eliminate the 'freeze' I was thinking of creating the JSON on the fly; so instead of storing everything is tables I would add the data to a string variable.

    My question is, how is LUA handling string concatenations? Would my addon slow down each time a short section of string data is added?

    I would require a lot of rewriting of my code so I figured to ask here first...

    Here is an example of a test I did in Alterac Valley (56 snapshots):
    http://www.elysiumraidforce.net/raidreplay/alterac.html
    Posted in: Lua Code Discussion
  • 0

    posted a message on Monitor the focus' target
    Thanks for the clarification on comparing units, Adirelle. Your sample code looks very much like the code I wrote (after reading Pigmonkey's comment).
    Posted in: Lua Code Discussion
  • 0

    posted a message on Monitor the focus' target
    Ah, I made the check:

    if(UnitName(arg1)==UnitName("focus"))

    Kinda silly now I think about it...
    Posted in: Lua Code Discussion
  • 0

    posted a message on Monitor the focus' target
    Thanks for the reply.

    I've made a simple test addon that performs the steps above.
    The result is what I want; but multiple times. Suppose I target MobX and I focus MobY. MobX gets killed and I target MobY (so MobY is both my focus and my target). If MobY switches target, the event gets fired twice.
    Is there a way to catch the event only once - or should I store MobY's target and add an extra check against that value?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Monitor the focus' target
    I'm looking to monitor if my focustarget's target changed. So I was looking at "UNIT_TARGET". According to wowwiki:
    Fired when the target of yourself, raid, and party members change: 'target', 'party1target', 'raid1target', etc.. Should also work for 'pet' and 'focus'. This event only fires when the triggering unit is within the player's visual range.

    The reason I want to do this; is I want to know if my focus target has shifted his attention from the main tank to someone in the raid. So I was wondering what is meant by "visual range" is it if you can tabtarget it it is in range or in a circle with X radius around my character or anything else?
    Also I guess that in a raid UNIT_TARGET gets quite spammy, if it monitors all targetswitching?

    I was thinking something along these lines:

    1. When focus is set; store tanklist and register event
    2. Catch event.
    3. Check if unitID in the event equals my focus.
    4. If so, check if unitID's target is not in the stored tanklist.
    5. If so, send message that the attention is shifted to UnitID's target.

    Any thoughts, suggestions?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Addon Authors: Please review your categories
    Somehow in my new project http://www.wowace.com/addons/epgpreserves/ the category "achievements" is always visible on the project page; it is, however, not selected when I edit the project.
    My addon should only have the "guild" category tag.
    Posted in: General Chat
  • 0

    posted a message on Commit failed ("no space left on device")
    I have the same problem (I posted here). Anyone knows what's happening?
    Posted in: Lua Code Discussion
  • 0

    posted a message on Commit failed ("no space left on device")
    I edited some of my addon's code. When trying to commit I get the error as shown in the screenshot. I have uploaded files many times before and it looks like there is something wrong serverside.
    Any ideas?

    edit: the attachment was somehow scaled.
    this is what it says:
    Manline - Commit - TortoiseSVN Failed!

    Modified C:\games\addonsdevelop\epgploot2\mainline\core.lua
    Modified C:\games\addonsdevelop\epgploot2\mainline\epgploot2.toc
    Modified C:\games\addonsdevelop\epgploot2\mainline\epgpcalculations.lua
    Sending content C:\games\addonsdevelop\epgploot2\mainline\core.lua
    Sending content C:\games\addonsdevelop\epgploot2\mainline\epgploot2.toc
    Sending content C:\games\addonsdevelop\epgploot2\mainline\epgpcalculations.lua
    Error Commit failed (details follow):
    Error Can't close file
    Error '/repost/svn/wow/epgploot2/mainline/db/transactions/47-1.txn/node.0.0': No space
    Error left on device
    Finished!

    The operation failed.
    Posted in: Lua Code Discussion
  • 0

    posted a message on catch events fired by another addon
    Thanks for the help. You can slap me with the n00b-stick. After checking the firing function it appears the "awarded" is a table with all the players who received the award.
    I assumed that the "awarded" parameter would contain the instance name (as the three things you can set in EPGP are 'instancename' 'reason' and 'amount'). So much for making assumptions without checking.
    Again, thanks for the help- I learned something valuable here ;)
    Posted in: Lua Code Discussion
  • 0

    posted a message on catch events fired by another addon
    I tried that code Adirelle, but it gives me the same error:

    [FONT=Courier New]EPGPreserves-0.0.1\core.lua:13: attempt to concatenate local 'awarded' (a table value)[/FONT]
    [FONT=Courier New][/FONT]
    I checked the callbackhandler for the relevant code that calls the function but so far it is unclear to my why the extra arguments aren't passed.
    The "table value" seems to imply that the 2nd argument contains a table with the values in it; but getting the values from the table has been unsuccesful so far- the callbackhandler code just seems to pass the arguments along so I'm confused here.
    Posted in: Lua Code Discussion
  • 0

    posted a message on catch events fired by another addon
    Okay, I can catch the event "MassEPAward" but it seem that the arguments are not passed:
     
    callbacks:Fire("MassEPAward", awarded, reason, amount)


    There is only one argument available in my catching function and it contains "LeftMouseButtonClick". So a new mystery for me; how to read the values?
    Posted in: Lua Code Discussion
  • 0

    posted a message on catch events fired by another addon
    Ah, thanks for the clarification!
    So to recap- and to see if I understood correctly...

    The EPGP addon declares a queue for its messages. Code that is interested in these messages can register themselves at that queue (so either the addon itself or a foreign addon). Whenever something is placed in the queue, the queueobject calls all the registered functions (the actual "callback").
    Because the EPGP queue object is a global object I can register my addon's fuction to that queue thus receiving the messages that are placed in it.

    Something like that?
    Posted in: Lua Code Discussion
  • To post a comment, please or register a new account.