HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Turning off or localizing Cinematic Skipping

06-06-2008, 11:00 PM#1
Burning Rose
So in my map I have an opening tutorial by cinematic that people can choose to view. It all runs nice and smooth, and people like it, except that sometimes people like to press ESC, which skips the transmission for everyone. When told that it does such, some people stop, while others do it more. I've expiremented with ways to discourage it, but I'd prefer a way to turn off Cinematic Skipping, or to localize the transmissions so that individual players will only skip the transmissions for themselves. Any Ideas?
06-06-2008, 11:17 PM#2
PurgeandFire111
It is definitely possible, but you are approaching it the wrong way. Why make it so that you can skip the transmission? Transmissions are a BJ, and they call something called "TryInitCinematicBehaviorBJ()". This function, creates a new trigger (if one hasn't been created) and will register an ESC event, then you can skip it like that. Well, I don't feel like optimizing anything so here is an Unskippable Transmission.
Collapse JASS:
function TransmissionFromUnitWithNameBJ takes force toForce, unit whichUnit, string unitName, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
    // Ensure that the time value is non-negative.
    set timeVal = RMaxBJ(timeVal,0)

    set bj_lastTransmissionDuration = GetTransmissionDuration(soundHandle, timeType, timeVal)
    set bj_lastPlayedSound = soundHandle

    if IsPlayerInForce(GetLocalPlayer(), toForce) then
        // Use only local code (no net traffic) within this block to avoid desyncs.

        if whichUnit == nul) then
            // If the unit reference is invalid, send the transmission from the center of the map with no portrait.
            call DoTransmissionBasicsXYBJ(0, PLAYER_COLOR_RED, 0, 0, soundHandle, unitName, message, bj_lastTransmissionDuration)
        else
            call DoTransmissionBasicsXYBJ(GetUnitTypeId(whichUnit), GetPlayerColor(GetOwningPlayer(whichUnit)), GetUnitX(whichUnit), GetUnitY(whichUnit), soundHandle, unitName, message, bj_lastTransmissionDuration)
            if not IsUnitHidden(whichUnit) then
                call UnitAddIndicator(whichUnit, bj_TRANSMISSION_IND_RED, bj_TRANSMISSION_IND_BLUE, bj_TRANSMISSION_IND_GREEN, bj_TRANSMISSION_IND_ALPHA)
            endif
        endif
    endif
    if wait and (bj_lastTransmissionDuration > 0) then
        // call TriggerSleepAction(bj_lastTransmissionDuration)
        call WaitTransmissionDuration(soundHandle, timeType, timeVal)
    endif
endfunction

This creates a transmission from a placed specific unit.
Collapse JASS:
function TransmissionFromUnitTypeWithNameBJ takes force toForce, player fromPlayer, integer unitId, string unitName, location loc, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
    // Ensure that the time value is non-negative.
    set timeVal = RMaxBJ(timeVal, 0)
    set bj_lastTransmissionDuration = GetTransmissionDuration(soundHandle, timeType, timeVal)
    set bj_lastPlayedSound = soundHandle
    if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
        // Use only local code (no net traffic) within this block to avoid desyncs.
        call DoTransmissionBasicsXYBJ(unitId, GetPlayerColor(fromPlayer), GetLocationX(loc), GetLocationY(loc), soundHandle, unitName, message, bj_lastTransmissionDuration)
    endif
    if wait and (bj_lastTransmissionDuration > 0) then
        // call TriggerSleepAction(bj_lastTransmissionDuration)
        call WaitTransmissionDuration(soundHandle, timeType, timeVal)
    endif
endfunction

Creates a transmission from a unit type.

Enjoy. :)
06-07-2008, 03:36 PM#3
Burning Rose
Hmmm... Cool. Thanks.
:D

Does that wait function work with the whole trigger?
Nevermind, I don't need it to anyways >_>