| 02-25-2004, 08:26 PM | #1 |
While exploring the secrets of JASS and misteries of the WE, I crashed with my head into a wall of stone: Trigger 'c' does not run on Map Initialization: Code:
function Trig_c_Actions takes nothing returns nothing
call TriggerSleepAction( 0.50 )
call ConditionalTriggerExecute( gg_trg_e )
endfunction
//===========================================================================
function InitTrig_c takes nothing returns nothing
set gg_trg_c = CreateTrigger( )
call TriggerAddAction( gg_trg_c, function Trig_c_Actions )
endfunctionCode:
function Trig_b_Actions takes nothing returns nothing
call TriggerSleepAction( 0.50 )
call ConditionalTriggerExecute( gg_trg_d )
endfunction
//===========================================================================
function InitTrig_b takes nothing returns nothing
set gg_trg_b = CreateTrigger( )
call TriggerAddAction( gg_trg_b, function Trig_b_Actions )
endfunctionCan some tell me the difference? I converted both triggers from the GUI, and indeed, trigger b did have the map initialization event. However after convertion into JASS, I can't see any.... |
| 02-25-2004, 08:42 PM | #2 |
When converted to Custom Text Check the two checkboxs they now changed one of them should say Run At map initalization. Select that box if you want. However a real more useful trick is this one Don't make a trigger!: Code:
function InitTrig_c takes nothing returns nothing
call TriggerSleepAction( 0.50 )
call ConditionalTriggerExecute( gg_trg_e )
endfunction |
| 02-25-2004, 08:47 PM | #3 |
0_o wooot, thx for the tips! So that's all about the mistery...I should pay more attention to little, sneaky checkboxes! |
| 02-25-2004, 10:47 PM | #4 |
Weaaddar, I don't think it is a good idea to put a wait in an InitTrig function. |
| 02-25-2004, 11:30 PM | #5 |
Well actually your right it'll kill the thread. As the initalization thread is not a trigger. And TriggerSleepAction only works in triggers. But anyway its stupid to use A sleep action at map init as it only slows loading time of the map. I just was taking the code he placed as an example. |
| 02-26-2004, 01:40 AM | #6 |
Please, dont be so harsh on the sleepaction; It was just there to let me display if the trigger was fired in Game Initialization. This shameful thread of mine is anyway rediculous from top to toe, and I wish it was deleted.://// |
| 02-27-2004, 12:44 AM | #7 |
The reason you don't observe a difference is because the map initilization event is not really an event. It inserts a call to run the trigger when the map loads in a part of the script file you can't see unless you export your script. |
