mGm_Lizard

Object.uc

Oct 24th, 2015
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // Object: The base class all objects.
  3. // This is a built-in Unreal class and it shouldn't be modified.
  4. //=============================================================================
  5. class Object
  6.     native
  7.     noexport;
  8.  
  9. //=============================================================================
  10. // UObject variables.
  11.  
  12. // Internal variables.
  13. var native private const pointer ObjectInternal[7];
  14. var native const object Outer;
  15. var native const int ObjectFlags;
  16. var(Object) native const editconst noexport name Name;
  17. var native const editconst class Class;
  18.  
  19. //=============================================================================
  20. // Unreal base structures.
  21.  
  22. // Object flags.
  23. const RF_Transactional  = 0x00000001; // Supports editor undo/redo.
  24. const RF_Public         = 0x00000004; // Can be referenced by external package files.
  25. const RF_Transient      = 0x00004000; // Can't be saved or loaded.
  26. const RF_Standalone     = 0x00080000; // Keep object around for editing even if unreferenced.
  27. const RF_NotForClient   = 0x00100000; // Don't load for game client.
  28. const RF_NotForServer   = 0x00200000; // Don't load for game server.
  29. const RF_NotForEdit     = 0x00400000; // Don't load for editor.
  30.  
  31. // A globally unique identifier.
  32. struct Guid
  33. {
  34.     var int A, B, C, D;
  35. };
  36.  
  37. // A point or direction vector in 3d space.
  38. struct Vector
  39. {
  40.     var() config float X, Y, Z;
  41. };
  42.  
  43. // A plane definition in 3d space.
  44. struct Plane extends Vector
  45. {
  46.     var() config float W;
  47. };
  48.  
  49. // An orthogonal rotation in 3d space.
  50. struct Rotator
  51. {
  52.     var() config int Pitch, Yaw, Roll;
  53. };
  54.  
  55. // An arbitrary coordinate system in 3d space.
  56. struct Coords
  57. {
  58.     var() config vector Origin, XAxis, YAxis, ZAxis;
  59. };
  60.  
  61. // Quaternion
  62. struct Quat
  63. {
  64.     var() config float X, Y, Z, W;
  65. };
  66.  
  67. // Used to generate random values between Min and Max
  68. struct Range
  69. {
  70.     var() config float Min;
  71.     var() config float Max;
  72. };
  73.  
  74. // Vector of Ranges
  75. struct RangeVector
  76. {
  77.     var() config range X;
  78.     var() config range Y;
  79.     var() config range Z;
  80. };
  81.  
  82. // A scale and sheering.
  83. struct Scale
  84. {
  85.     var() config vector Scale;
  86.     var() config float SheerRate;
  87.     var() config enum ESheerAxis
  88.     {
  89.         SHEER_None,
  90.         SHEER_XY,
  91.         SHEER_XZ,
  92.         SHEER_YX,
  93.         SHEER_YZ,
  94.         SHEER_ZX,
  95.         SHEER_ZY,
  96.     } SheerAxis;
  97. };
  98.  
  99. // Camera orientations for Matinee
  100. enum ECamOrientation
  101. {
  102.     CAMORIENT_None,
  103.     CAMORIENT_LookAtActor,
  104.     CAMORIENT_FacePath,
  105.     CAMORIENT_Interpolate,
  106.     CAMORIENT_Dolly,
  107. };
  108.  
  109. // Generic axis enum.
  110. enum EAxis
  111. {
  112.     AXIS_X,
  113.     AXIS_Y,
  114.     AXIS_Z
  115. };
  116.  
  117. // A color.
  118. struct Color
  119. {
  120.     var() config byte B, G, R, A;
  121. };
  122.  
  123. // A bounding box.
  124. struct Box
  125. {
  126.     var vector Min, Max;
  127.     var byte IsValid;
  128. };
  129.  
  130. // gam ---
  131. struct IntBox
  132. {
  133.     var int X1, Y1, X2, Y2;
  134. };
  135. struct FloatBox
  136. {
  137.     var float X1, Y1, X2, Y2;
  138. };
  139. // --- gam
  140.  
  141. // A bounding box sphere together.
  142. struct BoundingVolume extends Box
  143. {
  144.     var plane Sphere;
  145. };
  146.  
  147. // a 4x4 matrix
  148. struct Matrix
  149. {
  150.     var() Plane XPlane;
  151.     var() Plane YPlane;
  152.     var() Plane ZPlane;
  153.     var() Plane WPlane;
  154. };
  155.  
  156. // A interpolated function
  157. struct InterpCurvePoint
  158. {
  159.     var() float InVal;
  160.     var() float OutVal;
  161. };
  162.  
  163. struct InterpCurve
  164. {
  165.     var() array<InterpCurvePoint>   Points;
  166. };
  167.  
  168. // gam --- Forgive me :(
  169. enum EDrawPivot
  170. {
  171.     DP_UpperLeft,
  172.     DP_UpperMiddle,
  173.     DP_UpperRight,
  174.     DP_MiddleRight,
  175.     DP_LowerRight,
  176.     DP_LowerMiddle,
  177.     DP_LowerLeft,
  178.     DP_MiddleLeft,
  179.     DP_MiddleMiddle,
  180. };
  181.  
  182. //  Detail mode enum.
  183. enum EDetailMode
  184. {
  185.     DM_Low,
  186.     DM_High,
  187.     DM_SuperHigh
  188. };
  189.  
  190. struct CompressedPosition
  191. {
  192.     var vector Location;
  193.     var rotator Rotation;
  194.     var vector Velocity;
  195. };
  196.  
  197. // This is just a placeholder for native classes!
  198. // Don't ever touch this directly in unrealscript!  --ryan.
  199. struct TMultiMap
  200. {
  201.     var pointer FArray_Data;
  202.     var int FArray_ArrayNum;
  203.     var int FArray_ArrayMax;
  204.     var pointer TMapBase_Hash;
  205.     var int TMapBase_HashCount;
  206. };
  207.  
  208.  
  209. // --- gam
  210. //=============================================================================
  211. // Constants.
  212.  
  213. const MaxInt = 0x7fffffff;
  214. const Pi     = 3.1415926535897932;
  215.  
  216. //=============================================================================
  217. // Basic native operators and functions.
  218.  
  219. // Bool operators.
  220. native(129) static final preoperator  bool  !  ( bool A );
  221. native(242) static final operator(24) bool  == ( bool A, bool B );
  222. native(243) static final operator(26) bool  != ( bool A, bool B );
  223. native(130) static final operator(30) bool  && ( bool A, skip bool B );
  224. native(131) static final operator(30) bool  ^^ ( bool A, bool B );
  225. native(132) static final operator(32) bool  || ( bool A, skip bool B );
  226.  
  227. // Byte operators.
  228. native(133) static final operator(34) byte *= ( out byte A, byte B );
  229. native(134) static final operator(34) byte /= ( out byte A, byte B );
  230. native(135) static final operator(34) byte += ( out byte A, byte B );
  231. native(136) static final operator(34) byte -= ( out byte A, byte B );
  232. native(137) static final preoperator  byte ++ ( out byte A );
  233. native(138) static final preoperator  byte -- ( out byte A );
  234. native(139) static final postoperator byte ++ ( out byte A );
  235. native(140) static final postoperator byte -- ( out byte A );
  236.  
  237. // Integer operators.
  238. native(141) static final preoperator  int  ~  ( int A );
  239. native(143) static final preoperator  int  -  ( int A );
  240. native(144) static final operator(16) int  *  ( int A, int B );
  241. native(145) static final operator(16) int  /  ( int A, int B );
  242. native(146) static final operator(20) int  +  ( int A, int B );
  243. native(147) static final operator(20) int  -  ( int A, int B );
  244. native(148) static final operator(22) int  << ( int A, int B );
  245. native(149) static final operator(22) int  >> ( int A, int B );
  246. native(196) static final operator(22) int  >>>( int A, int B );
  247. native(150) static final operator(24) bool <  ( int A, int B );
  248. native(151) static final operator(24) bool >  ( int A, int B );
  249. native(152) static final operator(24) bool <= ( int A, int B );
  250. native(153) static final operator(24) bool >= ( int A, int B );
  251. native(154) static final operator(24) bool == ( int A, int B );
  252. native(155) static final operator(26) bool != ( int A, int B );
  253. native(156) static final operator(28) int  &  ( int A, int B );
  254. native(157) static final operator(28) int  ^  ( int A, int B );
  255. native(158) static final operator(28) int  |  ( int A, int B );
  256. native(159) static final operator(34) int  *= ( out int A, float B );
  257. native(160) static final operator(34) int  /= ( out int A, float B );
  258. native(161) static final operator(34) int  += ( out int A, int B );
  259. native(162) static final operator(34) int  -= ( out int A, int B );
  260. native(163) static final preoperator  int  ++ ( out int A );
  261. native(164) static final preoperator  int  -- ( out int A );
  262. native(165) static final postoperator int  ++ ( out int A );
  263. native(166) static final postoperator int  -- ( out int A );
  264.  
  265. // Integer functions.
  266. native(167) static final Function     int  Rand  ( int Max );
  267. native(249) static final function     int  Min   ( int A, int B );
  268. native(250) static final function     int  Max   ( int A, int B );
  269. native(251) static final function     int  Clamp ( int V, int A, int B );
  270.  
  271. // Float operators.
  272. native(169) static final preoperator  float -  ( float A );
  273. native(170) static final operator(12) float ** ( float A, float B );
  274. native(171) static final operator(16) float *  ( float A, float B );
  275. native(172) static final operator(16) float /  ( float A, float B );
  276. native(173) static final operator(18) float %  ( float A, float B );
  277. native(174) static final operator(20) float +  ( float A, float B );
  278. native(175) static final operator(20) float -  ( float A, float B );
  279. native(176) static final operator(24) bool  <  ( float A, float B );
  280. native(177) static final operator(24) bool  >  ( float A, float B );
  281. native(178) static final operator(24) bool  <= ( float A, float B );
  282. native(179) static final operator(24) bool  >= ( float A, float B );
  283. native(180) static final operator(24) bool  == ( float A, float B );
  284. native(210) static final operator(24) bool  ~= ( float A, float B );
  285. native(181) static final operator(26) bool  != ( float A, float B );
  286. native(182) static final operator(34) float *= ( out float A, float B );
  287. native(183) static final operator(34) float /= ( out float A, float B );
  288. native(184) static final operator(34) float += ( out float A, float B );
  289. native(185) static final operator(34) float -= ( out float A, float B );
  290.  
  291. // Float functions.
  292. native(186) static final function     float Abs   ( float A );
  293. native(187) static final function     float Sin   ( float A );
  294. native      static final function     float Asin  ( float A );
  295. native(188) static final function     float Cos   ( float A );
  296. native      static final function     float Acos  ( float A );
  297. native(189) static final function     float Tan   ( float A );
  298. native(190) static final function     float Atan  ( float A, float B );
  299. native(191) static final function     float Exp   ( float A );
  300. native(192) static final function     float Loge  ( float A );
  301. native(193) static final function     float Sqrt  ( float A );
  302. native(194) static final function     float Square( float A );
  303. native(195) static final function     float FRand ();
  304. native(244) static final function     float FMin  ( float A, float B );
  305. native(245) static final function     float FMax  ( float A, float B );
  306. native(246) static final function     float FClamp( float V, float A, float B );
  307. native(247) static final function     float Lerp  ( float Alpha, float A, float B, optional bool bClampRange );
  308. native(248) static final function     float Smerp ( float Alpha, float A, float B );
  309. // gam ---
  310. native(253) static final function     float Ceil  ( float A );
  311. native(257) static final function     float Round ( float A );
  312. // --- gam
  313.  
  314. // Vector operators.
  315. native(211) static final preoperator  vector -     ( vector A );
  316. native(212) static final operator(16) vector *     ( vector A, float B );
  317. native(213) static final operator(16) vector *     ( float A, vector B );
  318. native(296) static final operator(16) vector *     ( vector A, vector B );
  319. native(214) static final operator(16) vector /     ( vector A, float B );
  320. native(215) static final operator(20) vector +     ( vector A, vector B );
  321. native(216) static final operator(20) vector -     ( vector A, vector B );
  322. native(275) static final operator(22) vector <<    ( vector A, rotator B );
  323. native(276) static final operator(22) vector >>    ( vector A, rotator B );
  324. native(217) static final operator(24) bool   ==    ( vector A, vector B );
  325. native(218) static final operator(26) bool   !=    ( vector A, vector B );
  326. native(219) static final operator(16) float  Dot   ( vector A, vector B );
  327. native(220) static final operator(16) vector Cross ( vector A, vector B );
  328. native(221) static final operator(34) vector *=    ( out vector A, float B );
  329. native(297) static final operator(34) vector *=    ( out vector A, vector B );
  330. native(222) static final operator(34) vector /=    ( out vector A, float B );
  331. native(223) static final operator(34) vector +=    ( out vector A, vector B );
  332. native(224) static final operator(34) vector -=    ( out vector A, vector B );
  333.  
  334. // Vector functions.
  335. native(225) static final function float  VSize  ( vector A );
  336. native(226) static final function vector Normal ( vector A );
  337. native(227) static final function        Invert ( out vector X, out vector Y, out vector Z );
  338. native(252) static final function vector VRand  ( );
  339. native(300) static final function vector MirrorVectorByNormal( vector Vect, vector Normal );
  340.  
  341. // Rotator operators and functions.
  342. native(142) static final operator(24) bool ==     ( rotator A, rotator B );
  343. native(203) static final operator(26) bool !=     ( rotator A, rotator B );
  344. native(287) static final operator(16) rotator *   ( rotator A, float    B );
  345. native(288) static final operator(16) rotator *   ( float    A, rotator B );
  346. native(289) static final operator(16) rotator /   ( rotator A, float    B );
  347. native(290) static final operator(34) rotator *=  ( out rotator A, float B  );
  348. native(291) static final operator(34) rotator /=  ( out rotator A, float B  );
  349. native(316) static final operator(20) rotator +   ( rotator A, rotator B );
  350. native(317) static final operator(20) rotator -   ( rotator A, rotator B );
  351. native(318) static final operator(34) rotator +=  ( out rotator A, rotator B );
  352. native(319) static final operator(34) rotator -=  ( out rotator A, rotator B );
  353. native(229) static final function GetAxes         ( rotator A, out vector X, out vector Y, out vector Z );
  354. native(230) static final function GetUnAxes       ( rotator A, out vector X, out vector Y, out vector Z );
  355. native(320) static final function rotator RotRand ( optional bool bRoll );
  356. native      static final function rotator OrthoRotation( vector X, vector Y, vector Z );
  357. native      static final function rotator Normalize( rotator Rot );
  358. native      static final operator(24) bool ClockwiseFrom( int A, int B );
  359.  
  360. // String operators.
  361. native(112) static final operator(40) string $  ( coerce string A, coerce string B );
  362. native(168) static final operator(40) string @  ( coerce string A, coerce string B );
  363. native(115) static final operator(24) bool   <  ( string A, string B );
  364. native(116) static final operator(24) bool   >  ( string A, string B );
  365. native(120) static final operator(24) bool   <= ( string A, string B );
  366. native(121) static final operator(24) bool   >= ( string A, string B );
  367. native(122) static final operator(24) bool   == ( string A, string B );
  368. native(123) static final operator(26) bool   != ( string A, string B );
  369. native(124) static final operator(24) bool   ~= ( string A, string B );
  370. // rjp --
  371. native(322) static final operator(44) string $= ( out    string A, coerce string B );
  372. native(323) static final operator(44) string @= ( out    string A, coerce string B );
  373. native(324) static final operator(45) string -= ( out    string A, coerce string B );
  374. // -- rjp
  375.  
  376. // String functions.
  377. native(125) static final function int    Len    ( coerce string S );
  378. native(126) static final function int    InStr  ( coerce string S, coerce string t );
  379. native(127) static final function string Mid    ( coerce string S, int i, optional int j );
  380. native(128) static final function string Left   ( coerce string S, int i );
  381. native(234) static final function string Right  ( coerce string S, int i );
  382. native(235) static final function string Caps   ( coerce string S );
  383. native(236) static final function string Chr    ( int i );
  384. native(237) static final function int    Asc    ( string S );
  385. native(238) static final function string Locs   ( coerce string S); // -- rjp
  386. native(239) static final function bool   Divide ( coerce string Src, string Divider, out string LeftPart, out string RightPart);
  387. native(240) static final function int    Split  ( coerce string Src, string Divider, out array<string> Parts );
  388. // rjp --
  389. native(200)  static final function int    StrCmp ( coerce string S, coerce string T, optional int Count, optional bool bCaseSensitive );
  390. native(201)  static final function string Repl  ( coerce string Src, coerce string Match, coerce string With, optional bool bCaseSensitive );
  391. native(202)  static final function string Eval   ( bool Condition, coerce string ResultIfTrue, coerce string ResultIfFalse );
  392. // -- rjp
  393. // Object operators.
  394. native(114) static final operator(24) bool == ( Object A, Object B );
  395. native(119) static final operator(26) bool != ( Object A, Object B );
  396.  
  397. // Name operators.
  398. native(254) static final operator(24) bool == ( name A, name B );
  399. native(255) static final operator(26) bool != ( name A, name B );
  400.  
  401. // InterpCurve operator
  402. native      static final function float InterpCurveEval( InterpCurve curve, float input );
  403. native      static final function InterpCurveGetOutputRange( InterpCurve curve, out float min, out float max );
  404. native      static final function InterpCurveGetInputDomain( InterpCurve curve, out float min, out float max );
  405.  
  406. // Quaternion functions
  407. native      static final function Quat QuatProduct( Quat A, Quat B );
  408. native      static final function Quat QuatInvert( Quat A );
  409. native      static final function vector QuatRotateVector( Quat A, vector B );
  410. native      static final function Quat QuatFindBetween( Vector A, Vector B );
  411. native      static final function Quat QuatFromAxisAndAngle( Vector Axis, Float Angle );
  412. native      static final function Quat QuatFromRotator( rotator A );
  413. native      static final function rotator QuatToRotator( Quat A );
  414. native      static final function Quat QuatSlerp( Quat A, Quat B, float Slerp);
  415.  
  416. //=============================================================================
  417. // General functions.
  418.  
  419. // Logging.
  420. native(231) final static function Log( coerce string S, optional name Tag );
  421. native(232) final static function Warn( coerce string S );
  422. native static function string Localize( string SectionName, string KeyName, string PackageName );
  423.  
  424. // Goto state and label.
  425. native(113) final function GotoState( optional name NewState, optional name Label );
  426. native(281) final function bool IsInState( name TestState );
  427. native(284) final function name GetStateName();
  428.  
  429. // Objects.
  430. native(258) static final function bool ClassIsChildOf( class TestClass, class ParentClass );
  431. native(303) final function bool IsA( name ClassName );
  432.  
  433. // Probe messages.
  434. native(117) final function Enable( name ProbeFunc );
  435. native(118) final function Disable( name ProbeFunc );
  436.  
  437. // Properties.
  438. native final function string GetPropertyText( string PropName );
  439. native final function bool   SetPropertyText( string PropName, string PropValue );
  440. native static final function name GetEnum( object E, coerce int i );
  441. native static final function object DynamicLoadObject( string ObjectName, class ObjectClass, optional bool MayFail );
  442. native static final function object FindObject( string ObjectName, class ObjectClass );
  443.  
  444. // Configuration.
  445. native(536) final function SaveConfig();
  446. native(537) final function ClearConfig( optional string PropName ); // -- rjp
  447. native static final function StaticSaveConfig();
  448. native static final function ResetConfig( optional string PropName );   // -- rjp
  449. native static final function StaticClearConfig( optional string PropName ); // -- rjp
  450. native static final function array<string> GetPerObjectNames( string ININame, optional string ObjectClass, optional int MaxResults /*1024 if unspecified*/ ); //no extension
  451.  
  452. // Return a random number within the given range.
  453. final function float RandRange( float Min, float Max )
  454. {
  455.     return Min + (Max - Min) * FRand();
  456. }
  457.  
  458. native(535) static final function StopWatch(optional bool bStop);   //amb: for script timing
  459. native final function bool IsOnConsole();   // for console specific stuff
  460. native final function bool IsSoaking();
  461.  
  462. // These report basic truths about the target OS. You should only use them for
  463. //  basic things (MacOS? Don't report Direct3D support, etc). MacOSX is a Unix
  464. //  of sorts, but does not report PlatformIsUnix()==true. PlatformIsWindows()
  465. //  is for Win32 and Win64. PlatformIs64Bit() may be true in conjunction with
  466. //  any other platform function if the binary is 64-bit native (not 32-bit on
  467. //  a 64-bit platform).  --ryan.
  468. native final function bool PlatformIsMacOS();  // MacOS X.
  469. native final function bool PlatformIsUnix();  // Linux, FreeBSD, etc (NOT OSX!)
  470. native final function bool PlatformIsWindows();  // Win32, Win64.
  471. native final function bool PlatformIs64Bit();  // Linux64, Win64.
  472.  
  473. //=============================================================================
  474. // Engine notification functions.
  475.  
  476. //
  477. // Called immediately when entering a state, while within
  478. // the GotoState call that caused the state change.
  479. //
  480. event BeginState();
  481.  
  482. //
  483. // Called immediately before going out of the current state,
  484. // while within the GotoState call that caused the state change.
  485. //
  486. event EndState();
  487.  
  488. event Created(); //amb: notifiction for object based classes only (not actors)
  489.  
  490. native(197) final iterator function AllObjects(class baseClass, out Object obj); //amb
  491.  
  492. native final function GetReferencers( Object Target, out array<Object> Referencers );
  493.  
  494. // Returns the string representation of the name of an object without the package
  495. // prefixes.
  496. //
  497. simulated static function String GetItemName( string FullName )
  498. {
  499.     local int pos;
  500.  
  501.     pos = InStr(FullName, ".");
  502.     While ( pos != -1 )
  503.     {
  504.         FullName = Mid(FullName,pos+1);
  505.         pos = InStr(FullName, ".");
  506.     }
  507.  
  508.     return FullName;
  509. }
  510.  
  511. simulated static final function ReplaceText(out string Text, string Replace, string With)
  512. {
  513.     local int i;
  514.     local string Input;
  515.  
  516.     if ( Text == "" || Replace == "" )
  517.         return;
  518.  
  519.     Input = Text;
  520.     Text = "";
  521.     i = InStr(Input, Replace);
  522.     while(i != -1)
  523.     {
  524.         Text = Text $ Left(Input, i) $ With;
  525.         Input = Mid(Input, i + Len(Replace));
  526.         i = InStr(Input, Replace);
  527.     }
  528.     Text = Text $ Input;
  529. }
  530.  
  531. // Moves Num elements from Source to Dest
  532. static final function EatStr(out string Dest, out string Source, int Num)
  533. {
  534.     Dest = Dest $ Left(Source, Num);
  535.     Source = Mid(Source, Num);
  536. }
  537.  
  538. defaultproperties
  539. {
  540. }
Advertisement
Add Comment
Please, Sign In to add comment