| 03-18-2008, 03:02 AM | #1 |
My map only has two triggers: Trigger: JASS:function Trig_Camera_Presets_Actions takes nothing returns nothing local integer num = 0 loop exitwhen num == 10 set num = num + 1 call BJDebugMsg(I2S(num)) call SetCameraTargetControllerNoZForPlayer( Player(num-1), udg_Cameramen[num], 0, 0, false ) call SetCameraFieldForPlayer( Player(num-1), CAMERA_FIELD_ANGLE_OF_ATTACK, -45.00, 0 ) endloop endfunction //=========================================================================== function Trig_Camera_Presets takes nothing returns nothing set gg_trg_Camera_Presets = CreateTrigger( ) call TriggerRegisterTimerEventSingle( gg_trg_Camera_Presets, 1.0 ) call TriggerAddAction( gg_trg_Camera_Presets, function Trig_Camera_Presets_Actions ) endfunction But when I run the map the second trigger doesn't seem to run at all. Can someone please take a quick look at this? Thanks to anyone who can help! My map: Millipede Defense v0.1 Test.w3x |
| 03-18-2008, 03:09 AM | #2 |
Your second trigger needs its InitTrig to be named as follows -- "InitTrig_Camera_Presets" JASS:function Trig_Camera_Presets_Actions takes nothing returns nothing local integer num = 0 loop exitwhen num == 10 set num = num + 1 call BJDebugMsg(I2S(num)) call SetCameraTargetControllerNoZForPlayer( Player(num-1), udg_Cameramen[num], 0, 0, false ) call SetCameraFieldForPlayer( Player(num-1), CAMERA_FIELD_ANGLE_OF_ATTACK, -45.00, 0 ) endloop endfunction //=========================================================================== function InitTrig_Camera_Presets takes nothing returns nothing set gg_trg_Camera_Presets = CreateTrigger( ) call TriggerRegisterTimerEventSingle( gg_trg_Camera_Presets, 1.0 ) call TriggerAddAction( gg_trg_Camera_Presets, function Trig_Camera_Presets_Actions ) endfunction |
| 03-18-2008, 03:24 AM | #3 |
Oh my bad, I removed that because I thought it was some useless prefix. Isn't there a way to get around use so many words in a line? I swear I saw some spells that didn't have that prefix. Either way thanks again for saving me. |
| 03-18-2008, 03:41 AM | #4 | |
Quote:
JASS:scope CameraMan private function Actions takes nothing returns nothing local integer num = 0 loop exitwhen num == 10 set num = num + 1 call BJDebugMsg(I2S(num)) call SetCameraTargetControllerNoZForPlayer( Player(num-1), udg_Cameramen[num], 0, 0, false ) call SetCameraFieldForPlayer( Player(num-1), CAMERA_FIELD_ANGLE_OF_ATTACK, -45.00, 0 ) endloop endfunction public function InitTrig takes nothing returns nothing local trigger t = CreateTrigger( ) call TriggerRegisterTimerEventSingle(t, 1.0 ) call TriggerAddAction(t, function Actions ) endfunction endscope |
| 03-18-2008, 07:35 PM | #5 | |
Quote:
I see, I was going to start learning all about scopes today but thank you for this. Definitely very helpful. I was just wondering then, what are the advantages to using a scope versus the method I layed out? |
