lotrointerface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Lua Programming Help (L)

Reply
Thread Tools Display Modes
  #1  
Unread 12-09-2012, 03:55 PM
Mohrrin Mohrrin is offline
The Undefeated
 
Join Date: Dec 2012
Posts: 5
Fervor Pip Intervals

Hello Everyone!

I'm new to writing Lua plugins, and I've undertaken the task of creating a metronome for champions that will allow them to see when they are about to receive a Fervor pip while in fervor stance.

Using resources from lua programmers Falstar and Garan (Fervor pip-bars and a timer, respectively) I have managed to create a plugin that will act as the metronome.

The idea was to start the fervor pip timer the moment you enter combat, and after that count four seconds to designate a pip.

There are 3 bars in my plugin, allowing for four unique states: (No lights, one light, two lights, three lights).

However, something seems to be off with the synchronization, as the metronome works fine, only the state that designates the pip is random per encounter. Sometimes it will fire when there are zero lights, sometimes it will fire when there is one light, etc. During the encounter, though, the pip will reliably fire in that same spot (tested for over three minutes).

Can anyone give me a clue as to why this may be?

I'm using Turbine.Engine.GetGameTime() for the sake of keeping time.

Attached is a zip of the plugin.

Thanks!

--- FYI ---

The current version of this code is an untested attempt to determine if the number of seconds on the clock are retained at the close of combat, and used to determine the next pip at the beginning of the next encounter.
Attached Files
File Type: zip PipClock.zip (6.1 KB, 722 views)

Last edited by Mohrrin : 12-09-2012 at 03:57 PM. Reason: FYI
Reply With Quote
  #2  
Unread 12-09-2012, 10:37 PM
moebius92 moebius92 is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 51
If I were a clever sort of person (and not horribly lazy), I might ask what generates the fervour. And then having asked that, I'd look at the start time of the Champion's Fervour effect, and then use that as the starting point, instead of the start of combat.

That is to say, what I expect happens is, once Champion's Fervour is started, every four seconds, it checks if the champ is in combat, and if they are, it adds a point of fervour.

I'd suspect this, primarily because that's the way I expect Red Haze works - once the Red Haze effect goes actives, every 15 seconds after its start time, it adds another point of fervour. And if you've got one method of generating fervour on a timed interval using an effect... why use something different for the stance?

I'd also suspect this, because I just checked it, and yes, it works the way I thought it does.
Reply With Quote
  #3  
Unread 12-09-2012, 10:44 PM
Mohrrin Mohrrin is offline
The Undefeated
 
Join Date: Dec 2012
Posts: 5
I actually figured that out, also. I think I spent a little more time than necessary, but I eventually arrived to the activation of fervor stance (unfortunately for me, it was the last thing I tried, but I suppose I did learn a lot about how the game works, so that should be useful in the future).

I've been working on gathering empirical data now to find an appropriate constant for the time intervals to display the pips. I think I am almost finished with this plugin, and will post the finished product once it is completed.
Reply With Quote
  #4  
Unread 12-21-2012, 09:17 PM
Mohrrin Mohrrin is offline
The Undefeated
 
Join Date: Dec 2012
Posts: 5
Just posting this so that I can get some feedback on the timer mechanic. Having issues when a player loses focus on the client -- it causes the metronome to get thrown off.
Attached Files
File Type: zip PipClock.zip (6.3 KB, 686 views)
Reply With Quote
  #5  
Unread 12-23-2012, 01:02 AM
moebius92 moebius92 is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Sep 2010
Posts: 51
I should start by noting that between the time I've spent investigating when fervour pips get generated and looking at your code, we're talking about ten minutes tops, and so I am speaking from a position of ignorance...

That said, have you tried getting the start time of the Champion's Fervour effect, and then using the current time to calculate how soon the next pip is going to occur? It should be something like:

(4 - ((Turbine.Engine.GetGameTime() - startTime) % 4))

(Turbine.Engine.GetGameTime() - startTime) will give you the total elapsed time since the effect started. (_ % 4) will give you how far into the current 4 second interval you are, and (4 - _) will give you the amount of time left in the current 4 second interval.

Since it doesn't depend on Update() to keep a timer running, Update() not firing won't affect the code.
Reply With Quote
Reply


Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone know -- Weaver Venom pip UI? jamerslotro Interface Help (L) 2 11-02-2012 10:42 AM
REQ: Fervour/Pip display daimon Interface Requests (L) 2 02-02-2012 11:15 AM
Buffs, fervor pips tweaking possible? Deewe Lua Programming Help (L) 0 01-08-2011 05:40 PM
'Moveable' Fervor/Focus display? grezgorz Interface Requests (L) 0 09-15-2010 04:50 PM
moving the autoattack button and fervor pip meter schizm XML modification help (L) 3 01-11-2008 09:33 AM


All times are GMT -5. The time now is 01:51 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui