| 11-23-2007, 11:48 PM | #1 |
Am I doing something wrong here? I'm trying to debug another trigger and I can't get this one to work to help me. What am I doing wrong? JASS:scope test globals real test1 = GetRectMinX(GetPlayableMapRect()) real test2 = GetRectMaxX(GetPlayableMapRect()) endglobals private function Actions takes nothing returns nothing call BJDebugMsg(R2S(test1)) call DisplayTextToForce( GetPlayersAll(), R2S(test2) ) endfunction //=========================================================================== public function test takes nothing returns nothing local trigger trig = CreateTrigger( ) call TriggerRegisterTimerEventSingle( trig, 1.00 ) call TriggerAddAction( trig, function Actions ) endfunction endscope |
| 11-24-2007, 12:30 AM | #2 |
ehm... wat are u trying to do? u have functions, and they are not automatically called... And why do u put trigger into scope |
| 11-24-2007, 12:37 AM | #3 |
JASS:function GetPlayableMapRect takes nothing returns rect return bj_mapInitialPlayableArea endfunction JASS:rect bj_mapInitialPlayableArea = null I'd assume that bj_mapInitialPlayableArea is assigned a value at map init, so you can't set the rect min/max values in global declarations. You could, though, in the InitTrig function, which you totally screwed up. It should be either: JASS:scope YourTriggerName globals real test1 real test2 endglobals // blah conditions, actions public function InitTrig takes nothing returns nothing set test1=GetRectMinX(bj_mapInitialPlayableArea) set test2=GetRectMaxX(bj_mapInitialPlayableArea) // inittrig shiznit endfunction endscope JASS:library SomeName initializer YourInitFunction globals real test1 real test2 endglobals //blah conditions actions function YourInitFunction takes nothing returns nothing set test1=GetRectMinX(bj_mapInitialPlayableArea) set test2=GetRectMaxX(bj_mapInitialPlayableArea) // inittrig shiznit endfunction endlibrary |
| 11-24-2007, 02:39 AM | #4 |
@MaD[Lion] Idk? I thought whenever you make a trigger to use a scope to hold the whole thing. Like the private function needs the scope to tell it that its linked to the public function. I guess I should go read a tutoral on this again. Next question. Why won't this trigger start? Assuming I got it right this time? JASS:scope test globals real test1 real test2 endglobals private function Actions takes nothing returns nothing call BJDebugMsg("123") set test1 = GetRectMinX(bj_mapInitialPlayableArea) set test2 = GetRectMaxX(bj_mapInitialPlayableArea) call BJDebugMsg(R2S(test1)) call DisplayTextToForce( GetPlayersAll(), R2S(test2) ) endfunction //=========================================================================== public function IntiTrig takes nothing returns nothing local trigger trig = CreateTrigger( ) call TriggerRegisterTimerEventSingle( trig, 1.00 ) call TriggerAddAction( trig, function Actions ) endfunction endscope |
| 11-24-2007, 02:50 AM | #5 |
are you ever calling test_test? |
| 11-24-2007, 02:57 AM | #6 |
@Vex Are you talking about the scope? I thought the public function would start it all and that the scope just held everything together. If thats not what your talking about then I'm lost. |
| 11-24-2007, 03:17 AM | #7 | |
Quote:
|
| 11-24-2007, 03:24 AM | #8 | |
Quote:
|
| 11-24-2007, 03:29 AM | #9 |
You could just manually call test_test() from a place that is ever executed on map initialization. You could also make the scope get the same name as the trigger and use a public InitTrig function, (this makes the scope's InitTrig to be used as the trigger's InitTrig function) You can convert the scope into a library with initializer. JASS:scope test globals real test1 = GetRectMinX(GetPlayableMapRect()) real test2 = GetRectMaxX(GetPlayableMapRect()) endglobals private function Actions takes nothing returns nothing call BJDebugMsg(R2S(test1)) call DisplayTextToForce( GetPlayersAll(), R2S(test2) ) endfunction //=========================================================================== public function InitTrig takes nothing returns nothing local trigger trig = CreateTrigger( ) call TriggerRegisterTimerEventSingle( trig, 1.00 ) call TriggerAddAction( trig, function Actions ) endfunction endscope |
| 11-24-2007, 03:38 AM | #10 |
Isn't that what I said? |
| 11-24-2007, 04:45 AM | #11 | |
Quote:
Anyways, since I'm so noob at this, I don't get how I call the trigger. Is the trigger inside a scope inactive until it's called? |
| 11-24-2007, 10:25 AM | #12 | |||
Quote:
Quote:
Quote:
I'm confused now..... |
| 11-24-2007, 11:10 AM | #13 |
To be honest, I'm not sure if that works, Silvenon. I guess it must, but I've never tested initializing those globals like that because I can't use globals blocks. |
| 11-24-2007, 12:14 PM | #14 |
It doesn't work, as in AT ALL. |
| 11-25-2007, 10:38 AM | #15 |
Pitzy The Great was wrong then...... ![]() |
