HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Pausing and Resuming in cinematics?

06-30-2006, 09:12 PM#1
Sardius
Is it possible to essentially pause everything thats going on while in cinematics?

I've tried the pause game trigger but that freezes everything, all animation, weather, special effects. Not what I am looking for.

I know I can pause all units, but I can't use the "unpause" all units trigger because their are certain units that are suppose to be paused until paticular triggere events.
06-30-2006, 09:44 PM#2
Captain Griffen
Collapse JASS:
function IsNotPaused takes nothing returns boolean
    return IsUnitPaused(GetFilterUnit()) == false
endfunction

Collapse JASS:
    local group g = CreateGroup()
    local boolexpr b = Condition(function IsNotPaused)
    call GroupEnumUnitsInRect(g, GetPlayableMapRect(), b)
    set bj_pauseAllUnitsFlag = true
    call ForGroup(g, function PauseAllUnitsBJEnum)
    //Carry out cinematic
    set bj_pauseAllUnitsFlag = false
    call ForGroup(g, function PauseAllUnitsBJEnum)
    call DestroyGroup(g)
    call DestroyBoolExpr(b)
    set g = null
    set b = null

Note this won't unpause units paused by other triggers. At all. It won't touch them. So if you have spells that use pause, well, don't, it's a bad idea anyway, as paused units don't 'tick' down on buffs, etc.