View Single Post
  #4  
Unread 08-16-2009, 01:16 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

I wouldn't say that's impossible.

Make a Location Effector that takes a while to complete. When the casting bar becomes visible start the effector animating. Based on the speed of the effector and the relative location from the start position calculate how long the animation has been going on. Next take the casting bar's progress and extrapolate the maximum casting time.

Say the start location of the effector element is 0,0 and the destination is 10000,0 with a speed of 1000,0. Take a single frame of on move of the effector's element. If the element's location is 1455,0 and the progress bar's progress is 0.333 we can deduce that we are 1.455s into the cast with a total casting time of 4.37s at completion.

I admit that this is totally reliant on the accuracy of the progress bar and you'll get a different total casting time per frame due to calculation rounding.

Just because I'm someone who doesn't say things without backing it up... here's a modded default casting bar that instead of showing the spell name it shows something like "1.4s of 5.2s"... meaning 1.4 seconds into a 5.2 second cast. Big note... this usable example shows that the data the game gives us isn't accurate enough to correctly calculate the total casting time without some extra code to account for whatever is missing. IE a 10s spell will be calcuated as 10.1-2 and a 30s spell will be calculated as 30.4-5
Attached Files
File Type: xml eq2ui_mainhud_casting.xml (4.4 KB, 676 views)
Reply With Quote