EQ2Interface

EQ2Interface (https://www.eq2interface.com/forums/index.php)
-   UI Developer Discussion (https://www.eq2interface.com/forums/forumdisplay.php?f=3)
-   -   Casting Bar Cast Time (https://www.eq2interface.com/forums/showthread.php?t=13222)

IFoundTheLight 08-14-2009 07:12 PM

Casting Bar Cast Time
 
Does anyone know how to get the current cast time since the cast as started of the current cast.

EQAditu 08-15-2009 08:36 PM

Can you rephrase that? I can't really decode what you're asking. You might be able to attach a Location Effector to the casting bar becoming visible and at a certain point calculate a time in seconds based on the relative location and speed of the effector. But I can't wrap my head around what you're asking to say more. :)

dragowulf 08-15-2009 09:51 PM

I think what he's trying to ask is if there is a way to get the cast time in seconds showing the current cast second and the maximum spell cast seconds (e.g. 0.5s/6s).

So to answer your question, no.

EQAditu 08-16-2009 01:16 AM

1 Attachment(s)
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

dragowulf 08-16-2009 02:15 AM

Wow. I honestly didn't think of LocationEffectors, yet I use them all the time for these sort of things.

But yeah it isn't accurate. A 30 sec spell was tripping out between 25-27.


Again a place where EQ2's UI fails.

IFoundTheLight 08-16-2009 03:35 AM

Is there a way to only grab the max length of the spell cast once? set it to a variable and then keep it each time?

and is there a place i can find out more about this scripting feature? commands and format

EQAditu 08-16-2009 04:35 AM

We don't get anything like arrays where we can keep that sort of information easily. We cannot tell what the cast time is before or during a spell cast. We cannot tell if a spell has fully cast or was canceled by the user even if we wanted to store the maximum second value.

The scripting isn't really documented by SoE. We more or less figure things out from each other or trial and error. That being why these sub-forums exist.

dragowulf 08-16-2009 11:59 AM

Quote:

Originally Posted by EQAditu (Post 85278)
We don't get anything like arrays where we can keep that sort of information easily. We cannot tell what the cast time is before or during a spell cast. We cannot tell if a spell has fully cast or was canceled by the user even if we wanted to store the maximum second value.

The scripting isn't really documented by SoE. We more or less figure things out from each other or trial and error. That being why these sub-forums exist.

Well sometimes the casting bar goes invisible before the spell casting is completely finished. It's a bug that's been in since launch.

Since EQ2's UI is such a pain we need a workaround for literally everything we do.

I'll play around with EQAditu's code.

Zonx 08-17-2009 09:50 AM

You could calculate the max time the first time both the prog and effector have updated, store that as a variable on the parent window MaxTime='variableName', and replace the script with one that omits that bit of code.

But due to rounding, early calcs of MaxTime will be less accurate than later calcs.

And cast times for the same ability will often vary through-out a session due to temp haste buffs, so its probably not a good idea to store MaxTime for use in subsequent casts.


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

vBulletin® - Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
© MMOUI