HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Another wierd issue

07-20-2009, 03:45 PM#1
Cheezeman
Hello again.
Once more I'm having a - for me - very wierd problem (expect that I've done some silly mistake).
Basically a spell I'm working on looks like this:
Collapse JASS:
scope MySpell initializer Init
    globals
        private constant real INTERVAL = 1.
    endglobals

    private function Actions takes nothing returns nothing
        debug call BJDebugMsg( "debug" )
    endfunction

    private function Init takes nothing returns nothing
        local trigger trg = CreateTrigger()
        call TriggerRegisterTimerEvent( trg, INTERVAL, true ) //"Every INTERVAL second of gameplay"
        call TriggerAddAction( trg, function Actions )
        debug call BJDebugMsg( "init" )
    endfunction
endscope

The problem is when I start, the game displays "init", but never displays "debug".

This is not the entire code (I don't want to share everything to the whole world), but it shouldn't matter since it doesn't use some kind of Condition, only a Timer event and an Action.
Yes, I've tried replacing INTERVAL with 1. in the event, but that doesn't work either.
Yes, I've tried removing the debug preffix on the message calls, but it gives me the same result.

Help?

Edit: Here's the entire unfinished, pre-released Beta code;
Expand JASS:
07-20-2009, 04:14 PM#2
Blubb-Tec
did you try running EXACTLY this trigger? without whatever other stuff you've got? if that one works, it'll be a problem with the rest of your stuff.
07-20-2009, 04:26 PM#3
Cheezeman
Quote:
Originally Posted by Blubb-Tec
did you try running EXACTLY this trigger? without whatever other stuff you've got? if that one works, it'll be a problem with the rest of your stuff.
Well, was quite undecisive about this whole thing... I had to options to chose from:
Either I post my entier code, ruining some kind of 'suprise moment' when I release it and get alot of comments telling me how badly it's scripted, but probably solve the issue.
Or I just post a fragment like I did and ask if anyone have experienced a related problem before.

I chose the second option, but perhaps it was wrong :/
Do you want the entire code?
07-20-2009, 05:06 PM#4
moyack
A better approach:

Collapse JASS:
scope MySpell initializer Init
    globals
        private constant real INTERVAL = 1.
    endglobals

    private function Actions takes nothing returns nothing
        debug call BJDebugMsg( "debug" )
    endfunction

    private function Init takes nothing returns nothing
        call TimerStart( CreateTimer(), INTERVAL, true, function Actions ) //"Every INTERVAL second of gameplay"
        debug call BJDebugMsg( "init" )
    endfunction
endscope

This does the same with less code.
07-20-2009, 05:09 PM#5
Cheezeman
True, but for my spell's code, "debug" still isn't shown.
07-20-2009, 05:11 PM#6
moyack
have you checked in jasshelper menu "debug mode"?

If not, check it and save your map again.
07-20-2009, 05:21 PM#7
Cheezeman
Well yes, debug is active. I said that "init" is shown in my thread-post, which must mean that it's active.
07-20-2009, 05:24 PM#8
Blubb-Tec
Quote:
Originally Posted by Cheezeman
Well, was quite undecisive about this whole thing... I had to options to chose from:
Either I post my entier code, ruining some kind of 'suprise moment' when I release it and get alot of comments telling me how badly it's scripted, but probably solve the issue.
Or I just post a fragment like I did and ask if anyone have experienced a related problem before.

I chose the second option, but perhaps it was wrong :/
Do you want the entire code?

what i meant was: try saving the simple version you posted in your first post. if you can save that one without errors, the problem will lie somewhere else in your code. in that case, post the rest of it. if the problem is still there with the more simple code, there will be another reason for it.
07-20-2009, 05:45 PM#9
Cheezeman
Quote:
Originally Posted by Blubb-Tec
what i meant was: try saving the simple version you posted in your first post. if you can save that one without errors, the problem will lie somewhere else in your code. in that case, post the rest of it. if the problem is still there with the more simple code, there will be another reason for it.
Yeah the code I posted works fine, just as I thought...
Here we go with the unfinished, pre-realeased Beta code:
Expand JASS:
07-20-2009, 06:26 PM#10
Blubb-Tec
Quote:
Originally Posted by Cheezeman
Yeah the code I posted works fine, just as I thought...
Here we go with the unfinished, pre-realeased Beta code:
Expand JASS:

first of all, important warning: read the threads about patch 1.23b/1.24, since H2I won't be working anymore, and you're still using it.

then, i guess the BJMsg init shows, but "huhe" does not? then i guess, the thread crashes before that. try doing it this w
ay:

Collapse JASS:
    private function Actions takes nothing returns nothing
        local unit user = null
        local integer user_id = 0
        local integer victim_id = 0
        local integer level = 0
        local real userX = 0.
        local real userY = 0.
        
        call BJDebugMsg( "hehu" )
        set user = FirstOfGroup( Users )
        call BJDebugMsg("set user WORKS")
        set copy = CopyGroup( Users )
        call BJDebugMsg("set copy WORKS")

        //rest of the code goes here..

then, if it already stops after the hehu, try putting the 2nd check first, and run it again. if it fails again, it will probably be the unitgroup Users that is unitialized or sth. like that.
oh yeah, remember this method for debugging thread crashes..
07-20-2009, 06:44 PM#11
Hans_Maulwurf
You never create the group Users
So I guess it stops at FirstOfGroup( Users )
07-20-2009, 07:52 PM#12
Cheezeman
Quote:
Originally Posted by Hans_Maulwurf
You never create the group Users
So I guess it stops at FirstOfGroup( Users )
OH GOD THANK YOU :D :D :D
That worked just fine
I was suspecting I forgot to initialize some global, but I didn't think it was Users (cause I used it as an array before)
+Rep on that, and +rep to blub for his effort (edit: gotta spread around first -.-")

And about the H2I, it's gonna be changed for 1.24
I have a request aswell, please remove my code from your post, I'd like to keep it private :P
07-20-2009, 10:36 PM#13
Anitarf
Quote:
Originally Posted by Cheezeman
I have a request aswell, please remove my code from your post, I'd like to keep it private :P
Yes, because people just can't wait to steal your crappy code.
07-21-2009, 12:07 AM#14
Blubb-Tec
Quote:
Originally Posted by Cheezeman
I have a request aswell, please remove my code from your post, I'd like to keep it private :P

no i won't. if, in 1 week, you can still remember this, i'll remove it. if not, i guess you'll have learnt your lesson, and learnt that it doesn't really matter. now go work on that H2I thing there, 1.24 is coming soon...
07-21-2009, 12:38 AM#15
TaintedReality
Ok first off - don't worry, nobody wants to steal your code. Second off, you're gonna leave it up for a week so he "learns his lesson"?? This whole thing is just weird..