Thread Tools Display Modes
12-30-10, 12:20 PM   #1
Sheae
A Kobold Labourer
Join Date: Dec 2010
Posts: 1
Event lag issue

Hey guys!

I'm somewhat new to addon creation, and I've encountered a little problem. I've reinstalled my windows and currently using default UI, but I've made myself a small unitframe, as the default playerframe is way to far from the actionbars, and as a fury warrior, I have to see my current rage almost every second.

The problem with it, is that I used OnEvent script with UNIT_POWER, and its kinda laggy.
The default playerframe shows my rage decrease as: 7 6 5 4 3 2 1 0.
With the OnEvent script my frame shows it as: ..(zZz)..7..(zZz)..5..(zZz)..3..(zZz)..1
In some cases it even stucks on 1 (when I have 0), until my rage changes again.

I was sure it's not about one more statusbar shown on screen, as it doesn't use as much resource to make it laggy. However, I tried this: I removed everything from the lua (well only made it a comment --[[ ), and what was remeaning is a frame, the OnEvent script, and the handler for it. The handler function printed my current rage to the chatframe, nothin else, and the result was the same: 7..5..3..1..

I've solved the problem by switching to OnUpdate on the frame, but I think it will use too much resource when I will make the whole raidframes with power and health bars.

The questions I'd like to be answered are: what causes the events to be laggy? How can it be solved?
If I use OnUpdate, will it use much more CPU when there will be raidframes using OnUpdate too (instead of OnEvent)?
  Reply With Quote
01-13-11, 03:50 PM   #2
Alternator
A Fallenroot Satyr
 
Alternator's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 20
I don't think there is a way for those events to work differently (i.e. they are always going to be haphazard).

Have you taken a look at how the standard bliz frames that show health/mana are implemented?

Provided you avoid putting in too much activity in your onupdate it isn't actually too problematic (there is also the option of setting up a make shift timer, so that it only updates information perhaps every 200ms for example)
  Reply With Quote
01-14-11, 02:09 AM   #3
sigg
Featured Artist
 
sigg's Avatar
Featured
Join Date: Aug 2008
Posts: 1,251
It is not possible.

The default playerframe use the onupdate script for the power bar.

Cheers
__________________
RDX manager
Sigg
  Reply With Quote
01-14-11, 04:24 AM   #4
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,710
There is no "bug" with it, UNIT_POWER only show ticks, not a static value.
If you want that you'd need to use an OnUpdate script.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Event lag issue


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