Thread Tools Display Modes
10-06-18, 07:22 AM   #1
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Show frost mage icicle as part of UI

I want to write addon which will show frost mage icicles around the character (at predetermined positions of the screen). I want them to rotate slowly with some animation (and being 3D, of course). Is it possible with addon API or I should stick with 2D images? How do I find 3D object name for icicle? Will it hurt performance (I don't expect it, there are plenty of 3D objects in the scene and 5 more probably won't make a difference)?
  Reply With Quote
10-06-18, 07:38 AM   #2
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Well, surprisingly I was able to use WeakAuras to find that model. It's spells/cfx_mage_iciclemastery_launchedmissile.m2 and considering that WeakAuras can display it, I should be able too.
  Reply With Quote
10-06-18, 07:39 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
I don't think we are allowed access to the 3D environment. You would have to place textures on the screen (not necessarily around the player but around the centre of the screen and activate them as the number of icicles increase. but seeing as the built in functionality does a smaller version of this over the players head is it just the requirement to make the icicles bigger?
__________________
  Reply With Quote
10-06-18, 09:17 AM   #4
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Originally Posted by Xrystal View Post
I don't think we are allowed access to the 3D environment. You would have to place textures on the screen (not necessarily around the player but around the centre of the screen and activate them as the number of icicles increase. but seeing as the built in functionality does a smaller version of this over the players head is it just the requirement to make the icicles bigger?
I don't meant to place them into 3D world, just on screen. Built-in icicles are nice, but they are hard to watch when you're surrounded by combat stuff. I want something similar, but always visible.
  Reply With Quote
10-06-18, 11:17 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Without looking into it too much I think the Icicles are stored as a buff on your character.

So, I would do the following to turn this into an addon..


1. Set up the texture points around the screen and fill it with the icile image but set the alpha value for the texture to 0 to make it invisible.

2. Monitor the player's buffs for the Icicle Buff and keep a record of how many icicles are available.

3. Cycle through the texture points and turn off/on the icicles you want based on the number available.

It sounds simple but it could be harder than it seems. However, you probably won't be able to turn off Blizzards icicle display so the effect will be repeated .. but while testing this is a bonus as your addon should match the blizzard version.
__________________
  Reply With Quote
10-06-18, 04:30 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
And I think the rotate idea will be possible with animation .. however, I am not sure animation works during combat. So bear that in mind.
__________________
  Reply With Quote
11-10-18, 08:21 AM   #7
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
I have troubles rotating model over Z axe. Here's my code to show icicle:

Code:
local frame = CreateFrame("PlayerModel", "IciclesFrame", nil);
frame:SetAllPoints();
frame:SetModel("spells/cfx_mage_iciclemastery_launchedmissile");
frame:SetFacing(math.pi / 2);
SetFacing method rotates model over Y axe. But I want to rotate it over Z axe as well. I tried to use custom camera, but it doesn't work for me, it errors with message "IciclesFrame is not using a custom camera.". What's interesting is that if I'm using "Creature/Arthaslichking/arthaslichking.m2" model, custom camera seems to work.
  Reply With Quote
11-10-18, 04:36 PM   #8
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
You won't be able to rotate over z axis as that would imply addons can draw in the 3D space. As far as I know textures will only rotate over x <> and y v^ axes.
__________________
  Reply With Quote
11-16-18, 07:15 AM   #9
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Originally Posted by Xrystal View Post
You won't be able to rotate over z axis as that would imply addons can draw in the 3D space. As far as I know textures will only rotate over x <> and y v^ axes.
It's a pity, was expecting to make awesome 3D UI and now I'll have to use a static pictures What's strange is that I can rotate creature models (Arthas or Alextraza) just fine! I don't really see why this icicle is different.
  Reply With Quote
11-16-18, 08:12 AM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by Ethly View Post
It's a pity, was expecting to make awesome 3D UI and now I'll have to use a static pictures What's strange is that I can rotate creature models (Arthas or Alextraza) just fine! I don't really see why this icicle is different.
In that case you want to mimic how you do that. Create a model of the snowflake and use the same code you use to rotate the creature models to rotate the snowflake. But I did think the model rotatation was only in the dressing room image and not in 3D world. But I could be wrong.

Have you looked at the animation functionality to see how you apply the rotations?

This is the rotation part of the Animation notes on wowpedia. None of which references a 3rd dimension.

https://wow.gamepedia.com/Widget_API#Rotation
__________________
  Reply With Quote
11-16-18, 08:22 AM   #11
jeffy162
A Pyroguard Emberseer
 
jeffy162's Avatar
AddOn Author - Click to view addons
Join Date: May 2009
Posts: 2,364
I don't really know, but, it seems to me that you can rotate (or work with) those models like that simply because they are "hard programed" into the game in its' base programming, and it is something that we are not allowed to mess with.

I.E. - We can add graphics to the game (in addons, and such) but we are NOT allowed to mess around with the 3D world. That is a "hands off" area.

By-the-way, not having access to the z-axes has been a"thorn in the side" for anyone working on a mapping addon from the beginning.

In my defense, I must say that I have not been able to play the game for two years now and I don't see any way that I'm ever going to again. But, I've [b][i]TRIED[\I][\B] to stay up with the changes to the game. Although it may not have worked that well.
__________________
Ahhhh, the vagueries of the aging mind. Wait.... What was I saying?


Carbonite <----- GitHub main module (Maps ONLY) download link. The other modules are also available on GitHub.
Carbonite-CLASSIC<----- GitHub link to Carbonite Classic. Thanks to ircdirk for this!

Last edited by jeffy162 : 11-16-18 at 08:41 PM.
  Reply With Quote
11-16-18, 10:30 AM   #12
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Originally Posted by Xrystal View Post
In that case you want to mimic how you do that. Create a model of the snowflake and use the same code you use to rotate the creature models to rotate the snowflake. But I did think the model rotatation was only in the dressing room image and not in 3D world. But I could be wrong.
Are you suggesting to extract model file from game data and somehow add it into my addon as a separate model? I have no idea how to do that, honestly. Never even saw addon with custom 3D model, I thought that addons can only use built-in models.

Originally Posted by Xrystal View Post
Have you looked at the animation functionality to see how you apply the rotations?
Thanks for suggestion, I tried it and it doesn't seem to work. Here's my code:
Code:
local ag = frame:CreateAnimationGroup();
local a = ag:CreateAnimation("Rotation");
a:SetDegrees(60);
a:Play();
Actually there's remark at https://wow.gamepedia.com/API_Animat...reateAnimation "It appears that all animations involving moving a PlayerModel frame will fail silently. Alpha animations are the only animation type which will have any effect on these frames.".

I also tried to create parent frame for model frame and rotate it. It rotated, but model frame inside did not rotate.
  Reply With Quote
11-16-18, 10:58 AM   #13
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Are you suggesting to extract model file from game data and somehow add it into my addon as a separate model? I have no idea how to do that, honestly. Never even saw addon with custom 3D model, I thought that addons can only use built-in models.
That was my understanding as well. So, if the only animation you have successfully done in 3D is with the built in 3D objects then it goes to show that unless addons can use their own 3D objects their 2D objects will only rotate in 2D.

Actually there's remark at https://wow.gamepedia.com/API_Animat...reateAnimation "It appears that all animations involving moving a PlayerModel frame will fail silently. Alpha animations are the only animation type which will have any effect on these frames.".
Yes I saw the comment regarding that but seeing as you are wanting to rotate a non player frame it shouldn't apply. Of course, it could also mean any 3D frame rotation silently fails.

local ag = frame:CreateAnimationGroup();
local a = ag:CreateAnimation("Rotation");
a:SetDegrees(60);
a:Play();
Did this actually do anything ? My understanding is that it would rotate similar to the hands of a clock with a total of 360 degrees to complete the rotation. As in we only have control of the X and Y location with layering ( https://wow.gamepedia.com/Layer ) the only level of 3D like visualness we have with the UI.


If we look at the root of the PlayerModel and look at Model itself it may prove informative.
https://wow.gamepedia.com/Widget_API#Model
It gives the impression you can load your own models as long as they are of the right format.

Has anyone done anything similar that inspired you ? If so, maybe look at how they implemented their magic.


To be honest, I don't think you will better what the game already does with the icicle animation.

If you want to have a permanent display of your icicles I'd settle for the 2D images spaced out at a location that suits your gameplay and activate them when required and within the realms of in combat UI changes. With the built in icicle display doing the 3D animation stuff it already does.



Edit:

Tried playing with the Model frame but with no examples it made for a non successful result.


Edit2:
Tried the following block of code ..
Lua Code:
  1. local model = CreateFrame("Model")
  2. model:SetSize(100,100)
  3. model:SetPoint("CENTER")
  4. model:SetPosition(0,0,0)
  5. model:SetModel("Creature\\Arthaslichking\\arthaslichking.mdx")
  6. --model:SetModel("spells\\cfx_mage_iciclemastery_launchedmissile.mdx")
  7. model:SetLight(true, true, 0,0,1, 1000, 1,1,0)
  8. model:SetFacing(math.pi / 2)
  9. model:SetCamera(1)
  10. model:SetScale(3)
  11. model:SetFogFar(10)
  12. model:SetFogNear(0)

The Arthas model appeared ( black color only ) but the icicle model you provided ( with the mdx extension that they use for backward compatibility ) doesn't display or error. However, there is no rotation function but it is possible that rotation animation in combination with the SetPosition(x,y,z) may work. But this is a moot point if the icicle won't display using this model frame.
__________________

Last edited by Xrystal : 11-16-18 at 12:37 PM.
  Reply With Quote
11-16-18, 01:03 PM   #14
Ethly
A Fallenroot Satyr
Join Date: Mar 2018
Posts: 23
Originally Posted by Xrystal View Post
Did this actually do anything ? My understanding is that it would rotate similar to the hands of a clock with a total of 360 degrees to complete the rotation. As in we only have control of the X and Y location with layering ( https://wow.gamepedia.com/Layer ) the only level of 3D like visualness we have with the UI.
Here's full working code which rotates the outer frame (bgFrame) but not the inner model frame.

Code:
local bgFrame = CreateFrame("Frame", nil, UIParent);
bgFrame:SetPoint("CENTER", 0, 100);
bgFrame:SetWidth(300);
bgFrame:SetHeight(300);
local t = bgFrame:CreateTexture();
t:SetAllPoints();
t:SetColorTexture(0, 0, 0);

local ag = bgFrame:CreateAnimationGroup();
local a = ag:CreateAnimation("Rotation");
a:SetDegrees(90);
a:SetDuration(1);
ag:SetLooping("REPEAT");
ag:Play();

local frame = CreateFrame("PlayerModel", "IciclesFrame", bgFrame);
frame:SetAllPoints();
frame:SetModel("SPELLS\\CFX_Mage_IcicleMastery_LaunchedMissile.m2");
frame:SetFacing(math.pi / 2);
Originally Posted by Xrystal View Post
Has anyone done anything similar that inspired you ? If so, maybe look at how they implemented their magic.
Unfortunately no.


Originally Posted by Xrystal View Post
To be honest, I don't think you will better what the game already does with the icicle animation.

If you want to have a permanent display of your icicles I'd settle for the 2D images spaced out at a location that suits your gameplay and activate them when required and within the realms of in combat UI changes. With the built in icicle display doing the 3D animation stuff it already does.
Built-in icicles are hidden by other in-game objects and kind of hard to see with camera distance. I was going to use static images from the beginning, but using animated 3D icicles would be just more immersive IMO. Yes, they would be somewhat duplicated, but I don't see that as a big issue. Well, may be I'd change my mind with playing
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Show frost mage icicle as part of UI

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