Invalid arg type (real)

hgkjfhfdsj

Active Member
Reaction score
55
JASS:
//globals
//  array unit udg_F__U
//  array integer udg_F__T
//  array real udg_F__D
//  array real udg_F__A = 255.
//  integer udg_Total
//  timer udg_Timer
//endglobals

function fading takes nothing returns nothing
    local integer i = 0
    local unit get
    local integer ticks
    local integer alpha
    local integer delta
    local integer q = udg_Total
    loop
        exitwhen i == q
        set get = udg_F__U<i> 
        if ticks &gt; 0 then
            set udg_F__A<i> = udg_F__A<i> - udg_F__D<i>
            set udg_F__T<i> = udg_F__T<i> - 1
            call SetUnitVertexColor( get, 100, 100, 100, udg_F__A<i>)
            
            set i = i + 1 
        else
        
        set q = q - 1
        set udg_F__U<i> = udg_F__U[q]
        set udg_F__A<i> = udg_F__A[q]
        set udg_F__T<i> = udg_F__T[q]
        set udg_F__D<i> = udg_F__D[q] 
        set udg_Total = q
        call RemoveUnit(get)
        endif
    endloop
    if q == 0 then
        call PauseTimer(udg_Timer) 
    endif
endfunction

function CreateFadeUnit takes unit u, real x, real y, real duration returns nothing 
    local integer ticks = R2I(duration/0.03125)
    local integer i = udg_Total
    set udg_F__U<i> = CreateUnit(Player(15), GetUnitTypeId(u) , x, y, GetUnitFacing(u)) 
    call UnitAddAbility(udg_F__U<i>, &#039;Aloc&#039;)
    call SetUnitAnimation(udg_F__U<i>, &quot;attack&quot;)
    set udg_F__T<i> = ticks
    set udg_F__D<i> = I2R(255/ticks)

    if i == 0 then 
        call TimerStart(udg_Timer, 0.03125, false, function fading)
    endif
    set udg_Total  = i + 1
endfunction

//===========================================================================
function InitTrig_Fade takes nothing returns nothing
    set udg_Timer = CreateTimer()
endfunction
</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>


problem
i seem to get that error on line set i = i + 1..
am i missing any codes to show?
what the code does
- one timer fade>periodically reduce transparency of a unit
 

saw792

Is known to say things. That is all.
Reaction score
280
It's actually the line above:
JASS:
call SetUnitVertexColor( get, 100, 100, 100, udg_F__A<i>)</i>
udg_F__A is a real array. The alpha value must be an integer.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top