Hello. I tried to create some simple spell in JASS and faced some weird problem.
Spell summons invisible ghost in target location, ghost becomes visible over 3 seconds and kills everyone around after it becomes 0% transparent. I think i made this MUI, but sometimes if someone uses this skill before last summoned ghost becomes visible it bugs a little. Like becomes invisible two times or does not become visible at all. Here's the code:
Trigger, registers spell use, creates a unit and makes it 100% transparent:
Then *pereodic* trigger:
I know last trigger leaks and does not remove dummy, ill fix that, but now im really curious why transparency bugs sometimes =p
P.S.
WoBt is real
WoBl is location
i and num are integers
u is unit
Spell summons invisible ghost in target location, ghost becomes visible over 3 seconds and kills everyone around after it becomes 0% transparent. I think i made this MUI, but sometimes if someone uses this skill before last summoned ghost becomes visible it bugs a little. Like becomes invisible two times or does not become visible at all. Here's the code:
Trigger, registers spell use, creates a unit and makes it 100% transparent:
JASS:
function Trig_Spell_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A009' ) ) then
return false
endif
return true
endfunction
function Trig_Spell_Actions takes nothing returns nothing
local location l
set l = GetSpellTargetLoc()
set udg_num = ( udg_num + 1 )
call CreateNUnitsAtLoc( 1, 'n001', GetOwningPlayer(GetTriggerUnit()), l, bj_UNIT_FACING )
set udg_u[udg_num] = bj_lastCreatedUnit
set udg_WoBl[udg_num] = l
call SetUnitVertexColorBJ( udg_u[udg_num], 100, 100, 100, 100 )
call RemoveLocation(l)
endfunction
Then *pereodic* trigger:
-
Events
-
Time - Every 0.15 seconds of game time
-
-
Conditions
-
Actions
-
For each (Integer i) from 1 to num, do (Actions)
-
Loop - Actions
-
Custom script: call ghost(udg_i)
-
-
-
JASS:
function ghost takes integer i returns nothing
local unit z
if ( udg_WoBt[i] > 0 ) then
set udg_WoBt[i] = udg_WoBt[i] - 5
call SetUnitVertexColorBJ( udg_u[i], 100, 100, 100, udg_WoBt[i] )
else
call SetUnitAnimation( udg_u[i], "spell" )
call CreateNUnitsAtLoc( 1, 'n000', Player(0), udg_WoBl[i], bj_UNIT_FACING )
set z = bj_lastCreatedUnit
call UnitAddAbility(z, 'A00A')
call IssueImmediateOrder( z, "stomp" )
set udg_WoBl[i] = null
set udg_WoBt[i] = 100
set udg_u[i]= null
endif
endfunction
I know last trigger leaks and does not remove dummy, ill fix that, but now im really curious why transparency bugs sometimes =p
P.S.
WoBt is real
WoBl is location
i and num are integers
u is unit