Witaj nieznajomy
Użytkownik:

Hasło:

Pamiętaj mnie

Zarajestruj się TUTAJ.
Main
News
Linki
Galeria
Polityka prywatności
Artykuły
Różne
O UnrealED
Unreal Script
Unreal Engine 1
Unreal Engine 3
Gotowce
Mody
W produkcji
Skończone
Nigdy nie ukończone
Download
Mapy
Assault
Capture The Flag
Domination
Death Match
Mappacki
Single Player
Archiwum
Inne
Mutatory
Tutoriale
Programy
UnrealED
Brushe
Muzyka
Programy
Prefabs
Tekstury
Skrypty
Przykłady
Losowy obrazek


Inne
Hostowanie







Gotowe klasy
Unreal Tournament RJumpPad - do zastąpienia kickera


     Opis
Ten actors jest inspirowany JumpPadem z UT2004. Po zdefiniowaniu JumpTarget kierunek i siła wybicia zostaną obliczone automatycznie. Konieczne będzie także zmiana wartości JumpZModifier w celu zwiększenia wysokości wybicia. Skompilowany skrypt można ściągnąć stąd.

     Zmienne
Widoczne
bool bDebugJump: pozwala na zmianę wartości JumpZModifier w trakcie gry (tylko tryb offline)
Actor JumpTarget: cel wybicia (np. Actor'MyLevel.LiftExit0')
float JumpZModifier: modyfikator wybicia na osi Z. Czasami konieczne jest wpisanie tu wartości aby wybicie było odpowiednie
sound JumpSound: dźwięk wybicia
name JumpClasses: klasa mogąca kożystać z JumpPada (wliczna są w to klasy potomne
Ukryte
vector RealJumoVelocity: prawdziwe, obliczone, wybicie.

Unreal Script:
  1. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. // Copyright 2005-2008 Dead Cow Studios. All Rights Reserved.
  3. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  4. // Coder: Raven
  5. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  6. // Changed Kicker.
  7. class RJumpPad extends Triggers;
  8.  
  9. var(Advanced) bool bDebugJump;
  10. var()   Actor      JumpTarget;
  11. var()   float      JumpZModifier;
  12. var()   sound      JumpSound;
  13. var()   name       JumpClasses;
  14. var()   bool       bRandomize;
  15. var vector RealJumoVelocity;
  16.  
  17. replication
  18. {
  19.         reliable if( Role == ROLE_Authority )
  20.                 CalculateJumpVelocity;
  21. }
  22.  
  23. simulated function PostBeginPlay()
  24. {
  25.         if(JumpTarget == none) Destroy();
  26.         RealJumoVelocity = CalculateJumpVelocity();
  27. }
  28.  
  29. simulated function Touch( actor Other )
  30. {
  31.         local Actor A;
  32.  
  33.         if (!Other.IsA(JumpClasses)) return;
  34.         PendingTouch = Other.PendingTouch;
  35.         Other.PendingTouch = self;
  36.         if( Event != '' )
  37.                 foreach AllActors( class 'Actor', A, Event )
  38.                         A.Trigger( Other, Other.Instigator );
  39. }
  40.  
  41. function vector CalculateJumpVelocity()
  42. {
  43.         local vector XYDir, JumpVelocity;
  44.         local float ZDiff, Time, GravityZ;
  45.  
  46.         GravityZ = Region.Zone.ZoneGravity.Z;
  47.  
  48.         XYDir = JumpTarget.Location - Location;
  49.         ZDiff = XYDir.Z;
  50.         Time = 2.5f + JumpZModifier * Sqrt(Abs(ZDiff/GravityZ));
  51.         JumpVelocity = XYDir/Time;
  52.         JumpVelocity = XYDir;
  53.         JumpVelocity.Z = ZDiff + JumpZModifier;
  54.  
  55.         return JumpVelocity;
  56. }
  57.  
  58. simulated function PostTouch( actor Other )
  59. {
  60.         local bool bWasFalling;
  61.         local vector Push;
  62.         local float PMag;
  63.  
  64.         if(bDebugJump)
  65.         {
  66.                 RealJumoVelocity = CalculateJumpVelocity();
  67.                 BroadCastMessage("X="@RealJumoVelocity.X@" Y="@RealJumoVelocity.Y@" Z="@RealJumoVelocity.Z);
  68.         }
  69.  
  70.         bWasFalling = ( Other.Physics == PHYS_Falling );
  71.         if ( bRandomize )
  72.         {
  73.                 PMag = VSize(RealJumoVelocity);
  74.                 Push = PMag * Normal(RealJumoVelocity + 0.5 * PMag * VRand());
  75.         }
  76.         else
  77.                 Push = RealJumoVelocity;
  78.         if ( Other.IsA('Bot') )
  79.         {
  80.                 if ( bWasFalling )
  81.                         Bot(Other).bJumpOffPawn = true;
  82.                 Bot(Other).SetFall();
  83.         }
  84.         if(JumpSound != none) PlaySound(JumpSound);
  85.         Other.SetPhysics(PHYS_Falling);
  86.         Other.Velocity = Push;
  87. }
  88.  
  89. defaultproperties
  90. {
  91.         JumpClasses=Pawn
  92. }


Raven dnia 19 Kwiecień 2008, 23:17 - Skomentuj (0)

All graphics created by InfectedFx and modified by Raven, except turniej.unreal.pl logo.
Site engine and design created by Raven 2004©. All rights reserved.

Strona korzysta z plików cookie w celu realizacji usług zgodnie z Polityką prywatności.