Spoiler
IYcRCWcYC_8
> The actor is supposed to adjust a switch statement via a function call in state code once the scripted pawn reaches its location. Instead, I think it is always attempting to move in one spot, as the camera is practically vibrating in place, which is only observable due to the camera being the actor the player views through.
> If the player is given a new set of coordinates via a specific trigger (all that matters out of this is the new location), the camera will then instead begin to move to this new location if it is already in the process of moving.
I also have a zone written up, but for some reason I am noticing that when I touch the zone, I am getting two zone checks each time my pawn either enters or exits the zone, said zone is what tells said player's camera to move. I'm going to have to post both codes (spoiler'd) and a visual demonstration of what I am talking about. This is my first attempt at any zone actors or changing the camera from a pawn to a scripted pawn for the latent functions.
Here is the state code in Camera:
Spoiler
Code: Select all
Begin:
if ( LocalPlayer == none && !FindLocalPlayer() )
{
Sleep(0.0);
Goto('Begin');
}
if ( LocalPlayer.Health <= 0 )
{
self.Velocity = vect(0.0,0.0,0.0);
self.Acceleration = vect(0.0,0.0,0.0);
}
SetPhysics( PHYS_Flying);
CheckViewTarget:
LocalPlayer.ViewTarget = self;
LocalPlayer.bBehindView = false;
self.bBehindView = false;
Move:
if ( self.Location == NewLoc || CameraMode != CM_MoveTransition )
{
bTransitionMoving = false;
Velocity = vect(0.0,0.0,0.0);
Acceleration = vect(0.0,0.0,0.0);
SetLocation( NewLoc );
sleep(0.0);
GoTo('Reset');
}
if ( CameraMode == CM_MoveTransition )
{
//Velocity = Vector(Rotation) * 100.0;
//Acceleration = AccelRate * Normal(NewLoc - Location);
Acceleration = AccelRate * Normal(NewLoc - Location);
StrafeTo(NewLoc, LocalPlayer.Location);
//MoveTo(NewLoc, Airspeed);
sleep(0.0);
GoTo('Move');
}
Reset:
if ( CameraMode == CM_MoveTransition )
{
LockMovement();
CamCueueAdjust();
}
sleep(0.0);
GoTo('Begin');
}
//Unrealscript functions always have a return value, said value is zero'd before function call.
//Meaning, if we return nothing, the function still return False
function bool FindLocalPlayer()
{
local PlayerPawn P;
ForEach AllActors (class'PlayerPawn', P)
if ( ViewPort(P.Player) != none )
{
LocalPlayer = P;
return true;
}
}
function UnlockMovement()
{
if ( bCamXAxisLock )
{
bTempXLock = true;
bCamXAxisLock = false;
}
if ( bCamYAxisLock )
{
bTempYLock = true;
bCamYAxisLock = false;
}
if ( bCamZAxisLock )
{
bTempZLock = true;
bCamZAxisLock = false;
}
}
Function LockMovement()
{
if ( bTempXLock )
{
bCamXAxisLock = true;
bTempXLock = false;
}
if ( bTempYLock )
{
bCamYAxisLock = true;
bTempYLock = false;
}
if ( bTempZLock )
{
bCamZAxisLock = true;
bTempZLock = false;
}
}
function CamCueueAdjust()
{
switch CamCueue
{
case CM_Track1:
CameraMode = CM_Track1;
break;
case CM_Track2:
CameraMode = CM_Track2;
break;
case CM_CustomCamDistance1:
CameraMode = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
CameraMode = CM_CustomCamDistance2;
break;
case CM_MoveTransition:
CameraMode = CM_MoveTransition;
default:
break;
}
}
Spoiler
Code: Select all
//=============================================================================
// RPG_Camera.
// Operates independently now
// There should only be one camera
//=============================================================================
class RPG_Camera extends ScriptedPawn;
//Some dummy Camera values that might be coded at a later date
enum ECamMode
{
CM_Track1,
CM_Track2,
CM_CustomCamDistance1, // Track player relative to "TrackCustomDistance", which sets distance.
CM_CustomCamDistance2,
CM_MoveTransition
};
var() ECamMode CameraMode;
enum ECamCueue
{
CM_Track1,
CM_Track2,
CM_CustomCamDistance1, // Track player relative to "TrackCustomDistance", which sets distance.
CM_CustomCamDistance2,
CM_MoveTransition
};
var() ECamCueue CamCueue;
// The visible properties are kept here to allow map save/loading as well as letting the mapper
// specify the initial camera mode without using a trigger
var PlayerPawn LocalPlayer;
var(Sounds) sound Test;
var() float CamDistance;
var bool bTransitionMoving;
var() bool bCamXAxisLock;
var() bool bCamYAxisLock;
var() bool bCamZAxisLock;
var bool bTempXLock;
var bool bTempYLock;
var bool bTempZLock;
var() bool bRestorePitch;
var() bool bRestoreYaw;
var() bool bRestoreRoll;
var bool bNewLoc;
var float TargetDistance;
var vector NewLoc;
var vector adjust;
// These already exist, putting these here for informative purposes:
// var (Movement) rotator DesiredRotation;
// var (Movement) rotator RotationRate;
// var float EyeHeight; //From actor, namely, your player pawn, this is the height offset the player's first person view camera is placed at (don't think you'll be needing this)
// var rotator Rotation; // From actor, namely, your player pawn
// var vector Location; // From actor, namely, your player pawn
var carcass carc;
// Disabling some superclass functions
function ClientDying(name DamageType, vector HitLocation);
function ClientGameEnded();
function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType);
function Died(pawn Killer, name damageType, vector HitLocation);
event FellOutOfWorld();
//======================================================================================
event PostBeginPlay()
{
Super.PostBeginPlay();
//The rotation the mapper uses will be the initial rotation
DesiredRotation = Rotation;
ViewRotation = Rotation;
TargetDistance = CamDistance;
AccelRate = 1000;
}
//======================================================================================
// CAMERA STATE - ONLY STATE THAT SHOULD BE USED FOR THIS ACTOR
// > THIS ACTOR'S ONLY JOB IS TO BE USED AS AN EXTERNAL FREE MOVING THIRD PERSON CAMERA
// [ToDo]: LINEAR INTERPOLATION AND SMOOTHING FRAMES
// () makes it appear as a selectable InitialState in the editor.
//======================================================================================
auto state Camera
{
ignores SeePlayer, HearNoise;
function EndState()
{
super.EndState();
}
// Higor: This event is called by the player when viewing this actor in first person view
event Tick( float DeltaTime )
{
// local rotator View;
local int OldYaw;
local int OldPitch;
local int OldRoll;
bCanFire = false;
SpecialGoal = None;
SpecialPause = 0.0;
if ( !bTransitionMoving )
if ( LocalPlayer == none )
return;
switch CameraMode
{
//=============================================================================
case CM_Track1: // The camera tracks the local player at a fixed x and y point, moving only by it's z axis.
OldPitch = DesiredRotation.Pitch;
OldYaw = DesiredRotation.Yaw; // Conserve DesiredRotation's yaw
OldRoll = DesiredRotation.Roll;
if ( bCamXAxisLock )
NewLoc.X = Location.X;
else if ( !bCamXAxisLock )
NewLoc.X = LocalPlayer.Location.X - vector(DesiredRotation).X * VSize(Location - LocalPlayer.Location);
if ( bCamYAxisLock )
NewLoc.Y = Location.Y;
else if ( !bCamYAxisLock )
NewLoc.Y = LocalPlayer.Location.Y - vector(DesiredRotation).Y * VSize(Location - LocalPlayer.Location);
if ( bCamZAxisLock )
NewLoc.Z = Location.Z;
else if ( !bCamZAxisLock )
NewLoc.Z = LocalPlayer.Location.Z - vector(DesiredRotation).Z * VSize(Location - LocalPlayer.Location);
DesiredRotation = rotator( LocalPlayer.Location - Location);
if ( bRestorePitch == true)
DesiredRotation.Pitch = OldPitch; // Restore pitch
if ( bRestoreYaw == true)
DesiredRotation.Yaw = OldYaw; // Restore yaw
if ( bRestoreRoll == true)
DesiredRotation.Roll = OldRoll;
SetLocation( NewLoc );
SetRotation( DesiredRotation );
break;
//=============================================================================
case CM_Track2: // The camera tracks the local player at a fixed x and y point, moving only by it's z axis.
OldPitch = DesiredRotation.Pitch;
OldYaw = DesiredRotation.Yaw; // Conserve DesiredRotation's yaw
OldRoll = DesiredRotation.Roll;
if ( bCamXAxisLock )
NewLoc.X = Location.X;
else if ( !bCamXAxisLock )
NewLoc.X = LocalPlayer.Location.X - vector(DesiredRotation).X * VSize(Location - LocalPlayer.Location);
if ( bCamYAxisLock )
NewLoc.Y = Location.Y;
else if ( !bCamYAxisLock )
NewLoc.Y = LocalPlayer.Location.Y - vector(DesiredRotation).Y * VSize(Location - LocalPlayer.Location);
if ( bCamZAxisLock )
NewLoc.Z = Location.Z;
else if ( !bCamZAxisLock )
NewLoc.Z = LocalPlayer.Location.Z - vector(DesiredRotation).Z * VSize(Location - LocalPlayer.Location);
DesiredRotation = rotator( LocalPlayer.Location - Location);
if ( bRestorePitch == true)
DesiredRotation.Pitch = OldPitch; // Restore pitch
if ( bRestoreYaw == true)
DesiredRotation.Yaw = OldYaw; // Restore yaw
if ( bRestoreRoll == true)
DesiredRotation.Roll = OldRoll;
SetLocation( NewLoc );
SetRotation( DesiredRotation );
break;
//=============================================================================
case CM_CustomCamDistance1:
if ( TargetDistance < CamDistance ) // Interpolate camera distance in a very arbitrary way
CamDistance = fMax( CamDistance - LocalPlayer.GroundSpeed * 0.2 * DeltaTime, TargetDistance);
else if ( TargetDistance > CamDistance )
CamDistance = fMin( CamDistance + LocalPlayer.GroundSpeed * 0.2 * DeltaTime, TargetDistance);
NewLoc = LocalPlayer.Location - vector(DesiredRotation) * CamDistance;
SetLocation( NewLoc);
break;
//=============================================================================
case CM_CustomCamDistance2:
if ( TargetDistance < CamDistance ) // Interpolate camera distance in a very arbitrary way
CamDistance = fMax( CamDistance - LocalPlayer.GroundSpeed * 0.2 * DeltaTime, TargetDistance);
else if ( TargetDistance > CamDistance )
CamDistance = fMin( CamDistance + LocalPlayer.GroundSpeed * 0.2 * DeltaTime, TargetDistance);
NewLoc = LocalPlayer.Location - vector(DesiredRotation) * CamDistance;
SetLocation(NewLoc);
break;
//=============================================================================
case CM_MoveTransition:
bTransitionMoving = true;
UnlockMovement();
break;
//=============================================================================
default:
break;
}
}
//=============================================================================
// Latent Code
//=============================================================================
Begin:
if ( LocalPlayer == none && !FindLocalPlayer() )
{
Sleep(0.0);
Goto('Begin');
}
if ( LocalPlayer.Health <= 0 )
{
self.Velocity = vect(0.0,0.0,0.0);
self.Acceleration = vect(0.0,0.0,0.0);
}
SetPhysics( PHYS_Flying);
CheckViewTarget:
LocalPlayer.ViewTarget = self;
LocalPlayer.bBehindView = false;
self.bBehindView = false;
Move:
if ( self.Location == NewLoc || CameraMode != CM_MoveTransition )
{
bTransitionMoving = false;
Velocity = vect(0.0,0.0,0.0);
Acceleration = vect(0.0,0.0,0.0);
SetLocation( NewLoc );
sleep(0.0);
GoTo('Reset');
}
if ( CameraMode == CM_MoveTransition )
{
//Velocity = Vector(Rotation) * 100.0;
//Acceleration = AccelRate * Normal(NewLoc - Location);
Acceleration = AccelRate * Normal(NewLoc - Location);
StrafeTo(NewLoc, LocalPlayer.Location);
//MoveTo(NewLoc, Airspeed);
sleep(0.0);
GoTo('Move');
}
Reset:
if ( CameraMode == CM_MoveTransition )
{
LockMovement();
CamCueueAdjust();
}
sleep(0.0);
GoTo('Begin');
}
//Unrealscript functions always have a return value, said value is zero'd before function call.
//Meaning, if we return nothing, the function still return False
function bool FindLocalPlayer()
{
local PlayerPawn P;
ForEach AllActors (class'PlayerPawn', P)
if ( ViewPort(P.Player) != none )
{
LocalPlayer = P;
return true;
}
}
function UnlockMovement()
{
if ( bCamXAxisLock )
{
bTempXLock = true;
bCamXAxisLock = false;
}
if ( bCamYAxisLock )
{
bTempYLock = true;
bCamYAxisLock = false;
}
if ( bCamZAxisLock )
{
bTempZLock = true;
bCamZAxisLock = false;
}
}
Function LockMovement()
{
if ( bTempXLock )
{
bCamXAxisLock = true;
bTempXLock = false;
}
if ( bTempYLock )
{
bCamYAxisLock = true;
bTempYLock = false;
}
if ( bTempZLock )
{
bCamZAxisLock = true;
bTempZLock = false;
}
}
function CamCueueAdjust()
{
switch CamCueue
{
case CM_Track1:
CameraMode = CM_Track1;
break;
case CM_Track2:
CameraMode = CM_Track2;
break;
case CM_CustomCamDistance1:
CameraMode = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
CameraMode = CM_CustomCamDistance2;
break;
case CM_MoveTransition:
CameraMode = CM_MoveTransition;
default:
break;
}
}
defaultproperties
{
Physics=PHYS_Flying
bBlockActors=false
bBlockPlayers=false
bCollideActors=false
bCollideWorld=false
bProjTarget=false
bCanStrafe=true
CollisionHeight=0.0
CollisionRadius=0.0
// fovangle=30.0//150.0
AccelRate=1000
bHidden=true
bEdShouldSnap=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_Camera'
Test=Sound'RPG_Sounds.RPG_LaserFire'
Style=STY_Masked
}
Spoiler
Code: Select all
//=============================================================================
// RPG_CameraOpZone.
//=============================================================================
class RPG_CameraOpZone extends ZoneInfo;
var RPG_Camera ActiveCamera;
enum ECamMode
{
CM_Track1,
CM_Track2,
CM_CustomCamDistance1,
CM_CustomCamDistance2,
CM_MoveTransition
};
var ECamMode NewCameraMode;
enum EVect1CamMode
{
CM_None,
CM_Track1,
CM_Track2,
CM_CustomCamDistance1,
CM_CustomCamDistance2
};
var() EVect1CamMode Vect1CamMode;
enum EVect2CamMode
{
CM_None,
CM_Track1,
CM_Track2,
CM_CustomCamDistance1,
CM_CustomCamDistance2
};
var() EVect2CamMode Vect2CamMode;
enum EVect3CamMode
{
CM_None,
CM_Track1,
CM_Track2,
CM_CustomCamDistance1,
CM_CustomCamDistance2
};
var() EVect3CamMode Vect3CamMode;
enum EVect4CamMode
{
CM_None,
CM_Track1,
CM_Track2,
CM_CustomCamDistance1,
CM_CustomCamDistance2
};
var() EVect4CamMode Vect4CamMode;
var RPG_PlatformPawn LocalPlayer;
//var() byte TriggerGroupID; // Used for when CameraSwitchers are to be used as a trigger. Used to prevent triggers from constantly firing.
//var() float TriggerGroupScanDist;
//var() float SmoothFactor; // To be described later
var byte SharedCameraID;
var() float TrackCustomDistance;
var() rotator NewRotation;
var vector NewCamLoc; // For fixed or X,Y track mode, if Zero, use camera's current
//var() bool bSmoothTransition;
var() bool bCamXAxisLock;
var() bool bCamYAxisLock;
var() bool bCamZAxisLock;
var() bool bRestorePitch;
var() bool bRestoreYaw;
var() bool bRestoreRoll;
var() bool bInstantLocTransition;
//=====================================
// What SharedCameraID will be set to
//=====================================
var(RPG_CamLoc1) byte CamID1;
var(RPG_CamLoc2) byte CamID2;
var(RPG_CamLoc3) byte CamID3;
var(RPG_CamLoc4) byte CamID4;
//=====================================
// New Camera Position
//=====================================
var(RPG_CamLoc1) vector CamAngle1;
var(RPG_CamLoc2) vector CamAngle2;
var(RPG_CamLoc3) vector CamAngle3;
var(RPG_CamLoc4) vector CamAngle4;
//=====================================
// Position Pawn Needs To Be In For Camera Position Change
//=====================================
var(RPG_CamLoc1) vector MoveCamVector1;
var(RPG_CamLoc2) vector MoveCamVector2;
var(RPG_CamLoc3) vector MoveCamVector3;
var(RPG_CamLoc4) vector MoveCamVector4;
//=====================================
// Should Position Be Checked
//=====================================
var(RPG_CamLoc1) bool bCheckCamVector1;
var(RPG_CamLoc2) bool bCheckCamVector2;
var(RPG_CamLoc3) bool bCheckCamVector3;
var(RPG_CamLoc4) bool bCheckCamVector4;
//=====================================
// Checks Player's X Coordinate
// Pos: If Player X is Greater Than Position X
// Neg: If Player X Is Less Than Position X
//=====================================
var(RPG_CamLoc1) bool bCheckPlayer_X_Pos_1;
var(RPG_CamLoc2) bool bCheckPlayer_X_Pos_2;
var(RPG_CamLoc3) bool bCheckPlayer_X_Pos_3;
var(RPG_CamLoc4) bool bCheckPlayer_X_Pos_4;
var(RPG_CamLoc1) bool bCheckPlayer_X_Neg_1;
var(RPG_CamLoc2) bool bCheckPlayer_X_Neg_2;
var(RPG_CamLoc3) bool bCheckPlayer_X_Neg_3;
var(RPG_CamLoc4) bool bCheckPlayer_X_Neg_4;
//=====================================
// Checks Player's Y Coordinate
//=====================================
var(RPG_CamLoc1) bool bCheckPlayer_Y_Pos_1;
var(RPG_CamLoc2) bool bCheckPlayer_Y_Pos_2;
var(RPG_CamLoc3) bool bCheckPlayer_Y_Pos_3;
var(RPG_CamLoc4) bool bCheckPlayer_Y_Pos_4;
var(RPG_CamLoc1) bool bCheckPlayer_Y_Neg_1;
var(RPG_CamLoc2) bool bCheckPlayer_Y_Neg_2;
var(RPG_CamLoc3) bool bCheckPlayer_Y_Neg_3;
var(RPG_CamLoc4) bool bCheckPlayer_Y_Neg_4;
//=====================================
// Checks Player's Z Coordinate
//=====================================
var(RPG_CamLoc1) bool bCheckPlayer_Z_Pos_1;
var(RPG_CamLoc2) bool bCheckPlayer_Z_Pos_2;
var(RPG_CamLoc3) bool bCheckPlayer_Z_Pos_3;
var(RPG_CamLoc4) bool bCheckPlayer_Z_Pos_4;
var(RPG_CamLoc1) bool bCheckPlayer_Z_Neg_1;
var(RPG_CamLoc2) bool bCheckPlayer_Z_Neg_2;
var(RPG_CamLoc3) bool bCheckPlayer_Z_Neg_3;
var(RPG_CamLoc4) bool bCheckPlayer_Z_Neg_4;
//=============================================================================
// General functionality
//=============================================================================
event ActorEntered( actor Other )
{
local Triggers Trigger;
super.ActorEntered( Other );
if ( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
{
LocalPlayer = RPG_PlatformPawn(Other);
ForEach ZoneActors ( class'Triggers', Trigger )
{
if ( Trigger.tag == self.tag )
{
if ( Trigger.bCollideActors != true )
{
Trigger.SetCollision(true, false, false);
}
}
}
if ( (Other.IsA('RPG_PlatformPawn') ) && (LocalPlayer != none) && (ViewPort(LocalPlayer.Player) != none) )
{
if ( HasActiveCamera() )
{
if ( Self.Event != '' )
TriggerEvent( Event, self, Pawn(Other) );
if ( SharedCameraID != LocalPlayer.OldCamID )
{
CheckPlayerLoc();
SetCameraMode();
//SetTimer(1, false);
}
else if ( SharedCameraID == LocalPlayer.OldCamID ) // If the current camera is set to the mode a camera switcher is set to, that isn't CM_Fixed,
{
return;
}
}
}
}
}
// @Override
event ActorLeaving( actor Other )
{
local Triggers Trigger;
super.ActorLeaving( Other );
if ( Pawn(Other)!=None && Pawn(Other).bIsPlayer )
{
//SetTimer(0.5, false);
CheckPlayerLoc();
SetCameraMode();
if ( --ZonePlayerCount==0 )
{
ForEach ZoneActors ( class'Triggers', Trigger )
{
if ( Trigger.event == self.tag )
{
if ( Trigger.bCollideActors != false )
{
Trigger.SetCollision(false, false, false);
}
}
}
}
}
}
//=============================================================================
// Check local player's location
//=============================================================================
function CheckPlayerLoc()
{
if ( bCheckCamVector1 == true )
{
if ( bCheckPlayer_X_Pos_1 && (LocalPlayer.Location.X >= MoveCamVector1.X) )
{
NewCamLoc = CamAngle1;
SharedCameraID = CamID1;
}
if ( bCheckPlayer_X_Neg_1 && (LocalPlayer.Location.X <= MoveCamVector1.X) )
{
NewCamLoc = CamAngle1;
SharedCameraID = CamID1;
}
if ( bCheckPlayer_Y_Pos_1 && (LocalPlayer.Location.Y >= MoveCamVector1.Y) )
{
NewCamLoc = CamAngle1;
SharedCameraID = CamID1;
}
if ( bCheckPlayer_Y_Neg_1 && (LocalPlayer.Location.Y <= MoveCamVector1.Y) )
{
NewCamLoc = CamAngle1;
SharedCameraID = CamID1;
}
if ( bCheckPlayer_Z_Pos_1 && (LocalPlayer.Location.Z >= MoveCamVector1.Z) )
{
NewCamLoc = CamAngle1;
SharedCameraID = CamID1;
}
if ( bCheckPlayer_Z_Neg_1 && (LocalPlayer.Location.Z <= MoveCamVector1.Z) )
{
NewCamLoc = CamAngle1;
SharedCameraID = CamID1;
}
}
if ( bCheckCamVector2 == true )
{
if ( bCheckPlayer_X_Pos_2 && (LocalPlayer.Location.X >= MoveCamVector2.X) )
{
NewCamLoc = CamAngle2;
SharedCameraID = CamID2;
}
if ( bCheckPlayer_X_Neg_2 && (LocalPlayer.Location.X <= MoveCamVector2.X) )
{
NewCamLoc = CamAngle2;
SharedCameraID = CamID2;
}
if ( bCheckPlayer_Y_Pos_2 && (LocalPlayer.Location.Y >= MoveCamVector2.Y) )
{
NewCamLoc = CamAngle2;
SharedCameraID = CamID2;
}
if ( bCheckPlayer_Y_Neg_2 && (LocalPlayer.Location.Y <= MoveCamVector2.Y) )
{
NewCamLoc = CamAngle2;
SharedCameraID = CamID2;
}
if ( bCheckPlayer_Z_Pos_2 && (LocalPlayer.Location.Z >= MoveCamVector2.Z) )
{
NewCamLoc = CamAngle2;
SharedCameraID = CamID2;
}
if ( bCheckPlayer_Z_Neg_2 && (LocalPlayer.Location.Z <= MoveCamVector2.Z) )
{
NewCamLoc = CamAngle2;
SharedCameraID = CamID2;
}
}
if ( bCheckCamVector3 == true )
{
if ( bCheckPlayer_X_Pos_3 && (LocalPlayer.Location.X >= MoveCamVector3.X) )
{
NewCamLoc = CamAngle3;
SharedCameraID = CamID3;
}
if ( bCheckPlayer_X_Neg_3 && (LocalPlayer.Location.X <= MoveCamVector3.X) )
{
NewCamLoc = CamAngle3;
SharedCameraID = CamID3;
}
if ( bCheckPlayer_Y_Pos_3 && (LocalPlayer.Location.Y >= MoveCamVector3.Y) )
{
NewCamLoc = CamAngle3;
SharedCameraID = CamID3;
}
if ( bCheckPlayer_Y_Neg_3 && (LocalPlayer.Location.Y <= MoveCamVector3.Y) )
{
NewCamLoc = CamAngle3;
SharedCameraID = CamID3;
}
if ( bCheckPlayer_Z_Pos_3 && (LocalPlayer.Location.Z >= MoveCamVector3.Z) )
{
NewCamLoc = CamAngle3;
SharedCameraID = CamID3;
}
if ( bCheckPlayer_Z_Neg_3 && (LocalPlayer.Location.Z <= MoveCamVector3.Z) )
{
NewCamLoc = CamAngle3;
SharedCameraID = CamID3;
}
}
if ( bCheckCamVector4 == true )
{
if ( bCheckPlayer_X_Pos_4 && (LocalPlayer.Location.X >= MoveCamVector4.X) )
{
NewCamLoc = CamAngle4;
SharedCameraID = CamID4;
}
if ( bCheckPlayer_X_Neg_4 && (LocalPlayer.Location.X <= MoveCamVector4.X) )
{
NewCamLoc = CamAngle4;
SharedCameraID = CamID4;
}
if ( bCheckPlayer_Y_Pos_4 && (LocalPlayer.Location.Y >= MoveCamVector4.Y) )
{
NewCamLoc = CamAngle4;
SharedCameraID = CamID4;
}
if ( bCheckPlayer_Y_Neg_4 && (LocalPlayer.Location.Y <= MoveCamVector4.Y) )
{
NewCamLoc = CamAngle4;
SharedCameraID = CamID4;
}
if ( bCheckPlayer_Z_Pos_4 && (LocalPlayer.Location.Z >= MoveCamVector4.Z) )
{
NewCamLoc = CamAngle4;
SharedCameraID = CamID4;
}
if ( bCheckPlayer_Z_Neg_4 && (LocalPlayer.Location.Z <= MoveCamVector4.Z) )
{
NewCamLoc = CamAngle4;
SharedCameraID = CamID4;
}
}
}
//=============================================================================
// Camera Adjustment
//=============================================================================
function SetCameraMode()
{
if ( ActiveCamera == none )
return;
//============================================================================================
if ( bCheckCamVector1 )
{
switch Vect1CamMode
{
case CM_None:
break;
case CM_Track1:
NewCameraMode = CM_Track1;
break;
case CM_Track2:
NewCameraMode = CM_Track2;
break;
case CM_CustomCamDistance1:
NewCameraMode = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
NewCameraMode = CM_CustomCamDistance2;
break;
default:
break;
}
}
//======================
if ( bCheckCamVector2 )
{
switch Vect2CamMode
{
case CM_None:
break;
case CM_Track1:
NewCameraMode = CM_Track1;
break;
case CM_Track2:
NewCameraMode = CM_Track2;
break;
case CM_CustomCamDistance1:
NewCameraMode = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
NewCameraMode = CM_CustomCamDistance2;
break;
default:
break;
}
}
//======================
if ( bCheckCamVector3 )
{
switch Vect3CamMode
{
case CM_None:
break;
case CM_Track1:
NewCameraMode = CM_Track1;
break;
case CM_Track2:
NewCameraMode = CM_Track2;
break;
case CM_CustomCamDistance1:
NewCameraMode = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
NewCameraMode = CM_CustomCamDistance2;
break;
default:
break;
}
}
//======================
if ( bCheckCamVector4 )
{
switch Vect4CamMode
{
case CM_None:
break;
case CM_Track1:
NewCameraMode = CM_Track1;
break;
case CM_Track2:
NewCameraMode = CM_Track2;
break;
case CM_CustomCamDistance1:
NewCameraMode = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
NewCameraMode = CM_CustomCamDistance2;
break;
default:
break;
}
}
//======================
switch NewCameraMode
{
case CM_Track1:
ActiveCamera.CamCueue = CM_Track1;
break;
case CM_Track2:
ActiveCamera.CamCueue = CM_Track2;
break;
case CM_CustomCamDistance1:
ActiveCamera.CamCueue = CM_CustomCamDistance1;
break;
case CM_CustomCamDistance2:
ActiveCamera.CamCueue = CM_CustomCamDistance2;
break;
case CM_MoveTransition:
ActiveCamera.CamCueue = CM_MoveTransition;
default:
break;
}
//============================================================================================
if ( SharedCameraID != LocalPlayer.CurCamID )
{
ActiveCamera.TargetDistance = TrackCustomDistance; //Linear distance interpolation
ActiveCamera.DesiredRotation = NewRotation; //Linear rotation interpolation (layer 1) towards this orientation
ActiveCamera.bCamXAxisLock = bCamXAxisLock;
ActiveCamera.bCamYAxisLock = bCamYAxisLock;
ActiveCamera.bCamZAxisLock = bCamZAxisLock;
ActiveCamera.bRestorePitch = bRestorePitch;
ActiveCamera.bRestoreYaw = bRestoreYaw;
ActiveCamera.bRestoreRoll = bRestoreRoll;
if ( bInstantLocTransition )
{
if ( ActiveCamera.CameraMode == CM_MoveTransition )
ActiveCamera.CamCueueAdjust();
ActiveCamera.SetLocation( NewCamLoc);
ActiveCamera.SetRotation( ActiveCamera.DesiredRotation);
ActiveCamera.ViewRotation = ActiveCamera.DesiredRotation;
ActiveCamera.CamDistance = TrackCustomDistance;
ActiveCamera.CamCueueAdjust();
ActiveCamera.Tick(0.0); //Force immediate camera update
}
if ( !bInstantLocTransition )
{
if ( ActiveCamera.CameraMode != CM_MoveTransition )
ActiveCamera.CameraMode = CM_MoveTransition;
if ( ActiveCamera.bTransitionMoving == false )
{
ActiveCamera.NewLoc = NewCamLoc;
ActiveCamera.SetRotation( ActiveCamera.DesiredRotation);
ActiveCamera.ViewRotation = ActiveCamera.DesiredRotation;
ActiveCamera.CamDistance = TrackCustomDistance;
}
}
LocalPlayer.OldCamID = LocalPlayer.CurCamID;
LocalPlayer.CurCamID = SharedCameraID;
}
}
function bool HasActiveCamera()
{
if ( ActiveCamera != none )
return true;
//No camera, find it
ForEach AllActors (class'RPG_Camera', ActiveCamera)
return true;
}
defaultproperties
{
bHidden=true
bEdShouldSnap=True
DrawType=DT_Sprite
Texture=Texture'Engine.S_SpecialEvent'
Style=STY_Masked
}