HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

freaking local trigger won't fire and is driving me insane

09-03-2004, 06:57 PM#1
fugly
ok this crap happened to me once, gave up on the solution, did a total re-write and its back haunting me... for some reason this trigger won't fire and i did all the degguing checks with no avail except for the fact that warcaft must hate me and everything i touch... arggadsfgafa

ok look

Code:
function HeroChosen takes nothing returns nothing
[color=Red]local trigger t = CreateTrigger()[/color]
local group g = null
local unit hero
local trigger t = null
   if GetSpellAbilityId() == 'A000' then
       set hero = CreateUnit(GetOwningPlayer(GetTriggerUnit()), GetUnitTypeId(GetTriggerUnit()), 0,0,0)
   elseif GetSpellAbilityId() == 'A002' then
       set g = GetUnitsInRectAll(gg_rct_Hero_Selection)
       set hero = CreateUnit(GetOwningPlayer(GetTriggerUnit()), GetUnitTypeId(GroupPickRandomUnit(g)), 0,0,0)
       call DestroyGroup(g)
   else
       return
   endif
   call StoreString(udg_gc, I2S(H2I(hero)), "spellslot1", "SelectSpell")
   call StoreString(udg_gc, I2S(H2I(hero)), "spellslot2", "SelectSpell")
   call UnitAddItemByIdSwapped( 'infs', hero )
   call StoreInteger(udg_gc, I2S(H2I(hero)), "Summon Raven", 1)
   call StoreBoolean(udg_gc, I2S(GetPlayerId(GetTriggerPlayer())), "playerready", true)
   call SetUnitOwner(GetTriggerUnit(), Player(PLAYER_NEUTRAL_PASSIVE), true)
   call TimerDialogDisplayForPlayerBJ( false, GetLastCreatedTimerDialogBJ(), GetOwningPlayer(hero) )
   call SelectUnitForPlayerSingle(hero, GetTriggerPlayer())
   call SetHandleHandle(hero, "dummyunit",CreateUnit(GetOwningPlayer(hero), GetUnitTypeId(hero), -1439.4,1528,0) )
   call SetHandleHandle(GetHandleHandle(hero, "dummyunit"), "masterunit", hero)
   call StoreInteger(udg_gc, I2S(GetPlayerId(GetOwningPlayer(hero))), "hero", H2I(hero) )
   call StoreInteger(udg_gc, "HeroLockTrig"+I2S(H2I(t)), "player", GetPlayerId(GetTriggerPlayer()) )
   call SetHandleInt(hero, "skillpoints", 1)
   call ClearUnit(H2U(GetHandleHandle(hero, "dummyunit")))
   call AddAbilities(H2U(GetHandleHandle(hero, "dummyunit")), GetSkillTreeTypes(GetUnitTypeId(hero)) )
   call UnitAddAbilityBJ('A003', H2U(GetHandleHandle(hero, "dummyunit")))
   call AddAbilities(hero, I2S('A00D')+I2S('A00B'))
   call DestroyTrigger( H2T( I2H( GetStoredInteger(udg_gc, I2S(GetPlayerId(GetOwningPlayer(hero))), "camlocktrig") ) ) )
   call CameraSetupApplyForPlayer( true, gg_cam_HeroCreated, GetOwningPlayer(hero), 0.50 )
   call AddAbility('A001',hero)
   ////
     //Set Up Dummy Unit
       call SetUnitVertexColorBJ( H2U(GetHandleHandle(hero, "dummyunit")), 100, 100, 100, 50.00 )
[color=Red]       call TriggerRegisterUnitEvent( t, H2U(GetHandleHandle(hero, "dummyunit")), EVENT_UNIT_SPELL_CAST )
       call TriggerAddAction(t, function SkillTreePicked)[/color]
   ////
   set hero =null
   set g = null
endfunction 

ok for some reason when the dummy unit uses a spell, it won't fire! i checked if the event is calling the right unit by making it make the dummy unit 50% transparet right before creating the trigger, and sure enough the unit is transparent, also in the trigger i made the first action display "hi" and IT WON'T SAY HI!!!! I HATE THIS SO MUCH CAUSE ITS SLOWING ME DOWN SO FREAKING MUCH!!!


plz... help
09-03-2004, 11:09 PM#2
Vexorian
local trigger t = null

that's just below the other declaration
09-04-2004, 12:48 AM#3
fugly
OMG AHHAHAHAHAHAHA LOL OMG....

Vex you continue to be my God, marry me.

just why didn't it call an expexted name error?

PS. +1 rep :)
PSS. ANY FREAKING IDEA WHY THIS TRIGGER WILL ONLY FIRE ONCE??!@#!231231