Thread Tools Display Modes
03-10-11, 08:11 AM   #1
Kayja
A Deviate Faerie Dragon
Join Date: Jan 2009
Posts: 19
Can't get custom threat element working

Trying to write myself a very simple agro bar element, does nothing fancy as it's only for me, but I just cannot get it to show the bar. I originally tried using the Hide / Show features which obviously won't work because if I hide it then it kills the updating of it, so I'm trying with SetAlpha instead.

The update should just simply checking if I have a target and that it's not friendly before it'll do anything with the bar.

Thanks in advance if you can provide any assistance. Wasn't sure whether to post this in the LUA/XML Help area or in here, but since it's oUF specific I thought it'd be best here.

[Edit]: Nevermind, all sorted wrote it kinda wrong.

Last edited by Kayja : 03-10-11 at 10:36 AM.
  Reply With Quote
03-13-11, 10:58 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Check out rThreat. Maybe you can find some inspiration there. There are also some oUF threat plugins already.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
03-14-11, 11:40 AM   #3
Kayja
A Deviate Faerie Dragon
Join Date: Jan 2009
Posts: 19
Thanks zork, I will do just that

The problem was that Update from the AddElement didn't seem to fire more than once, I just couldn't get it to keep updating so it just did the update once and that was it, so when I entered combat the bar didn't appear. I had to add an OnUpdate script to the "Update" function for the element to get it to work, not sure if this is the best way to do that. I've wrote in my todo list that I want to rewrite it again as I'm not happy with it, when I do that I'll use your rThreat for ideas.
  Reply With Quote
03-14-11, 12:52 PM   #4
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
I just skimmed your post before leaving work, and you had edited away the code when I got home, but if I remember correctly:

You didn't register any events, so of course the element wouldn't be called more than a few times through OnShow and PEW.
__________________
「貴方は1人じゃないよ」

Last edited by haste : 03-14-11 at 12:52 PM. Reason: Tired english was more tired than it currently is!
  Reply With Quote
03-14-11, 03:14 PM   #5
Kayja
A Deviate Faerie Dragon
Join Date: Jan 2009
Posts: 19
Ahh, that's makes sense and yes you're right I never registered events and even on my rewritten version I'm not using any and are just pulling threat from UnitDetailedThreatSituation with a low delay OnUpdate which I never liked but it was the only way I got it working. Can't believe I forgot the events! *facepalm*

Thanks for your help, will rewrite it later with threat events.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Can't get custom threat element working


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