Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 |
//============================================================================= // The Unreal Director's Suite Release version: Jan 7th, 1999 //============================================================================= // // [ CS_PlayerMoveTo ] // // Will direct a player to move towards a Spike tape. //============================================================================= class CS_PlayerMoveTo expands CutSeq; var() bool bIgnorePitchNRoll; var() vector NewVelocity; var CSPlayer MyPlayer; var CS_SpikeTape MySpike; function Trigger(actor Other, pawn EventInstigator) { local rotator NewRotation; local CS_SpikeTape ST,NewTarget; CSTrackAction("CS_PlayerMoveTo"); // Have the player Turn Towards the Spike Tape CSLog("Adjusting Rotation for: "$EventInstigator); foreach AllActors(class 'CS_SpikeTape',ST,Event) { NewRotation = rotator(ST.Location - CSPlayer(EventInstigator).Location); if (bIgnorePitchNRoll) { NewRotation.Pitch = CSPlayer(EventInstigator).Rotation.Pitch; NewRotation.Roll = CSPlayer(EventInstigator).Rotation.Roll; } CSLog("Spike Found: "$St); ST.SetInUse(); NewTarget = ST; } CSPlayer(EventInstigator).SetRotation(NewRotation); CSPlayer(EventInstigator).CSMoveTarget = NewTarget; CSPlayer(EventInstigator).CSShotList = CS_ShotList(Other); CSPlayer(EventInstigator).ScriptedMove(NewVelocity); MySpike = NewTarget; MyPlayer = CSPlayer(EventInstigator); CSLog("We are now tracking movement for "$MyPlayer); GotoState('TrackPlayer'); } // The TrackPlayer state is needed since the player pawns are handled very differently. In retrospect, I // should have forced in a "Dummy" pawn for the player, but hey.. fuck it. state TrackPlayer { function SetPlayerRotation() { local rotator NewRotation; NewRotation = rotator(MySpike.Location - MyPlayer.Location); NewRotation.Pitch = 0; NewRotation.Roll = 0; MyPlayer.SetRotation(NewRotation); } begin: if (MyPlayer.CSMoveTarget != None) { SetPlayerRotation(); sleep(0.1); goto('Begin'); } else { CSLog("We have stopped tracking movement for "$MyPlayer); GotoState(''); } } defaultproperties { Texture=Texture'UDSDemo.UDS.CS_PAWN' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |