WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   White model texture help (https://www.wowinterface.com/forums/showthread.php?t=55815)

Maaggel 10-21-17 09:55 AM

White model texture help
 
Hello.

I'm currently making my first WoW Addon.
This addon will show a dialog message like the "Talking head messages" if the Shadow priest weapon Xal'atath whispers you.

This works quite well, and even though I still need to fix some issues, and add some config options, I'm getting there.

Now, the problem is that I'm displaying a 3D model of the weapon - but since it has several textures, it's shown as a white model.

I hope someone can help me with this.
Here's the cde for showing the model:

local modelFrame = CreateFrame("Frame", nil, UIParent)
modelFrame:SetPoint("Center", - 580, 300)
modelFrame:SetWidth(200)
modelFrame:SetHeight(200)
modelFrame:SetAlpha(0)

local model = CreateFrame("PlayerModel", nil, modelFrame)
model:SetModel("item\\objectcomponents\\weapon\\knife_1h_artifactcthun_d_01.m2")
model:SetAlpha(1)
model:SetRotation(1)
model:SetAllPoints(modelFrame)
model:SetCustomCamera(1)

//Maaggel

Vrul 10-21-17 02:38 PM

This may work for you:
Code:

local modelFrame = CreateFrame("Frame", nil, UIParent)
modelFrame:SetPoint("Center", - 580, 300)
modelFrame:SetSize(200, 200)

local model = CreateFrame("DressUpModel", nil, modelFrame)
model:SetAllPoints()
model:SetItem(128827)
model:SetRotation(math.pi / 2)


Maaggel 10-21-17 03:27 PM

Quote:

Originally Posted by Vrul (Post 325615)
This may work for you:
Code:

local modelFrame = CreateFrame("Frame", nil, UIParent)
modelFrame:SetPoint("Center", - 580, 300)
modelFrame:SetSize(200, 200)

local model = CreateFrame("DressUpModel", nil, modelFrame)
model:SetAllPoints()
model:SetItem(128827)
model:SetRotation(math.pi / 2)


It works perfectly :D
Thank you so much!..

Where do you get the item id from?
I'm planning on making this work for all the Artifact weapons that whisper you - and perhaps the whispers from raid bosses.

//Maaggel

Kkthnx 10-21-17 03:47 PM

Quote:

Originally Posted by Maaggel (Post 325617)
It works perfectly :D
Thank you so much!..

Where do you get the item id from?
I'm planning on making this work for all the Artifact weapons that whisper you - and perhaps the whispers from raid bosses.

//Maaggel

http://www.wowhead.com/item=128827/x...e-black-empire

item=128827

Wowhead is an amazing place to look ID/Names up. :cool:

Also here is the list of live artifact weapons.
http://www.wowhead.com/artifact-rarity-weapons

Maaggel 10-21-17 04:17 PM

Quote:

Originally Posted by Kkthnx (Post 325619)
http://www.wowhead.com/item=128827/x...e-black-empire

item=128827

Wowhead is an amazing place to look ID/Names up. :cool:

Also here is the list of live artifact weapons.
http://www.wowhead.com/artifact-rarity-weapons

Ah, nice.
But i guess it's not possible to get the other appearances and skins of the artifact weapons then?

I see I can find the item id by using:
GetInventoryItemID("player", GetInventorySlotInfo("MainHandSlot"))

This should make it quite alot easier for adding the other weapons :)

And than you for the great help :)

//Maaggel

Ammako 10-22-17 12:12 AM

Last I heard WoW api is a little bit weird when it comes to artifact appearances, and addons couldn't properly access them.
Correct me if I'm wrong and that has changed recently, but I know MogIt couldn't properly support alternate artifact skins/appearances precisely because of that.

Maaggel 10-23-17 02:24 AM

1 Attachment(s)
Quote:

Originally Posted by Ammako (Post 325621)
Last I heard WoW api is a little bit weird when it comes to artifact appearances, and addons couldn't properly access them.
Correct me if I'm wrong and that has changed recently, but I know MogIt couldn't properly support alternate artifact skins/appearances precisely because of that.

Hmm, that makes sense.
The artifact weapons does work in a slightly different way than the usual things, so guess I'll just stick with the base skin and model for the dialogue.
Perhaps I'll add an image version instead that I can then switch depending on the artifact weapon configuration.

But thank you very much for the help :)
Now all I need to add is:
- Config options and a mover on "/sw move" command
- Close button
- Blurry background like the current talking head dialogue.

If anyone got any hints for what the "Talking head dialogue" background texture path is, or how I make a mover, please do tell :)

You can see an attached image of the addon as it is right now.

Ammako 10-23-17 11:37 AM

Interface/QuestFrame/TalkingHeads.blp

How it is used:
https://www.townlong-yak.com/framexm...sInfo.lua#3602
https://www.townlong-yak.com/framexm...gHeadUI.xml#58

I don't know how it would be done in pure lua, sorry. I don't know xml so I can't help with it.


This addon has really nice and understandable code for config options that you can probably take inspiration from:
https://mods.curse.com/addons/wow/work_complete


For the mover:
https://wow.gamepedia.com/Making_draggable_frames


Close button I can't directly help with, but you can probably look around at other addons that re-use the default Blizzard close button. I know Classic Quest Log uses it, but it does it in xml/lua. If you're comfortable with xml you can probably check that. Otherwise surely there's a pure lua addon out there with a close button you can look at. ;p

jeffy162 10-23-17 02:49 PM

You can do an addon in strictly Lua. BUT, XML comes in handy when defining templates for the frames (IF I understand it correctly). It doesn't seem to be that difficult to read XML, but writing it could be something else.

I don't, personally, write either one of those languages. I know what it says under my avatar, but the plug-ins that I "wrote" are, really, just copy-n-paste work. The graphics were the tough part (and they are simple graphics). :o

Fizzlemizz 10-23-17 03:12 PM

Code:

local close = CreateFrame("Button", "$parentCloseButton", parentframe, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT")

Edit: It will close(hide) the frame provided as parentframe.

Maaggel 10-24-17 02:03 PM

2 Attachment(s)
Quote:

Originally Posted by Ammako (Post 325635)
Interface/QuestFrame/TalkingHeads.blp

How it is used:
https://www.townlong-yak.com/framexm...sInfo.lua#3602
https://www.townlong-yak.com/framexm...gHeadUI.xml#58

I don't know how it would be done in pure lua, sorry. I don't know xml so I can't help with it.


This addon has really nice and understandable code for config options that you can probably take inspiration from:
https://mods.curse.com/addons/wow/work_complete


For the mover:
https://wow.gamepedia.com/Making_draggable_frames


Close button I can't directly help with, but you can probably look around at other addons that re-use the default Blizzard close button. I know Classic Quest Log uses it, but it does it in xml/lua. If you're comfortable with xml you can probably check that. Otherwise surely there's a pure lua addon out there with a close button you can look at. ;p

This is great!
I found the textures I needed, and I've migrated all frames to the XML structure instead of doing it in LUA :)
I havn't added the mover yet, but that will be the next thing I'll do :p





Quote:

Originally Posted by jeffy162 (Post 325637)
You can do an addon in strictly Lua. BUT, XML comes in handy when defining templates for the frames (IF I understand it correctly). It doesn't seem to be that difficult to read XML, but writing it could be something else.

I don't, personally, write either one of those languages. I know what it says under my avatar, but the plug-ins that I "wrote" are, really, just copy-n-paste work. The graphics were the tough part (and they are simple graphics). :o

I work as a lead developer, so getting to know this XML structure and LUA have proven to be fairly simple - but all the references etc. are whats holding my project back! So this is great :) Thank you.





Quote:

Originally Posted by Fizzlemizz (Post 325638)
Code:

local close = CreateFrame("Button", "$parentCloseButton", parentframe, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT")

Edit: It will close(hide) the frame provided as parentframe.

Nice :) I've added a "Close" button now, and took inspiration in your example, combined with some XML!

You can see the new version attached here :D
I've attached an actual example of Xal'atath whispering me aswell

Again, thank you guys so much for the help! I'm fairly close to the first version that I'm gonna release :)

jeffy162 10-24-17 05:00 PM

You're welcome, I'm sure. Glad to help (even if it's an infinitesimally small amount of help :o).

One thing - it's "Lua", not "LUA". It is a Portuguese word, not an anagram, which means "moon".

Sorry, but, that sets my teeth on edge.

Ammako 10-24-17 05:55 PM

Nice, glad you were able to figure it all out just from reading Blizzard's code, without needing more help understanding the code :p 'cause I wouldn't have been able to, haha.


All times are GMT -6. The time now is 03:19 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI