Worst-case scenario: the UEd Goblin wipes the map and burns down your house.

Difference between revisions of "Legacy:VariableTimedMover"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m (corrected a minor misspelling (verion to version))
m (link fix)
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
 
This version is for use with any number of Keys and in all Mover InitialStates.  Mover -> MoveTime becomes a multiplier for the VariableTimedMover -> KeyMoveTime array, so keep MoveTime at 1.0 to allow the KeyMoveTime values to represent seconds.
 
This version is for use with any number of Keys and in all Mover InitialStates.  Mover -> MoveTime becomes a multiplier for the VariableTimedMover -> KeyMoveTime array, so keep MoveTime at 1.0 to allow the KeyMoveTime values to represent seconds.
  
A test map file with this actor is available on this UnrealPlayground Forum thread: [http://forums.unrealplayground.com/showthread.php?t=36309 VariableTimedMover]
+
A test map file with this actor is available on this UnrealPlayground Forum thread: [http://unrealplayground.com/forums/showthread.php?t=36309 VariableTimedMover]
  
 
==Properties==
 
==Properties==
Line 16: Line 16:
 
==Source Code==
 
==Source Code==
  
<uscript>//=============================================================================
+
<div class="hidden-block"><span class="hint"><uscript>//=============================================================================</span><div class="hidden">// VariableTimedMover
// VariableTimedMover
+
 
// Allows custom MoveTimes per key (modified from a version by Fataloverdose)
 
// Allows custom MoveTimes per key (modified from a version by Fataloverdose)
 
// by SuperApe -- Sept 2005
 
// by SuperApe -- Sept 2005
Line 103: Line 102:
 
Super.KeyFrameReached();
 
Super.KeyFrameReached();
 
}
 
}
}</uscript>
+
}</uscript></div></div>
  
 
==Related Topics==
 
==Related Topics==
Line 115: Line 114:
 
   
 
   
  
[[Category:Legacy Custom Class|{{PAGENAME}}]]
+
[[Category:Legacy Custom Class (UT2004)|{{PAGENAME}}]]

Latest revision as of 08:59, 22 February 2012

UT2004 :: Actor >> Mover >> VariableTimedMover (custom)

This version is for use with any number of Keys and in all Mover InitialStates. Mover -> MoveTime becomes a multiplier for the VariableTimedMover -> KeyMoveTime array, so keep MoveTime at 1.0 to allow the KeyMoveTime values to represent seconds.

A test map file with this actor is available on this UnrealPlayground Forum thread: VariableTimedMover

Properties[edit]

Main[edit]

bool bActAsClientMover 
This mover will be disabled on Servers, just as ClientMover.
array<float> KeyMoveTime 
The time (multiplier of MoveTime) it takes to go from this key number to the next. (Tip: Keep MoveTime at 1.0 to allow the KeyMoveTime values to represent seconds.)

Hidden[edit]

array<float> KeyMoveSpeed 
The actual time in seconds it takes to go from this key number to the next.

Source Code[edit]

//=============================================================================</span><div class="hidden">// VariableTimedMover
// Allows custom MoveTimes per key (modified from a version by Fataloverdose)
// by SuperApe -- Sept 2005
//=============================================================================
class VariableTimedMover extends Mover;
 
var()		bool				bActAsClientMover;
var()		array<float>		KeyMoveTime;
var			array<float>		KeyMoveSpeed;
 
function PostBeginPlay()
{
	local	int		n;
 
	for ( n = 0; n < KeyMoveTime.length; n++ )
		KeyMoveSpeed[n] = KeyMoveTime[n] * MoveTime;
 
	Super.PostBeginPlay();
 
	MoveTime = KeyMoveSpeed[ KeyNum ];
 
	if ( bActAsClientMover && Level.NetMode == NM_DedicatedServer )
	{
		SetTimer( 0, false );
		SetPhysics( PHYS_None );
		GotoState('ServerIdle');
	}
}
 
simulated event KeyFrameReached()
{
	MoveTime = KeyMoveSpeed[ KeyNum ];
	Super.KeyFrameReached();
}
 
function DoOpen()
{
	MoveTime = KeyMoveSpeed[ KeyNum ];
	Super.DoOpen();
}
 
function DoClose()
{                                                   
	MoveTime = KeyMoveSpeed[ KeyNum ];
	Super.DoClose();
}
 
state ServerIdle
{
	// Do nothing on the Server
}
 
state() LoopMove
{
	event KeyFrameReached()
	{
		MoveTime = KeyMoveSpeed[ KeyNum ];
		Super.KeyFrameReached();
	}
}
 
state() ConstantLoop
{
	event KeyFrameReached()
	{
		MoveTime = KeyMoveSpeed[ KeyNum ];
		Super.KeyFrameReached();
	}
}
 
state() LeadInOutLooper
{
	event KeyFrameReached()
	{
		MoveTime = KeyMoveSpeed[ KeyNum ];
		Super.KeyFrameReached();
	}
}
 
state LeadInOutLooping
{
	event KeyFrameReached()
	{
		MoveTime = KeyMoveSpeed[ KeyNum ];
		Super.KeyFrameReached();
	}
}

Related Topics[edit]

Discussion[edit]