| 12-18-2003, 07:55 PM | #1 |
I'm trying to create a Heat Seeker Missile ability for my map. Basically what it does is create two Heat Seeker Missile units on each side of the hero and fires them off the the targeted point. The Heat Seeker Missile unit is a modified Wisp with a different model, flying movement, and a 1 damage attack. It has modified versions of the Goblin Land Mine abilities to make it explode on collision with enemies. This is the code: Code:
function Trig_Heat_Seeker_Missiles_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_Heat_Seeker_Missiles_Actions takes nothing returns nothing
local unit missile1
local unit missile2
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 100.00, ( GetUnitFacing(GetSpellAbilityUnit()) - 90.00 )), GetUnitFacing(GetSpellAbilityUnit()) )
set missile1 = GetLastCreatedUnit()
call CreateNUnitsAtLoc( 1, 'e000', GetOwningPlayer(GetSpellAbilityUnit()), PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), 100.00, ( GetUnitFacing(GetSpellAbilityUnit()) + 90.00 )), GetUnitFacing(GetSpellAbilityUnit()) )
set missile2 = GetLastCreatedUnit()
call SetUnitFlyHeightBJ( missile1, GetUnitFlyHeight(GetSpellAbilityUnit()), 1000000000.00 )
call SetUnitFlyHeightBJ( missile2, GetUnitFlyHeight(GetSpellAbilityUnit()), 1000000000.00 )
call IssueTargetOrderBJ( missile1, "attack", GetSpellTargetUnit() )
call IssueTargetOrderBJ( missile2, "attack", GetSpellTargetUnit() )
endfunction
//===========================================================================
function InitTrig_Heat_Seeker_Missiles takes nothing returns nothing
set gg_trg_Heat_Seeker_Missiles = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Heat_Seeker_Missiles, EVENT_PLAYER_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_Heat_Seeker_Missiles, Condition( function Trig_Heat_Seeker_Missiles_Conditions ) )
call TriggerAddAction( gg_trg_Heat_Seeker_Missiles, function Trig_Heat_Seeker_Missiles_Actions )
endfunctionI can't figure out what is wrong with it. The units are made in the correct positions, but they don't move. Any help is appreciated. |
| 12-18-2003, 08:16 PM | #2 |
I don't see anything wrong in your code. Try adding a TriggerSleepAction(0) before giving the order. Make sure the rockets (wisps) have their attacked enabled (under Combat - Attacks enabled) and can target all units. Also make sure that it's melee. That's all I can think of :( |
| 12-18-2003, 09:02 PM | #3 |
I did everything you suggested to no avail. I'm seriously confused on this one. |
| 12-23-2003, 12:49 PM | #4 |
call SetUnitFlyHeightBJ( missile1, GetUnitFlyHeight(GetSpellAbilityUnit()), 1000000000.00 ) I think thats too high of a value Try 10000. set fly height has always been pretty buggy if you ask me . and dont issuce them to attack issue them to uses there explosion ability on that unit thats what i did when i did a similar spell with Buu super Kamikaze ghost attack. |
