Guest User

Untitled

a guest
Dec 25th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. class zCrate extends Actor
  3.     HideCategories(Display,Collision,Physics)
  4.     placeable;
  5.  
  6.  /*----------------------------------------------------------------
  7.             Private vars
  8.  ----------------------------------------------------------------*/
  9.  
  10. var SkeletalMeshComponent Mesh;
  11. var DynamicLightEnvironmentComponent LightEnvironment;
  12.  
  13.  
  14.  /*----------------------------------------------------------------
  15.             Methods
  16.  ----------------------------------------------------------------*/
  17.  
  18. /**
  19.  *  @brief              Called at game start
  20. **/
  21. simulated function PostBeginPlay()
  22. {
  23.     Super.PostBeginPlay();
  24.  
  25.     if(WorldInfo.NetMode == NM_DedicatedServer)
  26.     {
  27.         SetCollision(false, false);
  28.         DetachComponent(Mesh);
  29.         BeginState('IgnoreItAll');
  30.     }
  31.  
  32.     MaterialInstance = Mesh.CreateAndSetMaterialInstanceConstant(0);
  33. }
  34.  
  35. state IgnoreItAll
  36. {
  37.     ignores Touch, TakeDamage, Tick;
  38. }
  39.  
  40.  
  41.  /*----------------------------------------------------------------
  42.             Object
  43.  ----------------------------------------------------------------*/
  44.  
  45. defaultproperties
  46. {
  47.     Begin Object class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
  48.         bEnabled=true
  49.         bDynamic=true
  50.     End Object
  51.     Components.Add(MyLightEnvironment)
  52.     LightEnvironment=MyLightEnvironment
  53.  
  54.     Begin Object class=StaticMeshComponent Name=MyStaticMeshComponent
  55.         StaticMesh=StaticMesh'zGameTest.Mesh.SM_Cube'
  56.         Materials[0]=MaterialInstanceConstant'Gameplay.Material.MI_zCrate'
  57.         LightEnvironment=MyLightEnvironment
  58.         BlockActors=true
  59.         BlockZeroExtent=true
  60.         BlockRigidBody=true
  61.         BlockNonzeroExtent=true
  62.         CollideActors=true
  63.         bUseSingleBodyPhysics=1
  64.         bNotifyRigidBodyCollision=true
  65.         bUseAsOccluder=true
  66.     End Object
  67.     Components.Add(MyStaticMeshComponent)
  68.     Mesh=MySkeletalMeshComponent
  69.     CollisionComponent=MySkeletalMeshComponent
  70.  
  71.     Physics=PHYS_RigidBody
  72.     bEdShouldSnap=true
  73.     bStatic=false
  74.     bCollideActors=true
  75.     bCollideWorld=true
  76.     bProjTarget=true
  77.     bBlockActors=true
  78.     bPathColliding=true
  79. }
Add Comment
Please, Sign In to add comment