• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 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,554
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,554
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