turniej.unreal.pl :: Zobacz temat - [UT'99] RJumpPad - do zastąpienia kickera
graphic logo logo graphic graphic  


Unreal Tournament RJumpPad - do zastąpienia kickera
Napisz nowy temat   Odpowiedz do tematu
   Forum turniej.unreal.pl Strona Główna -> Unreal Script -> Gotowe klasy  
Autor Wiadomość
 Post Wysłany: Sob Kwi 19, 2008 9:17 pm 

Raven
Admin
Admin


Dołączył: 13 Maj 2004
Posty: 200


 
 
 

Unreal Tournament RJumpPad - do zastąpienia kickera
Zobacz pojedynczy postZobacz pojedynczy post

     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. }

 
Odpowiedz z cytatem

_________________

personal wiki
Zobacz profil autora Wyślij prywatną wiadomość Wyślij email Odwiedź stronę autora Numer GG Tlen
   Forum turniej.unreal.pl Strona Główna -> Unreal Script -> Gotowe klasy
Napisz nowy temat   Odpowiedz do tematu
Skocz do:  

 Further options
 Wszystkie czasy w strefie GMT
Strona 1 z 1
 
Zobacz poprzedni temat :: Zobacz następny temat  
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz dołączać plików na tym forum
Nie możesz ściągać plików na tym forum
Wyświetl posty z ostatnich:   
 

turniej.unreal.pl Kanał RSS tematu 
PicLens 

Powered by phpBB © 2001, 2002 phpBB Group
Illusion template v.1.0.2 © Jasidog.com
Powered by phpbb, copyright the phpbb group Template by jasidog.com