Weyrling
New Member
- Reaction score
- 25
This is what I call the following functions with:
^^In GUI, this part works perfectly^^
In a unit group, the following trigger and subsequent function does not remove the sfx:
These are the called functions:
Some assistance would be most appreciated (The +rep kind of appreciation).
Code:
Special Effect - Create a special effect attached to the AttachPoint of TempUnit using SFXString[TempInteger]
Set SFX = (Last created special effect)
Custom script: call SFX(udg_TempUnit,udg_SFX)
In a unit group, the following trigger and subsequent function does not remove the sfx:
Code:
Set TempUnit = (Picked unit)
Custom script: call RemoveSFX(udg_TempUnit)
Code:
function SFX takes unit u, effect e returns nothing
local integer num = 1
local boolean b = false
loop
exitwhen b == true
if ( udg_SFX_Unit[num] == null) then
set udg_SFX_FX[num] = e
set udg_SFX_Unit[num] = u
set b = true
set udg_SFXInt = udg_SFXInt + 1
endif
set num = num + 1
endloop
endfunction
function RemoveSFX takes unit u returns nothing
local integer num = udg_SFXInt
local boolean b = false
loop
exitwhen b == true
if ( udg_SFX_Unit[num] == u) then
call DestroyEffect(udg_SFX_FX[num])
set udg_SFX_Unit[num] = null
set udg_SFX_FX[num] = null
if ( udg_SFXInt == num ) then
set udg_SFXInt = udg_SFXInt - 1
endif
set b = true
endif
set num = num - 1
endloop
endfunction
Some assistance would be most appreciated (The +rep kind of appreciation).