- Joined
- Jun 5, 2007
- Messages
- 3
This map has memory leak trouble, I've tried fixing it but my methods result in the map's grenade not working right at all. If anybody can fix it or tell me how to without affecting the grenade, I'll throw out rep points like crazy. The most important trigger is called Gex, it's also the one that glitched the grenade when i tried cleaning the memory leaks. Help with the other leaky triggers would be good too, the jass ones seem ok, but the gui ones leak. Open the attachment map to get a better grasp of the script/variables.
This is not my map but I use it as the foundation for my maps, credits go to jigs4w for the map, infrane for the particle system, and anitarf for vector.
Here is the jass grenade trigger.
and here is the gui trigger Gex, it's leaky. I put it in jass here. be wary of cleaning the leaks in this one, it might glitch the grenade.
This is not my map but I use it as the foundation for my maps, credits go to jigs4w for the map, infrane for the particle system, and anitarf for vector.
Here is the jass grenade trigger.
JASS:
function Trig_ThrowGrenade_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'AOfs'
endfunction
function Trig_ThrowGrenade_Actions takes nothing returns nothing
local location casterpos = GetUnitLoc(GetSpellAbilityUnit())
local location topos = GetSpellTargetLoc()
local unit u = CreateParticle(GetOwningPlayer(GetSpellAbilityUnit()),'hfoo',GetLocationX(casterpos),GetLocationY(casterpos),GetUnitFacing(GetSpellAbilityUnit()))
call ParticleSetSpeed(u,GetLocationX(topos)-GetLocationX(casterpos),GetLocationY(topos)-GetLocationY(casterpos),1200)
call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_Bounce")
call ParticleLinkConditionTrigger2Func(u, ParticleDeath(), "Death_Remove")
call ParticleAddForce(u, G())
call RemoveLocation(casterpos)
call RemoveLocation(topos)
set casterpos=null
set topos=null
set u = null
endfunction
//===========================================================================
function InitTrig_ThrowGrenade takes nothing returns nothing
set gg_trg_ThrowGrenade = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ThrowGrenade, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ThrowGrenade, Condition( function Trig_ThrowGrenade_Conditions ) )
call TriggerAddAction( gg_trg_ThrowGrenade, function Trig_ThrowGrenade_Actions )
endfunction
and here is the gui trigger Gex, it's leaky. I put it in jass here. be wary of cleaning the leaks in this one, it might glitch the grenade.
JASS:
function Trig_Gex_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'hfoo' ) ) then
return false
endif
return true
endfunction
function Trig_Gex_Actions takes nothing returns nothing
call AddSpecialEffectLocBJ( GetUnitLoc(GetTriggerUnit()), "Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl" )
call UnitDamagePointLoc( GetTriggerUnit(), 0, 200.00, GetUnitLoc(GetTriggerUnit()), 100, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
//===========================================================================
function InitTrig_Gex takes nothing returns nothing
set gg_trg_Gex = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Gex, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Gex, Condition( function Trig_Gex_Conditions ) )
call TriggerAddAction( gg_trg_Gex, function Trig_Gex_Actions )
endfunction