Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

# MojoActions.TsActionGameSpeed

00001 00002 00003 00004 00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053

    class TsActionGameSpeed extends TsAction;

    var(Action) float gameSpeed;
    var(Action) float duration;
    var(Action) float easeIn;
    var(Action) float easeOut;

    var float baseGameSpeed;
    var float clampedGameSpeed;

    function bool OnStart()
    {
    	resetInterpolation(easeIn, duration, easeOut);

    	baseGameSpeed = actor.Level.TimeDilation;
    	clampedGameSpeed = FMax(gameSpeed, 0.1); // warfares code does this, so i guess we should too

    	return true;
    }

    function bool OnTick(float delta)
    {
    	local float alpha;
    	local bool bFinished;

    	bFinished = tickInterpolation(delta, alpha);

    	actor.Level.TimeDilation = baseGameSpeed + alpha * (clampedGameSpeed - baseGameSpeed);

    	return bFinished;
    }

    event bool SetDuration(float _duration)
    {
    	duration = _duration;
    	return true;
    }

    event float GetDuration()
    {
    	return Duration;
    }

    defaultproperties
    {
    	DName			="Game Speed"
    	Track			="Game Speed"
    	Help			="Sets the current game speed."
    	UsesDuration	=true

    	gameSpeed	=1.0
    	easeIn		=3.0
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: ne 5.9.2004 15:53:36.000 - Creation time: st 23.5.2018 00:10:49.265 - Created with UnCodeX