- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright so I have a trigger that prevents a unit from being purchasable during the night and makes it available during the day. This right now is my current trigger:
However it's not working at all. I based it off of the idea of the Hero Selection Taverns for AoS. What's the problem with it? :X
Also the trigger is suppose to speed up the day cycle and slow down the night cycle, but it isn't doing that. Nor is it removing the unit from the map when night comes.
Debug messages seem to indicate it's going through it's triggers, but the effects aren't happening.
JASS:
function Trig_Skiptime_Actions takes nothing returns nothing
if IsPlayerInForce(GetLocalPlayer(), udg_BloodPackPlayer) then
call SetPlayerTechMaxAllowed(GetLocalPlayer(), 'uC02', -1)
endif
if udg_EasyMode == 1 then
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 7.10)
call SetGameSpeed( MAP_SPEED_SLOW )
else
call SetGameSpeed( MAP_SPEED_NORMAL )
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 8.10)
endif
endfunction
//===========================================================================
function InitTrig_Skiptime takes nothing returns nothing
set gg_trg_Skiptime = CreateTrigger( )
call TriggerRegisterGameStateEvent(gg_trg_Skiptime, GAME_STATE_TIME_OF_DAY, EQUAL, 6.10)
call TriggerAddAction( gg_trg_Skiptime, function Trig_Skiptime_Actions )
endfunction
JASS:
function RemoveDamned takes nothing returns boolean
if GetUnitTypeId(GetEnumUnit()) == 'uC02' then
call KillUnit(GetEnumUnit())
endif
return false
endfunction
function Trig_Slowtime_Actions takes nothing returns nothing
local group g = CreateGroup()
call SetMapFlag(MAP_LOCK_SPEED, true)
call GroupEnumUnitsInRect(g, GetPlayableMapRect(), function RemoveDamned)
if IsPlayerInForce(GetLocalPlayer(), udg_BloodPackPlayer) then
call DisplayTextToPlayer(GetLocalPlayer(), 0,0, "Damned Souls are no longer available")
call SetPlayerTechMaxAllowed(GetLocalPlayer(), 'uC02', 0)
endif
if udg_EasyMode == 1 then
call SetGameSpeed( MAP_SPEED_FAST )
else
call SetGameSpeed( MAP_SPEED_FASTEST )
endif
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Slowtime takes nothing returns nothing
set gg_trg_Slowtime = CreateTrigger( )
call TriggerRegisterGameStateEvent(gg_trg_Slowtime, GAME_STATE_TIME_OF_DAY, EQUAL, 18.10)
call TriggerAddAction( gg_trg_Slowtime, function Trig_Slowtime_Actions )
endfunction
However it's not working at all. I based it off of the idea of the Hero Selection Taverns for AoS. What's the problem with it? :X
Also the trigger is suppose to speed up the day cycle and slow down the night cycle, but it isn't doing that. Nor is it removing the unit from the map when night comes.
Debug messages seem to indicate it's going through it's triggers, but the effects aren't happening.