SHARE
TWEET

Untitled

a guest Jun 19th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /////////////---------------------MY GAMEINFO CLASS---------------------/////////////
  2.  
  3. class TDSGameInfo extends GameInfo;
  4.  
  5. var        TDSSpawner Spawner;
  6. var vector SpawnLocation;
  7. var int    Lives, Multiplier, Bombs, Score, Difficulty;
  8. var        PlayerController PC;
  9. var        TDSPlayerController MainController;
  10.  
  11. simulated function PostBeginPlay()
  12. {
  13. super.PostBeginPlay();
  14. Lives = 5;
  15. foreach WorldInfo.AllControllers(class'PlayerController', PC)
  16. {
  17.  if(PC.IsLocalPlayerController())
  18.  {
  19.      MainController = TDSPlayerController(PC);
  20.  
  21.      break;
  22.  }
  23. }
  24.  
  25. Spawner = Spawn(class'TDSSpawner', , , MainController.Pawn.Location, , ,);
  26. }
  27.  
  28. function Tick(float DeltaTime)
  29. {
  30. // Game director code here
  31.  
  32. `log(MainController.Pawn.Location);
  33. }
  34.  
  35. defaultproperties
  36. {
  37.   DefaultPawnClass=class'TDSPlayer'
  38.   PlayerControllerClass=class'TDSPlayerController'
  39.   bDelayedStart=false
  40. }
  41.  
  42. /////////////---------------------MY CAMERA CLASS---------------------/////////////
  43.  
  44. class TDSCamera extends Camera;
  45.  
  46. var vector CamLocation, CLoc, CapLocation;
  47. var rotator CamRotation, CapRotation;
  48. var TDSPlayerController PController;
  49. var TPOV TDSPov;
  50. //var SceneCapture2DActor Cap;
  51. var Actor A;
  52.  
  53. simulated event PostBeginPlay()
  54. {
  55.     super.PostBeginPlay();
  56.  
  57.     CamRotation.Pitch = -16384;
  58.     CamRotation.Roll = 0;
  59.     CamRotation.Yaw = 0;
  60.  
  61.    
  62.     PController = TDSPlayerController(Owner);
  63.  
  64.     //Cap = Spawn(class'TDSSceneCapture2DActor');
  65. }
  66.  
  67. function UpdateViewTarget(out TViewTarget OutVT, float DeltaTime)
  68. {
  69.     DebugPlayerCoords();
  70.  
  71.     CamLocation.X = (0 + PController.Pawn.Location.X) / 1.3;
  72.     CamLocation.Y = (0 + PController.Pawn.Location.Y) / 1.3;
  73.     //CamRotation.Pitch = -16384 + (0 + PController.Pawn.Location.X) * 3;
  74.     //CamRotation.Roll = (PController.Pawn.Location.Y) * 3;
  75.     //CapRotation.Pitch = -16384;
  76.     //CapRotation.Roll= -16384;
  77.     CLoc = CamLocation;
  78.     CLoc.Y = CamLocation.Y + 15000;
  79.     CamLocation.Z = (PController.Pawn.Location.Z + 1000);
  80.     //CapLocation = CamLocation;
  81.     //CapLocation.X = (0 + PController.Pawn.Location.X) / 3;
  82.     //CapLocation.Y = (0 + PController.Pawn.Location.Y) / 3;
  83.     //CapLocation.Z += 400;
  84.     //Cap.SetLocation(CamLocation);
  85.     //Cap.SetRotation(CapRotation);
  86.     TDSPov.Location = CamLocation;
  87.     TDSPov.Rotation = CamRotation;
  88.  
  89.     OutVT.POV = TDSPov;
  90. }
  91.  
  92. function DebugPlayerCoords()
  93. {
  94.     //`log("X = " @ PController.Pawn.Location.X);
  95. //  `log("y = " @ PController.Pawn.Location.Y);
  96. //  `log("z = " @ PController.Pawn.Location.Z);
  97. //  `log("direction = " @ normal(PController.Pawn.Velocity);
  98. //  `log("velocity = " @ PController.Pawn.Velocity);
  99. }
  100.  
  101. defaultproperties
  102. {
  103. }
  104.  
  105. /////////////---------------------MY PLAYER PAWN CLASS---------------------/////////////
  106.  
  107. class TDSPlayer extends Pawn;
  108.  
  109. var vector NewLoc;
  110. var rotator MoveDir;
  111. var rotator NewRotation;
  112.  
  113. simulated event PostBeginPlay()
  114. {
  115.     super.PostBeginPlay();
  116. }
  117.  
  118. function Tick(float DeltaTime)
  119. {
  120.          
  121. }
  122.  
  123. defaultproperties
  124. {
  125.     bAllowFluidSurfaceInteraction=TRUE
  126.         Physics=PHYS_None
  127.     Components.Remove(Sprite)
  128.  
  129.         Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
  130.                 ModShadowFadeoutTime=0.25
  131.                 MinTimeBetweenFullUpdates=0.2
  132.                 AmbientGlow=(R=.01,G=.01,B=.01,A=1)
  133.                 AmbientShadowColor=(R=0.15,G=0.15,B=0.15)
  134.                 LightShadowMode=LightShadow_ModulateBetter
  135.                 ShadowFilterQuality=SFQ_High
  136.                 bSynthesizeSHLight=TRUE
  137.         End Object
  138.         Components.Add(MyLightEnvironment)
  139.  
  140.     Begin Object Class=SkeletalMeshComponent Name=InitialSkeletalMesh
  141.         CastShadow=true
  142.         bCastDynamicShadow=true
  143.         bOwnerNoSee=false
  144.         LightEnvironment=MyLightEnvironment;
  145.         BlockRigidBody=true;
  146.         CollideActors=true;
  147.         BlockZeroExtent=true;
  148.         SkeletalMesh=SkeletalMesh'TopDownShooter.SkeletalMeshes.ship'
  149.         End Object
  150.  
  151.         Mesh=InitialSkeletalMesh;
  152.         Components.Add(InitialSkeletalMesh);
  153.        
  154.         Begin Object Class=PointLightComponent Name=PointLightComponent0
  155.         Brightness=20
  156.         Radius=300
  157.         LightingChannels=(BSP=TRUE,Static=TRUE,Dynamic=TRUE,bInitialized=TRUE)
  158.     End Object
  159.     Components.Add(PointLightComponent0)
  160. }
  161.  
  162.  
  163. /////////////---------------------MY ENEMY CLASS---------------------/////////////
  164.  
  165. class TDSEnemy extends UTProjectile;
  166.  
  167. var vector DefaultLocation;
  168.  
  169. simulated function PostBeginPlay()
  170. {
  171.     Super.PostBeginPlay();
  172.  
  173.     SeekTarget =  ...TheMainController.PawnToChase...
  174. }
  175.  
  176. defaultproperties
  177. {
  178.     ProjFlightTemplate=ParticleSystem'WP_RocketLauncher.Effects.P_WP_RocketLauncher_RocketTrail'
  179.     ProjExplosionTemplate=ParticleSystem'WP_RocketLauncher.Effects.P_WP_RocketLauncher_RocketExplosion'
  180.     ExplosionDecal=MaterialInstanceTimeVarying'WP_RocketLauncher.Decals.MITV_WP_RocketLauncher_Impact_Decal01'
  181.     DecalWidth=128.0
  182.     DecalHeight=128.0
  183.     speed=1350.0
  184.     MaxSpeed=1350.0
  185.     Damage=100.0
  186.     DamageRadius=220.0
  187.     MomentumTransfer=85000
  188.     MyDamageType=class'UTDmgType_Rocket'
  189.     LifeSpan=8.0
  190.     AmbientSound=SoundCue'A_Weapon_RocketLauncher.Cue.A_Weapon_RL_Travel_Cue'
  191.     ExplosionSound=SoundCue'A_Weapon_RocketLauncher.Cue.A_Weapon_RL_Impact_Cue'
  192.     RotationRate=(Roll=50000)
  193.     bCollideWorld=true
  194.     CheckRadius=42.0
  195.     bCheckProjectileLight=true
  196.     ProjectileLightClass=class'UTGame.UTRocketLight'
  197.     ExplosionLightClass=class'UTGame.UTRocketExplosionLight'
  198.  
  199.     bWaitForEffects=true
  200.     bAttachExplosionToVehicles=false
  201. }
  202.  
  203. /////////////---------------------MY PLAYERCONTROLLER CLASS---------------------/////////////
  204.  
  205. class TDSPlayerController extends PlayerController;
  206.  
  207. var rotator NewRotation;
  208.  
  209. simulated event PostBeginPlay()
  210. {
  211.     super.PostBeginPlay();
  212. }
  213.  
  214. function Tick(float DeltaTime)
  215. {        
  216.          //NewRotation = Rotation;
  217.          //NewRotation.Pitch = -16384;
  218.          //SetRotation(NewRotation);
  219.          
  220.          NewRotation.Pitch  = -16384 + Rotation.Pitch - (Pawn.Velocity.X * 10);
  221.          NewRotation.Roll  = Rotation.Roll - (Pawn.Velocity.Y * 10);
  222.          NewRotation.Yaw  = Rotation.Yaw;
  223.  
  224.          SetRotation(NewRotation);
  225.  
  226.          `log(Velocity);
  227. }
  228.  
  229. defaultproperties
  230. {
  231.     CameraClass=class'TDSCamera'
  232. }
  233.  
  234. /////////////---------------------MY ENEMYSPAWNER CLASS---------------------/////////////
  235.  
  236. class TDSSpawner extends Actor;
  237.  
  238. var TDSEnemy Enemy;
  239. var vector NewLocation;
  240.  
  241. simulated function PostBeginPlay()
  242. {
  243.  super.PostBeginPlay();
  244.  
  245.  NewSpawn();
  246. }
  247.  
  248. function NewSpawn()
  249. {
  250. NewLocation = Location;
  251.  
  252. NewLocation.Z += 300;
  253.  
  254. Enemy = Spawn(class'TDSEnemy', , , NewLocation, , ,);
  255. }
RAW Paste Data
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top