HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

oplimit

07-27-2008, 04:28 PM#1
chobibo
Would this trigger an oplimit
Collapse JASS:
function test takes nothing returns nothing
     call test()
endfunction
07-27-2008, 04:32 PM#2
Here-b-Trollz
Recursive functions aren't allowed in Jass.
07-27-2008, 04:45 PM#3
Troll-Brain
Quote:
Originally Posted by Here-b-Trollz
Recursive functions aren't allowed in Jass.
You can use one with return.

Collapse JASS:
function test takes integer i returns integer
    set i= i-1
    if i>20 then
        return test(i)
    endif

    call BJDebugMsg(I2S(i))
    return i
endfunction
Yes i know this example is useless but it's still a valid one.
07-27-2008, 04:54 PM#4
Here-b-Trollz
I'm fairly certain that that is vJass doing that, .evaluate or .execute.

A BETTER way to hit the op limit (assuming that's what you want to do) would be:

Collapse JASS:
loop
    set i=i+1
endloop
07-27-2008, 04:59 PM#5
Alexander244
Umm..
Copied from outputwar3map:
Collapse JASS:
globals
    // Generated
    trigger                 gg_trg_Melee_Initialization = null
        integer A__i = 0


//JASSHelper struct globals:

endglobals

//...

// scope A begins


    function A__Test takes nothing returns nothing
        if A__i >= 500 then
            return 
        else
            set A__i = A__i + 1
            call BJDebugMsg(I2S(A__i))
        endif
        call A__Test()
    endfunction

// scope A ends

//...

Prints 0 -> 500
07-27-2008, 05:00 PM#6
Troll-Brain
xD, as i said it's just a silly example.
I don't think we really need that.

And vJass don't do that o_O.
.evaluate() TriggerEvaluate a trigger with your function in a condition.
.execute TriggerExecute a trigger with your function in an action.
07-27-2008, 05:18 PM#7
chobibo
Troll-Brain's example really works, can't add a sleep though.
Is Grimoire already working for 1.22? It really is helpful in detecting my erroneous codes lol.

EDIT: Thanks for the sample you gave Alexander244, I also wrote the same script, but I didn't call it after map initialization that's why it didn't work.