| 07-27-2008, 04:28 PM | #1 |
Would this trigger an oplimit JASS:function test takes nothing returns nothing call test() endfunction |
| 07-27-2008, 04:32 PM | #2 |
Recursive functions aren't allowed in Jass. |
| 07-27-2008, 04:45 PM | #3 | |
Quote:
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 |
| 07-27-2008, 04:54 PM | #4 |
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: JASS:loop set i=i+1 endloop |
| 07-27-2008, 04:59 PM | #5 |
Umm.. Copied from outputwar3map: 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 |
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 |
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. |
