• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[Solved] How to use selection circle models to represent range

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,545
Wc3 has some assets available for simple circles/selection circles, namely:

Code:
UI\FeedBack\Target\Target.mdx
UI\FeedBack\TargetPreSelected\TargetPreSelected.mdx
UI\Feedback\selectioncircle\selectioncircle.mdx
UI\Feedback\SelectionCircleEnemy\SelectionCircleEnemy.mdx
UI\Feedback\SelectionCircleHero\SelectionCircleHero.mdx
UI\Feedback\SelectionCircleUnit\selectioncircleUnit.mdx

The sizes of them are odd. How would I use one of them to represent an ability or tower's range?
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,545
It depends on the model because they're not all the same, and have some different properties. "Target.mdx" fades out. "selectioncircle.mdx" does not disappear immediately when destroyed, etc.

When working with "Target.mdx", the model's scale is off from its radius by about a factor of 50. So to represent a circle with radius 200, use a model scale of 200 / 50 = 4.0

Here's some sample code using "Target.mdx" in wurst:

Wurst:
package Example

import UI


init
    // Target.mdx is elevated from the origin by about 50.
    let offset = -50.

    // For a circle with radius 200, use 200 / 50.
    let desiredScale = 200 / 50.

    addEffect(UI.target, ZERO2.withTerrainZ(-50.))..setScale(desiredScale)
 
Last edited:
Top