- Joined
- Apr 17, 2017
- Messages
- 316
This tutorial will cover the basics of adding a model to your UI and fix model related issues like black and white models.
Tools you need:
This how our SPRITE looks like in-game:
This issue happens because of two things:
Then open your mdl file on Notepad++. Then edit these:
To this:
You can change Teamcolor00 and TeamGlow00 to 01(up to 23 I guess). These will change your model's color and glow. Now we need to change the shading options. To do that you need to find Materials Layer and change these:
Note= without setting the layer as unshaded, our model will have black and white parts attached to that layer. So we change it like this:
Now import the file to your map and change
to your imported model path.
Now our model should look like this:
For those that want the model to be rotated. You can use Oinkerwinkle's Geoset Translation Tool to rotate the model.
Tools you need:
- Retera's Model Studio:Retera's Model Studio
- OinkerWinkle's Geoset Translator(optional):Oinkerwinkle's MDL Toolkit - Wc3C.net
- Notepad++:Downloads | Notepad++
JASS:
library uitest initializer init
function init takes nothing returns nothing
local framehandle gameUI = BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0) //This is our default Origin Frame, we will use it to create our model frame on top of it.
local framehandle model = BlzCreateFrameByType("SPRITE", "model", gameUI, "", 0) //This is how you define a frame as a sprite. If you don't have TOC files loaded, you have to use this to create SPRITE.
call BlzFrameSetAbsPoint(model, FRAMEPOINT_CENTER, 0.4, 0.3) //Positioning our SPRITE frame
call BlzFrameSetSize(model, 0.001, 0.001) //For in-game models, size is mostly dependant on the size of the model, since in-game models are too big for our frames, we need to reduce its size to fit it into screen otherwise you will get wierd screen blackouts.
call BlzFrameSetScale(model, 0.001) //We need to reduce our model size.
call BlzFrameSetModel(model, "units\\human\\HeroPaladin\\HeroPaladin.mdx", 0) //This is pretty self explanatory. 0 here is the animation index that you want to use.For most models, 0 is for stand, 1 is for death animations.
endfunction
endlibrary
- It happens due to shading
- It happens because your models uses things like HeroGlow and TeamColor in Textures Layer.
Then open your mdl file on Notepad++. Then edit these:
Note= without setting the layer as unshaded, our model will have black and white parts attached to that layer. So we change it like this:
JASS:
call BlzFrameSetModel(model, "units\\human\\HeroPaladin\\HeroPaladin.mdx", 0)
Now our model should look like this:
Last edited: