- Joined
- Sep 18, 2007
- Messages
- 104
Well I opened up an old clan project and decided to recode it all in JASS for practice, and I ran into some problems. The following to triggers aren't working...
This trigger is supposed to display the message "*Hero Name*'s forces have been obliterated") to all players. Nothing happens, not even the debug.
This trigger is supposed to spawn units at the location of the Gate Captain. The debug message comes up, but no units spawn. Also gate captains do not die, they switch owners before that. I have already wrote that script though.
This trigger is supposed to display the message "*Hero Name*'s forces have been obliterated") to all players. Nothing happens, not even the debug.
JASS:
function DeathMessageActions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), ( "|cff32cd32" + ( GetHeroProperName(GetTriggerUnit()) + " Forces have been Obliterated|r" ) ) )
debug call BJDebugMsg("Debug1")
endfunction
//===========================================================================
function InitTrig_DeathMessage takes nothing returns nothing
local trigger DeathMessage = CreateTrigger()
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H00A_0025, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H003_0022, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H006_0023, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H002_0016, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H009_0019, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_O001_0020, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H001_0018, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_E000_0017, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H008_0024, EVENT_UNIT_DEATH )
call TriggerRegisterUnitEvent( DeathMessage, gg_unit_H004_0423, EVENT_UNIT_DEATH )
call TriggerAddAction( DeathMessage, function DeathMessageActions )
set DeathMessage = null
endfunction
This trigger is supposed to spawn units at the location of the Gate Captain. The debug message comes up, but no units spawn. Also gate captains do not die, they switch owners before that. I have already wrote that script though.
JASS:
globals
constant group captains = GetUnitsOfTypeIdAll('h00B')
endglobals
function Spawns takes nothing returns nothing
local location loc = GetUnitLoc(GetEnumUnit())
call CreateNUnitsAtLoc( 2, 'h005', GetOwningPlayer(GetEnumUnit()), loc, bj_UNIT_FACING )
call CreateNUnitsAtLoc( 3, 'hfoo', GetOwningPlayer(GetEnumUnit()), loc, bj_UNIT_FACING )
call CreateNUnitsAtLoc( 4, 'nhea', GetOwningPlayer(GetEnumUnit()), loc, bj_UNIT_FACING )
set loc = null
endfunction
function Trig_Gate_Spawn_Actions takes nothing returns nothing
call ForGroup( captains, function Spawns )
debug call BJDebugMsg("Debug2")
endfunction
//===========================================================================
function InitTrig_Gate_Spawn takes nothing returns nothing
local trigger GateSpawn = CreateTrigger()
call TriggerRegisterTimerEventPeriodic( GateSpawn, 120.00 )
call TriggerAddAction( GateSpawn, function Trig_Gate_Spawn_Actions )
set GateSpawn = null
endfunction
Last edited: