HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is this valid?

12-24-2006, 02:05 AM#1
darkwulfv
Collapse JASS:
function InitTrig_End_Sleep takes nothing returns nothing  
  local trigger t = CreateTrigger()
  local integer i = 0
  
  loop
  exitwhen i == 10
    <<call TriggerRegisterPlayerEventEndCinematic(t, Player(i) )>>
  endloop
  
    call TriggerAddAction(t , function End_Sleep_Actions )
set t = null
endfunction

The part surrounded by the <> is what I'm talking about. Would this work? (rather than having 10 of those -.-;)
12-24-2006, 04:01 AM#2
The_AwaKening
Simple Answer: Yes

I use loops in all my Player Events.
12-24-2006, 04:02 AM#3
xombie
First off, if you don't set i = i + 1 then it will never end the loop, causing extreme lag. It will also create a hell of alot of events for Player 1 (Red) that are all the same.
12-24-2006, 04:10 AM#4
The_AwaKening
Ya, ha, I completely looked past the fact that you didn't add that in there.
12-24-2006, 04:18 AM#5
darkwulfv
DOH!
I forgot about that.... hehe, will do.

Thanks though, good to know it will work.