Quantcast Speeding up an animation - WoWInterface
Thread Tools Display Modes
07-31-16, 06:56 AM   #1
natinusala
A Murloc Raider
Join Date: Jul 2016
Posts: 8
Speeding up an animation

Hello,

As of 7.0 the combo points for the rogue are displayed under the player's frame, much like the SP's orbs or the old demonist's shards.

The thing is that the animation is kinda slow and with certain Roll the Bones buffs, I gain combo points faster than the combo point animation shows them. I end up losing some, as I try to gain more CP while being 6/6 (and not seeing it yet).

I would like to create an addon to speed up the animation. I discovered that the animation was defined on this file of the game, and used in this one. The animation name would be "AnimIn" and "AnimOut".

Do you happen to know if it's actually possible for an addon to alter this animation and speed up its duration ? If possible, how ?

Thanks a lot !
  Reply With Quote
07-31-16, 09:37 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
lua Code:
  1. for _, f in pairs(ComboPointPlayerFrame.ComboPoints) do
  2.     for _, g in pairs({ f:GetAnimationGroups() }) do
  3.         for _, a in pairs({ g:GetAnimations() }) do
  4.             a:SetDuration(a:GetDuration() * 0.5)
  5.         end
  6.     end
  7. end
Should, in theory, reduce the animation time by 50%. If you want them even faster, lower the multiplier.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
07-31-16, 12:46 PM   #3
natinusala
A Murloc Raider
Join Date: Jul 2016
Posts: 8
It works well, thanks ! There is however a minor issue with the "Star" effect of the "AnimIn" animation which is supposed to occur after the combo point has been added to the bar ; the Star effect start delay is 0.5 times too long. Would it be a good idea to add this code

Lua Code:
  1. a:SetStartDelay(a:GetStartDelay() * 0.5)

To remove the delay problem ? Obviously assuming that Get and SetStartDelay exists.
  Reply With Quote
07-31-16, 07:39 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Yes, probably. You may also want to handle Get/SetEndDelay. I'm not sure what those return if there's no delay, but you may need to check for that:

lua Code:
  1. a:SetStartDelay((a:GetStartDelay() or 0) * 0.5)
  2. a:SetEndDelay((a:GetEndDelay() or 0) * 0.5)
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
08-01-16, 05:18 AM   #5
natinusala
A Murloc Raider
Join Date: Jul 2016
Posts: 8
It works very well, thanks

Do I have your permission to upload it to Curse, by giving you credit obviously ? It may be useful to someone else
  Reply With Quote
08-02-16, 02:47 AM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Go for it.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Speeding up an animation

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