- Joined
- Aug 30, 2009
- Messages
- 114
I've been looking for some spells and I realized the most qualified makers never use BJ like
, they usually do this:
So, it drives me to one question, whats wrong with BJ ? Is there any problem using it? Once it's much easier than normal codes?
I'm having some lag stuffs into spells that use 0.05 seconds interval...
I did everything right, I cleaned all leaks, I change the time to 0.05 instead of 0.02, but yet, it does lag when it draggs much units, I wanna know if BJ codes are somehow related to it...
Can someone give me some hints about?
Here is only ONE of the spells wich lags
OBS: The Dummy unit used in this spell is just an effect and has nothing to do with it. Before you say something, I have another trigger that runs a few seconds after the map initializing wich I made the preload of the Dummy spell, the Hero Spell and the Dummy ability (just another visual effect).
I don't know if it's nescessary to make a preload of the sounds.
Thank you, for your time.
JASS:
SetUnitPositionLocFacingBJ
JASS:
SetUnitPosition
SetUnitPositionLoc
So, it drives me to one question, whats wrong with BJ ? Is there any problem using it? Once it's much easier than normal codes?
I'm having some lag stuffs into spells that use 0.05 seconds interval...
I did everything right, I cleaned all leaks, I change the time to 0.05 instead of 0.02, but yet, it does lag when it draggs much units, I wanna know if BJ codes are somehow related to it...
Can someone give me some hints about?
Here is only ONE of the spells wich lags
JASS:
function Trig_Dragula_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A0FM' ) ) then
return false
endif
return true
endfunction
function Trig_Dragula_Func003002003001 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) != true )
endfunction
function Trig_Dragula_Func003002003002001001 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction
function Trig_Dragula_Func003002003002001002 takes nothing returns boolean
return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) != true )
endfunction
function Trig_Dragula_Func003002003002001 takes nothing returns boolean
return GetBooleanAnd( Trig_Dragula_Func003002003002001001(), Trig_Dragula_Func003002003002001002() )
endfunction
function Trig_Dragula_Func003002003002002 takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Spell_Dragula_Dummy)) == true )
endfunction
function Trig_Dragula_Func003002003002 takes nothing returns boolean
return GetBooleanAnd( Trig_Dragula_Func003002003002001(), Trig_Dragula_Func003002003002002() )
endfunction
function Trig_Dragula_Func003002003 takes nothing returns boolean
return GetBooleanAnd( Trig_Dragula_Func003002003001(), Trig_Dragula_Func003002003002() )
endfunction
function Trig_Dragula_Func009A takes nothing returns nothing
call KillDestructable( GetEnumDestructable() )
endfunction
function Trig_Dragula_Timer_Func001A takes nothing returns nothing
local unit E = GetEnumUnit()
local location L = GetUnitLoc(E)
local location L3 = GetUnitLoc(udg_Spell_Dragula_Dummy)
local location L2 = PolarProjectionBJ(L, 5.00, AngleBetweenPoints(L, L3))
call SetUnitPositionLoc( E, L2 )
call RemoveLocation(L)
call RemoveLocation(L2)
call RemoveLocation(L3)
set E = null
endfunction
function DragulaPush takes nothing returns nothing
local location L = GetUnitLoc(udg_Spell_Dragula_Dummy)
local group G = GetUnitsInRangeOfLocMatching(875.00, L, Condition(function Trig_Dragula_Func003002003))
call ForGroupBJ( G, function Trig_Dragula_Timer_Func001A )
set G = null
call DestroyGroup(G)
call RemoveLocation(L)
endfunction
function Trig_Dragula_Actions takes nothing returns nothing
local trigger T = CreateTrigger()
local location L = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'u00R', GetOwningPlayer(GetTriggerUnit()), L, bj_UNIT_FACING )
set udg_Spell_Dragula_Dummy = GetLastCreatedUnit()
call PlaySoundOnUnitBJ( gg_snd_PossessionMissileLaunch1, 100, GetLastCreatedUnit() )
call UnitAddAbilityBJ( 'A0FN', GetLastCreatedUnit() )
call SetUnitAbilityLevelSwapped( 'A0FN', GetLastCreatedUnit(), GetUnitAbilityLevelSwapped('A0FM', GetTriggerUnit()) )
call UnitApplyTimedLifeBJ( 7.00, 'BTLF', GetLastCreatedUnit() )
call EnumDestructablesInCircleBJ( 875.00, L, function Trig_Dragula_Func009A )
call TriggerRegisterTimerEventPeriodic( T, 0.05 )
call TriggerAddAction( T, function DragulaPush )
call UnitDamageTargetBJ( GetTriggerUnit(), GetTriggerUnit(), ( 100.00 + ( 100.00 * I2R(GetUnitAbilityLevelSwapped('A0FM', GetTriggerUnit())) ) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC )
call TriggerSleepAction( 6.00 )
call DestroyTrigger(T)
call PlaySoundOnUnitBJ( gg_snd_SoulPreservation, 100, GetLastCreatedUnit() )
call KillSoundWhenDoneBJ( GetLastPlayedSound() )
call RemoveLocation(L)
endfunction
//===========================================================================
function InitTrig_Dragula takes nothing returns nothing
set gg_trg_Dragula = CreateTrigger( )
call DisableTrigger( gg_trg_Dragula )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Dragula, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Dragula, Condition( function Trig_Dragula_Conditions ) )
call TriggerAddAction( gg_trg_Dragula, function Trig_Dragula_Actions )
endfunction
OBS: The Dummy unit used in this spell is just an effect and has nothing to do with it. Before you say something, I have another trigger that runs a few seconds after the map initializing wich I made the preload of the Dummy spell, the Hero Spell and the Dummy ability (just another visual effect).
I don't know if it's nescessary to make a preload of the sounds.
Thank you, for your time.