//============================================================================= // by turbo // jumps from current time to new specified time //============================================================================= class Turbogametrigger2 extends Triggers; var int StartTime; // var() int NewTime; // var() float ChangeTime; // How long does the change take? var GameTimeManager GTM; var float TimePassed; /* function BeginPlay() { TimePassed = 0; } */ function Trigger( Actor Other, Pawn EventInstigator ) { foreach AllActors( class 'GameTimeManager', GTM ) break; if ( GTM != None ) { TimePassed = 0; Enable('Tick'); } } simulated function Tick( float DeltaTime ) { local float CurrentTime, TimeRatio; StartTime=GTM.GameTime; //store starttime if ( GTM != None ) { // Check the timing TimePassed += DeltaTime; if ( TimePassed >= ChangeTime ) { TimeRatio = 1; Disable('Tick'); } else TimeRatio = TimePassed/ChangeTime; // Continue the fattening process CurrentTime = (Float(NewTime) - Float(StartTime))*TimeRatio + Float(StartTime); BroadcastMessage( CurrentTime ); GTM.GameTime = Int( CurrentTime ); } else Disable('Tick'); } defaultproperties { NewTime=100 changetime=10 }