Hey! Testing out some of the new trigger stuff that got added a while back (waaaay late to the party I know). I wanted to make use of "Unit - Set Attack Interval". At first the action wasn't working, so I figured it might have been a 0 indexed thing. Converted the trigger to custom text and slapped a 0 on it. It works! Used a custom line in a GUI trigger with the same action and... it doesn't work.
These 2 triggers are pretty much the exact same thing right? Why does the custom text one work but not the GUI one?
Also included a test map that has this issue. typing "test1" runs a trigger in GUI, and typing "test2" runs a trigger converted to custom text.
EDIT: Forgot to include the triggers from the test map! They're pretty much the same thing as above, but refer to different mountain kings each. Ya know, just in case I might've did things differently and didn't notice, or someone doesn't have access to WE atm. Test 1 (GUI trigger) fails, whereas Test 2 (custom text trigger) works correctly. Test 2 Preconvert fails also.
These 2 triggers are pretty much the exact same thing right? Why does the custom text one work but not the GUI one?
-
Hero Attack Rate
-
Events
-
Player - Player 1 (Red) types a chat message containing test as An exact match
-
-
Conditions
-
Actions
-
Game - Display to (All players) the text: testing
-
Custom script: call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0163, 0.30, 0 )
-
Trigger - Turn off (This trigger)
-
Wait 6.00 seconds
-
Game - Display to (All players) the text: done testing
-
Trigger - Turn on (This trigger)
-
Custom script: call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0163, 2.22, 0 )
-
-
Code:
function Trig_Hero_Attack_Rate_Copy_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_716" )
call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0163, 0.30, 0 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 6.00 )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_723" )
call EnableTrigger( GetTriggeringTrigger() )
call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0163, 2.22, 0 )
endfunction
//===========================================================================
function InitTrig_Hero_Attack_Rate_Copy takes nothing returns nothing
set gg_trg_Hero_Attack_Rate_Copy = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Hero_Attack_Rate_Copy, Player(0), "test", true )
call TriggerAddAction( gg_trg_Hero_Attack_Rate_Copy, function Trig_Hero_Attack_Rate_Copy_Actions )
endfunction
Also included a test map that has this issue. typing "test1" runs a trigger in GUI, and typing "test2" runs a trigger converted to custom text.
EDIT: Forgot to include the triggers from the test map! They're pretty much the same thing as above, but refer to different mountain kings each. Ya know, just in case I might've did things differently and didn't notice, or someone doesn't have access to WE atm. Test 1 (GUI trigger) fails, whereas Test 2 (custom text trigger) works correctly. Test 2 Preconvert fails also.
-
Attack Rate Test 1
-
Events
-
Player - Player 1 (Red) types a chat message containing test1 as An exact match
-
-
Conditions
-
Actions
-
Game - Display to (All players) the text: test1
-
Custom script: call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0000, 0.30, 0 )
-
Trigger - Turn off (This trigger)
-
Wait 5.00 seconds
-
Game - Display to (All players) the text: done test1
-
Custom script: call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0000, 2.22, 0 )
-
Trigger - Turn on (This trigger)
-
-
Code:
function Trig_Attack_Rate_Test_2_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_009" )
call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0001, 0.30, 0 )
call DisableTrigger( GetTriggeringTrigger() )
call TriggerSleepAction( 5.00 )
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_010" )
call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0001, 2.22, 0 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_Attack_Rate_Test_2 takes nothing returns nothing
set gg_trg_Attack_Rate_Test_2 = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Attack_Rate_Test_2, Player(0), "test2", true )
call TriggerAddAction( gg_trg_Attack_Rate_Test_2, function Trig_Attack_Rate_Test_2_Actions )
endfunction
-
Attack Rate Test 2 Preconvert
-
Events
-
Player - Player 1 (Red) types a chat message containing test2 as An exact match
-
-
Conditions
-
Actions
-
Game - Display to (All players) the text: test2
-
Custom script: call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0001, 0.30, 0 )
-
Trigger - Turn off (This trigger)
-
Wait 5.00 seconds
-
Game - Display to (All players) the text: done test2
-
Custom script: call BlzSetUnitAttackCooldown( gg_unit_Hmkg_0001, 2.22, 0 )
-
Trigger - Turn on (This trigger)
-
-
Attachments
Last edited: