- Joined
- Dec 2, 2007
- Messages
- 14
[HELP] How do you copy triggers into the tag? I can't find a way to do it without converting it to custom text. Thanks.
Just a heads up, sorry for the long read, and thank you for your patience and help!
Basically, I'm recreating Level Up Bound from Starcraft and am just starting. Level 1 will be 6 horizontal rows of explosions consecutively, starting from the bottom row. My grid is a 12 x 12, and each region used for this trigger is a 2x2 (I also have 1x1, 3x3, 4x4, and 6x6 regions):
x x x x x x
x x x x x x
x x x x x x
x x x x x x <---- third row, etc. etc
x x x x x x <---- second row, regions: B1, B2, B3, B4, B5, B6
x x x x x x <---- first row of explosions, regions: A1, A2, A3, A4, A5, A6
Now, for this level, I wish to create an effect, say a warstomp special effect, in each of 6 regions in each row, then wait ~0.4 seconds and have the same effect in the subsequent row.
Obviously, I don't want to trigger each and every explosion in each and every region. Thus far, I've been able to create an array for each row, e.g. row 1 would be R_1{index 1-6}, row 2 = R_2{index 1-6}. I've also been able to loop to create explosions row by row. What I'm wondering now is if it's possible to double loop by integers A and B to set up this explosion cycle (then repeat with another trigger) withone action.
Here's what I have so far:
Just a heads up, sorry for the long read, and thank you for your patience and help!
Basically, I'm recreating Level Up Bound from Starcraft and am just starting. Level 1 will be 6 horizontal rows of explosions consecutively, starting from the bottom row. My grid is a 12 x 12, and each region used for this trigger is a 2x2 (I also have 1x1, 3x3, 4x4, and 6x6 regions):
x x x x x x
x x x x x x
x x x x x x
x x x x x x <---- third row, etc. etc
x x x x x x <---- second row, regions: B1, B2, B3, B4, B5, B6
x x x x x x <---- first row of explosions, regions: A1, A2, A3, A4, A5, A6
Now, for this level, I wish to create an effect, say a warstomp special effect, in each of 6 regions in each row, then wait ~0.4 seconds and have the same effect in the subsequent row.
Obviously, I don't want to trigger each and every explosion in each and every region. Thus far, I've been able to create an array for each row, e.g. row 1 would be R_1{index 1-6}, row 2 = R_2{index 1-6}. I've also been able to loop to create explosions row by row. What I'm wondering now is if it's possible to double loop by integers A and B to set up this explosion cycle (then repeat with another trigger) withone action.
Here's what I have so far:
JASS:
function Trig_Ini_Region_Array_Actions takes nothing returns nothing
set udg_RT_1[1] = gg_rct_TA1
set udg_RT_1[1] = gg_rct_TA1
set udg_RT_1[2] = gg_rct_TB1
set udg_RT_1[3] = gg_rct_TC1
set udg_RT_1[4] = gg_rct_TD1
set udg_RT_1[5] = gg_rct_TE1
set udg_RT_1[6] = gg_rct_TF1
call TriggerSleepAction( 0.01 )
set udg_RT_2[1] = gg_rct_TA2
set udg_RT_2[2] = gg_rct_TB2
set udg_RT_2[3] = gg_rct_TC2
set udg_RT_2[4] = gg_rct_TD2
set udg_RT_2[5] = gg_rct_TE2
set udg_RT_2[6] = gg_rct_TF2
call TriggerSleepAction( 0.01 )
endfunction
//===========================================================================
function InitTrig_Ini_Region_Array takes nothing returns nothing
set gg_trg_Ini_Region_Array = CreateTrigger( )
call TriggerAddAction( gg_trg_Ini_Region_Array, function Trig_Ini_Region_Array_Actions )
endfunction
JASS:
function Trig_Explosions_Copy_Conditions takes nothing returns boolean
if ( not ( udg_LevelNumber == 1 ) ) then
return false
endif
return true
endfunction
function Trig_Explosions_Copy_Func001Func004A takes nothing returns nothing
call ExplodeUnitBJ( GetEnumUnit() )
endfunction
function Trig_Explosions_Copy_Func003Func004A takes nothing returns nothing
call ExplodeUnitBJ( GetEnumUnit() )
endfunction
function Trig_Explosions_Copy_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( GetRectCenter(udg_RT_1[GetForLoopIndexA()]), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
set udg_SpecialEffect1 = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_SpecialEffect1 )
call ForGroupBJ( GetUnitsInRectAll(gg_rct_1), function Trig_Explosions_Copy_Func001Func004A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.20 )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 6
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddSpecialEffectLocBJ( GetRectCenter(udg_RT_2[GetForLoopIndexA()]), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
set udg_SpecialEffect1 = GetLastCreatedEffectBJ()
call DestroyEffectBJ( udg_SpecialEffect1 )
call ForGroupBJ( GetUnitsInRectAll(gg_rct_2), function Trig_Explosions_Copy_Func003Func004A )
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call TriggerSleepAction( 0.20 )
endfunction
//===========================================================================
function InitTrig_Explosions_Copy takes nothing returns nothing
set gg_trg_Explosions_Copy = CreateTrigger( )
call TriggerAddCondition( gg_trg_Explosions_Copy, Condition( function Trig_Explosions_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Explosions_Copy, function Trig_Explosions_Copy_Actions )
endfunction
Last edited by a moderator: