hi
i am trying to use lightning effects in my map, from beginning on i had troubles with it , i am useing AddLightning and AddLightningEx
they used to show when the boolean was false
but now i added some more, and they dont show at all
i played around with it alot, when i change the lightning type i get different results
sometimes the boolean doesnt seem to do anything, it sometimes shows when its true and sometimes when its false, its pretty random
i also imported a new LightningData.slk where i made a new custom lightning effect as shown in some tutorials, but i dont think it has todo with it since it bugged before aswell
here is the function in which i create the lightning effects, its the only place i use them
lightning effects are at the top, its called by a timer started in the init
oh and also i replace a lightning in this function, its triggerd by a unit enters region event, this is the lightning effect which doesnt show at the moment
so i duno :S
any ideas?!?!
some all known lightning effect bug which everybody falls for?^^
help plz
i am trying to use lightning effects in my map, from beginning on i had troubles with it , i am useing AddLightning and AddLightningEx
they used to show when the boolean was false
but now i added some more, and they dont show at all
i played around with it alot, when i change the lightning type i get different results
sometimes the boolean doesnt seem to do anything, it sometimes shows when its true and sometimes when its false, its pretty random
i also imported a new LightningData.slk where i made a new custom lightning effect as shown in some tutorials, but i dont think it has todo with it since it bugged before aswell
here is the function in which i create the lightning effects, its the only place i use them
lightning effects are at the top, its called by a timer started in the init
JASS:
function StartTournament takes nothing returns nothing
local integer i = 0
local integer i2 = 0
local integer tempi
local real realx
local real realy
local real maxy = udg_OtteRects[udg_OTTEGROUPS_AMOUNT*4+3]
local real miny = udg_OtteRects[udg_OTTEGROUPS_AMOUNT*4+1]
local real maxx = udg_OtteRects[udg_OTTEGROUPS_AMOUNT*4+2]
local real minx = udg_OtteRects[udg_OTTEGROUPS_AMOUNT*4+0]
local real centerx = (maxx-minx) * 0.5 + minx
local real centery = (maxy-miny) * 0.5 + miny
local real tempr1
local real tempr2
local integer playercount = CountPlayersInForceBJ(udg_AllPlayers)
local integer multiplier = 1
local group tempg = CreateGroup()
local unit fog
local integer TOURSCORES_HEIGHT = 100
local integer TOURSCORES_WIDTH = 150
set udg_TournamentLightning1 = AddLightning( "INIT" , false ,minx+100,miny+100,maxx-100,miny+100)
set udg_TournamentLightning2 = AddLightning( "INIT" , false ,maxx-100,miny+100,maxx-100,maxy-100)
set udg_TournamentLightning3 = AddLightning( "INIT" , false ,maxx-100,maxy-100,minx+100,maxy-100)
set udg_TournamentLightning4 = AddLightning( "INIT" , false ,minx+100,maxy-100,minx+100,miny+100)
set realx = centerx - 500
set realy = centery + (playercount-1) * TOURSCORES_HEIGHT*0.5
set tempi = playercount-1
loop
loop
set tempr1 = realx-TOURSCORES_WIDTH*i
set tempr2 = realy-((TOURSCORES_HEIGHT*multiplier)*i2)
set udg_TourScorePointsX[i*13+i2] = tempr1
set udg_TourScorePointsY[i*13+i2] = tempr2
//set udg_TourScoresLightning[i*13+i2] = AddLightning( "CLA" , false ,tempr1,tempr2,realx-TOURSCORES_WIDTH*(i+1),tempr2+(TOURSCORES_HEIGHT*multiplier*0.5)*((ModuloInteger(i2,2)*2)-1))
set udg_TourScoresTextTag[i*13+i2] = CreateTextTag()
call SetTextTagPos(udg_TourScoresTextTag[i*13+i2],tempr1,tempr2-4,0)
call SetTextTagText(udg_TourScoresTextTag[i*13+i2],"------",0.023)
call SetTextTagColor(udg_TourScoresTextTag[i*13+i2],140,140,140,255)
exitwhen i2 == tempi
set i2=i2+1
endloop
set udg_TourScoresLightning[i*13+i2+1] = null
set udg_TourScoresTextTag[i*13+i2+1] = null
exitwhen tempi == 1
set i=i+1
set i2 = 0
set realy = realy - (TOURSCORES_HEIGHT*(multiplier)*0.5)
set tempi = R2I( ( tempi+1 + ModuloInteger(tempi+1,2) ) / 2 ) - 1
set multiplier = multiplier * 2
endloop
call StopSound( udg_CurrentlyPlayingMusic[i] , false , true )
set udg_CurrentlyPlayingMusic[i] = null
call FogEnable(false)
call FogMaskEnable(false)
set udg_TournamentStarted = true
call ForForce( udg_AllPlayers , function AddEnumToTourWinnerForce )
set udg_OtteOwningPlayer[udg_OTTEGROUPS_AMOUNT] = Player(15)
set udg_OtteOwningPlayer[udg_OTTEGROUPS_AMOUNT-1] = Player(15)
call ForGroup( GetUnitsOfTypeIdAll('h00F') , function UnPowerAllLevers )
set realx = minx+(maxx-minx)*0.5
set realy = miny+(maxy-miny)*0.5
set i = 0
loop
exitwhen udg_SteamTanks[i] == null
set udg_OtteUnitIsInGroup[udg_OtteBooleansIndex[GetUnitUserData(udg_SteamTanks[i])]+udg_OTTEGROUPS_AMOUNT-1] = true
call SetUnitAbilityLevel( udg_SteamTanks[i] , 'A000' , udg_PeasantAbilityLevel[GetPlayerId(GetOwningPlayer(udg_SteamTanks[i]))] )
call GroupAddGroup(udg_Peasants[GetPlayerId(GetOwningPlayer(udg_SteamTanks[i]))],tempg)
loop
set fog = FirstOfGroup(tempg)
exitwhen fog == null
call GroupRemoveUnit(tempg,fog)
call RemoveUnitWrap(GetUnitUserData(fog))
endloop
if( GetPlayerTechCount(GetOwningPlayer(udg_SteamTanks[i]),'R000',true) == 0) then
call SetPlayerTechResearched( GetOwningPlayer(udg_SteamTanks[i]),'R000' ,1 )
endif
set i=i+1
endloop
call ForForce( udg_AllPlayers , function ForAllPlayersAtTourStart )
set udg_ButtonTrigger[0] = CreateTrigger()
call TriggerAddAction( udg_ButtonTrigger[0], function TournamentButton )
set udg_ButtonTrigger[1] = CreateTrigger()
call TriggerAddAction( udg_ButtonTrigger[1], function TournamentButton )
call TriggerRegisterEnterRectSimple( udg_ButtonTrigger[0] , Rect(realx-280,realy-80,realx-120,realy+80) )
call TriggerRegisterEnterRectSimple( udg_ButtonTrigger[1] , Rect(realx+120,realy-80,realx+280,realy+80) )
set udg_TournamentButtons[0] = CreateUnit(Player(15) , 'h00H', realx-200 , realy , 0 )
set udg_TournamentButtons[1] = CreateUnit(Player(15) , 'h00H', realx+200 , realy , 0 )
set udg_TournamentTextTags[2] = CreateTextTag()
call SetTextTagColor( udg_TournamentTextTags[2], 255 , 100 , 100 , 255 )
call SetTextTagPos( udg_TournamentTextTags[2] , realx-50,realy,0)
call SetTextTagText( udg_TournamentTextTags[2] , "VS" , 0.060 )
set udg_TournamentTextTags[0] = CreateTextTag()
call SetTextTagPos( udg_TournamentTextTags[0] , GetUnitX(udg_TournamentButtons[0])-50,GetUnitY(udg_TournamentButtons[0])+100,0)
call SetTextTagText( udg_TournamentTextTags[0] , "" , 0.027 )
set udg_TournamentTextTags[1] = CreateTextTag()
call SetTextTagPos( udg_TournamentTextTags[1] , GetUnitX(udg_TournamentButtons[1])-50,GetUnitY(udg_TournamentButtons[1])+100,0)
call SetTextTagText( udg_TournamentTextTags[1] , "" , 0.027 )
call HideStuff()
set maxy = udg_OtteRects[(udg_OTTEGROUPS_AMOUNT-1)*4+3]
set miny = udg_OtteRects[(udg_OTTEGROUPS_AMOUNT-1)*4+1]
set maxx = udg_OtteRects[(udg_OTTEGROUPS_AMOUNT-1)*4+2]
set minx = udg_OtteRects[(udg_OTTEGROUPS_AMOUNT-1)*4+0]
call CreateForest( minx+100,miny-500, minx-612,maxy+500,192,192,0.9)
call CreateForest( maxx-100,miny-500, maxx+612,maxy+500,192,192,0.9)
call CreateForest( minx+292,maxy-100, maxx-292,maxy+612,192,192,0.9)
call CreateForest( minx+292,miny+100, maxx-292,miny-612,192,192,0.7)
call DestroyGroup(tempg)
set tempg = null
set fog = null
call StartTournamentLobby()
endfunction
oh and also i replace a lightning in this function, its triggerd by a unit enters region event, this is the lightning effect which doesnt show at the moment
JASS:
function TournamentButton takes nothing returns nothing
local integer i
local real angle
local real unitx
local real unity
local boolean fight = false
if( GetUnitTypeId(GetTriggerUnit()) == 'h000' ) then
if( GetTriggeringTrigger() == udg_ButtonTrigger[0] ) then
set unitx = GetUnitX(udg_TournamentButtons[0])
set unity = GetUnitY(udg_TournamentButtons[0])
else
set unitx = GetUnitX(udg_TournamentButtons[1])
set unity = GetUnitY(udg_TournamentButtons[1])
endif
if( IsPlayerInForce( GetOwningPlayer(GetTriggerUnit()) ,udg_TournamentForce ) )then
set i = GetPlayerId(GetOwningPlayer(GetTriggerUnit()))
if( GetTriggeringTrigger() == udg_ButtonTrigger[0] ) then
call SetUnitAnimation( udg_TournamentButtons[0] , "death" )
call SetTextTagColor( udg_TournamentTextTags[0], udg_PlayerColorsRGB[i+0] , udg_PlayerColorsRGB[i+1] , udg_PlayerColorsRGB[i+2] , 255 )
call SetTextTagText( udg_TournamentTextTags[0] , GetPlayerName(Player(i)) , 0.027 )
set udg_TournamentFightingPlayers[0] = GetOwningPlayer(GetTriggerUnit())
call ForceRemovePlayer(udg_TournamentForce,udg_TournamentFightingPlayers[0])
call DisableTrigger(udg_ButtonTrigger[0])
if( udg_TournamentFightingPlayers[1] != null ) then
set fight = true
endif
else
call SetUnitAnimation( udg_TournamentButtons[1] , "death" )
call SetTextTagColor( udg_TournamentTextTags[1], udg_PlayerColorsRGB[i+0] , udg_PlayerColorsRGB[i+1] , udg_PlayerColorsRGB[i+2] , 255 )
call SetTextTagText( udg_TournamentTextTags[1] , GetPlayerName(Player(i)) , 0.027 )
set udg_TournamentFightingPlayers[1] = GetOwningPlayer(GetTriggerUnit())
call ForceRemovePlayer(udg_TournamentForce,udg_TournamentFightingPlayers[1])
call DisableTrigger(udg_ButtonTrigger[1])
if( udg_TournamentFightingPlayers[0] != null ) then
set fight = true
endif
endif
call DestroyLightning(udg_TourScoresLightning[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos])
set udg_TourScoresLightning[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos] = AddLightning("CLA", false , udg_TourScorePointsX[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos] , udg_TourScorePointsY[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos] , udg_TourScorePointsX[(udg_TournamentRoundCount)*13+(udg_TourScoresCurrentPos+ModuloInteger(udg_TourScoresCurrentPos,2))/2] , udg_TourScorePointsY[(udg_TournamentRoundCount)*13+(udg_TourScoresCurrentPos+ModuloInteger(udg_TourScoresCurrentPos,2))/2] )
call SetLightningColor(udg_TourScoresLightning[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos], udg_PlayerColorsRGB[i+0] , udg_PlayerColorsRGB[i+1] , udg_PlayerColorsRGB[i+2] , 255 )
call SetTextTagText(udg_TourScoresTextTag[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos], GetPlayerName(Player(i)) , 0.020 )
call SetTextTagColor(udg_TourScoresTextTag[(udg_TournamentRoundCount-1)*13+udg_TourScoresCurrentPos], udg_PlayerColorsRGB[i+0] , udg_PlayerColorsRGB[i+1] , udg_PlayerColorsRGB[i+2] , 255 )
set udg_TourScoresCurrentPos = udg_TourScoresCurrentPos + 1
if( fight ) then
call ForForce(udg_AllPlayers,function ForAllPlayersAtButtonPush385 )
if( GetOwningPlayer(GetTriggerUnit()) != GetLocalPlayer() ) then
call PanCameraToTimed(unitx,unity,1)
endif
call TriggerSleepAction(1)
if( GetOwningPlayer(GetTriggerUnit()) != GetLocalPlayer() ) then
call SetCameraTargetController( GetTriggerUnit() , 0, 0, false )
endif
call TimerStart(udg_TournamentTimer,5,false,function AfterTournamentButton)
endif
else
set angle = GetRandomReal(0,360)
set udg_xVelocity[GetUnitUserData(GetTriggerUnit())] = 50 * CosBJ(angle)
set udg_yVelocity[GetUnitUserData(GetTriggerUnit())] = 50 * SinBJ(angle)
call DisplayTextToPlayer( GetOwningPlayer(GetTriggerUnit()) ,0,0, "|cffff0000You allready participated in this round" )
set bj_lastCreatedEffect = AddSpecialEffect("Abilities\\Spells\\Other\\HowlOfTerror\\HowlCaster.mdl",unitx,unity)
call DestroyEffect(bj_lastCreatedEffect)
endif
endif
endfunction
so i duno :S
any ideas?!?!
some all known lightning effect bug which everybody falls for?^^
help plz