- Dj0z wrote:
- hmmm.... i think i get it:
-so i have a 1 trigger running my cine and storing the 3 fields of data in globals.
-and i have another trigger detecting escape and re-displaying the stored data when someone presses esc.
Yet, it would still screw up the sound afaik. Maybe i could use some kinda timer re-started at every new scene,
and i would retrieve the elapsed time to know at which point the sound was being played, and re-start playing it from that offset whenever escape is pressed...
Yet again, I think there's an auto fading out on the sound when you press escape , which would overlap a little with the re-playing... Besides, i don't even know if lag etc won't screw it all up >.>
Well, when i got time (which i smost likely not before the weekend) ill give it a shot, After i set up the fate of hero-invul-to-units, ofc.
Well, I made a system that fixes it
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// DCCT //
// Don't Cancel Cinematic Text //
// ------------------------------------------------------------------------------------------------------------------ //
// By: lame.snow //
// //
// Goal: Ever made a cinematic to explain your game, just to find out that it just always instantly dissapears because //
// people spam escape, and then complain that they don't understand the game? This script solves that by reshowing//
// the text when it get's cancelled out. //
// How To Use: //
// Instead of using TransmissionFromUnitWithNameBJ, you use DCCT_TransmissionFromUnitWithName, //
// which uses exactly the same arguments. //
// And instead of using TransmissionFromUnitTypeWithNameBJ, you use DCCT_TransmissionFromUnitTypeWithName //
// *************************************************WARNING*********************************************** //
// DO NOT use the normal TransmissionFromUnitTypeWithNameBJ and TransmissionFromUnitWithNameBJ or this system //
// will not work. You have to change every single TransmissionFromUnitTypeWithNameBJ with the DCCT functions. //
// How It Works: //
// The normal BJ's register the 'skip' event and cancel the cinematic when it is pressed. The DCCT functions are //
// exact copies of those triggers, but without the registering. //
// //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
library DCCT
public function TransmissionFromUnitWithName takes force toForce, unit whichUnit, string unitName, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
//This Is the function that cancels the cinematic, comment it out, and cinematics can't be canceled
//call TryInitCinematicBehaviorBJ()
// 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 == null) 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
public function TransmissionFromUnitTypeWithName takes force toForce, player fromPlayer, integer unitId, string unitName, location loc, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
//This Is the function that cancels the cinematic, comment it out, and cinematics can't be canceled
//call TryInitCinematicBehaviorBJ()
// 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
endlibrary
How to use:
Instead of using TransmissionFromUnitWithNameBJ, you use DCCT_TransmissionFromUnitWithName, which uses exactly the same arguments. And instead of using TransmissionFromUnitTypeWithNameBJ, you use DCCT_TransmissionFromUnitTypeWithName. DO NOT use the normal TransmissionFromUnitTypeWithNameBJ and TransmissionFromUnitWithNameBJ or this system will not work. You have to change every single TransmissionFromUnitTypeWithNameBJ with the DCCT functions.
(Just copied out of my comments
)
EDIT: The system does require VJass, but I guess you have JassNewGenPack?