Reply
Thread Tools Display Modes
Unread 04-08-13, 11:14 PM   #1
Aryae21
A Deviate Faerie Dragon
Join Date: Jan 2013
Posts: 18
Question Two Questions: Learning LUA & Custom Animations in game

First and foremost I am well aware that tampering with Blizzards MPQ Files is banable. Blizzard gets very cranky when you mess with them. It's a big no-no I am very aware of and mean absolutely no harm. However... I have recently discovered that we can still use these files.
For example, weakauras provides 3D animations for many of the MPQ files, and its allowed as interface effects, just like a KGPanels texture is, except its from Blizzards own animations. My question is, if I were to make my own animation, from complete scratch, nothing to do with Blizzards files...
Is it possible to still get it in game, as part of an interface, like weak auras does? Id prefer to use weak auras to do it, but I haven't found any sort of method to "load" it in like KGPanels for example.

Second question, I figured I'd toss it in the same post as to not clutter up forms with a billion of my questions. The community on here has been simply, amazing. I want to give back, to learn LUA and contribute as well as be able to help myself not always have to ask for here it. But coding is still foreign to me, I've learned a lot from designing my own interface. But the process is rather... well slow. I figured, the best way to learn was to actually do my own add on. I'm not asking for help, but rather a shove in the right direction. Suppose I'm asking for opinions and anyone's own experience about how they learned LUA? I've been on the internet to search for a "LUA for dummies" But I don't seem to find any concrete book or guide.
Aryae21 is offline   Reply With Quote
Unread 04-09-13, 01:29 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,006
Question 1:
Using in-game models isn't necessarily the same as modding them. You can't, for example, change the model file for your character located in the MPQs to show something else. If you were to create a model file as you suggested and put it in your addon folder to be used in the UI, it's fine as far as policy goes. I don't know if the game would actually load it or not though.



Question 2:
Just as a warning before I start my response. Some people are anal over the correct capitalization. To save you the trouble, it's Lua, not LUA. With that aside, everyone learns differently. I picked up Lua for another project long before WoW started. I learned the language by reading the Official Lua Manual (This link points to the current version WoW uses now, Lua 5.1). You only really need to read chapters 1 and 2. You can use Chapter 5 as a reference for core Lua functions. Chapters 3 and 4 cover embedding the Lua scripting engine into a host C program, something you're not going to be doing at all.

Once you get the hang of understanding Lua, you can try to take a small addon and look at the code for it. Notepad or any other text editor is adequate enough. You may want to get an IDE program later that's practically the same thing, but provides extra features like syntax highlighting for example. Everyone has their own opinion on what's the best, I personally use SciTE.

Another handy resource would be a good reference site to look up different parts of the WoW API that Lua is embedded into. There are a few of them out there and I use WoWPedia.

If you have any more questions, we'll be glad to help you along. Don't be afraid to ask.
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
SDPhantom is offline   Reply With Quote
Unread 04-09-13, 03:57 PM   #3
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,253
Originally Posted by SDPhantom View Post
Once you get the hang of understanding Lua, you can try to take a small addon and look at the code for it.
I'm not sure if you have any experience with any other programming languages or not, but if you're like me, it's probably easiest to just start by opening up a small addon and figuring out how it works. I hate the little random tasks you'll find in most "learn this programming language" guides that teach you the basic concepts but don't actually accomplish anything, like the classic "Hello world" example. I'm much happer diving into something that actually does something, even if it's confusing at first.

By "small addon", look for something in the 10-30 lines of code ballpark.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, 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!
Phanx is offline   Reply With Quote
Unread 04-10-13, 11:28 AM   #4
Aryae21
A Deviate Faerie Dragon
Join Date: Jan 2013
Posts: 18
1. Hmm... I'm certain there is some way to get animated textures in game... I've seen sexy map use it, though majority are from the MPQ files. Zorks UI I'm fairly certain is a custom on his Mini-map. Weakaruas has paths for the models it uses, I've tried adjusting it to test one that is on my desktop but all I got was the unloaded blue box.

2. Thank you for the correction SDPhantom, I'm a bit nick picky on my spelling/grammar. Always try to keep it accurate. I've already printed out the website and downloaded the program, I know enough about Lua to know that the colored syntax is very helpful. Phanx you hit it right on the target, I really dislike guides like that and it was all I really found while Google searching, that's why I decided to ask. I don't have experience coding anything else other then Lua, and that's just from working with other addons like KGpanels etc. I already chose an Addon to tinker with, HFLootRoll. I used back in wrath and loved, but its long been abandoned it seems, maybe get permission from the original author and might even be able to maintain it myself. But I'm getting ahead of myself, have to learn Lua first.
Aryae21 is offline   Reply With Quote
Unread 04-10-13, 03:57 PM   #5
Phanx
A Pyroguard Emberseer
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 4,253
Originally Posted by Aryae21 View Post
... I've tried adjusting it to test one that is on my desktop but all I got was the unloaded blue box.
WoW can't see anything outside of its program directory, and I'm not sure if it can see custom files (eg. not files with the same name/path as files from the MPQs) outside of the Interface\AddOns file.

Try putting your custom model in your addon's folder:

World of Warcraft > Interface > AddOns > MyAddOn > model.file

Then reference it in-game using a path relative to the program folder:

Interface\AddOns\MyAddOn\model.file

Also, most "animated textures" you see in-game are not actually animated like a GIF image file or a movie file. They're just clever use of size, opacity, and rotation transitions to create simple pulsing or shining effects.

Textures that are actually animated (eg. the eye icon on the LFG minimap button while you're queued) are done using sprites -- one image file contains 20 or so "frames" for the animation, laid out in a grid, and a script changes which part of the image is shown on the in-game object several every 1/10th ofa second or so.
__________________
Author/maintainer of Grid, PhanxChat, ShieldsUp, 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!
Phanx is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Two Questions: Learning LUA & Custom Animations in game

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