• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

is it possible to detect the size of unit in gui trigger?

Status
Not open for further replies.
you are able to change the unit size but not sure about detecting it.

I dont think you can. But you can set pre integer values to sizes they are (that you already made them) and then if you change their size after that during game via trigger you can then store the size your changing them to a int and then use that as a condition checking method.
 
do you mean collision size? thats not possible.

There is a trick using IsUnitInRangeXY that uses an iterative loop to determine the size of a unit's collision based on the boolean values returned at different distances.

no. i mean the model scaling value. the value that makes the model looks bigger or smaller.

Like "vertex" color, there is only a native for setting the value but no function for retrieving it.
 
There is a trick using IsUnitInRangeXY that uses an iterative loop to determine the size of a unit's collision based on the boolean values returned at different distances

does it mean i have to use jass to use that trick?
 
Well I'm sure there is some work-around for GUI, but IsUnitInRangeXY is not available in the GUI (I don't think).

JASS:
function GetUnitCollisionSize takes unit u returns real
    local real r = 200 //max collision size
    local real x = GetUnitX(u)
    local real y = GetUnitY(u)

    loop
        exitwhen (r <= 0) or not IsUnitInRangeXY(u, x+r, y)
        set r = r - 5 //decrements by 5, meaning this will only be 
                      //accurate to 5 units of measurement.
    endloop
    if r < 0 then
        set r = 0
    endif
    return r
endfunction

It would be something like this.
 
If you wanna do a ghetto work around im pretty sure this should work..

you are able to change the unit size but not sure about detecting it.

I dont think you can. But you can set pre integer values to sizes they are (that you already made them) and then if you change their size after that during game via trigger you can then store the size your changing them to a int and then use that as a condition checking method.
 
Status
Not open for further replies.
Back
Top