The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Scripting Changes from UT3

  • Filter
  • Time
  • Show
Clear All
new posts

  • Scripting Changes from UT3

    I thought it would be nice to have a thread listing changes to Unreal Script and the base classes from UT3 to UDK.

    Unreal Script changes
    • It is no longer valid to have ` in strings.
      Solution: Escape it (i.e. "\`") - elmuerte

    • Trying to compare an interface variable against a non-interface object variable results in a "Const mismatch with '=='" error on compile.
      Solution: Cast the object variable to an interface variable first, or get a non-interface variable of the interface object. (Ok, that sounds really confusing, but say you have an object MyObject that is a subclass of Actor and implements MyInterface...)
       function Example(MyObject obj)
          local MyInterface interface;
          local bool dump;
          interface = obj;
          dump = (interface == obj); // Won't compile.
          dump = (interface == MyInterface(obj)); // Compiles
      Basically it should be noted that Interfaces in general are a bit rough in UE3 (or at least they were in UT3), so take care when using them and expect peculiar behaviour.

    • UDK is stricter about consistent usage of the optional flag on parameters - you will now get an error if it a changes from class to subclass.

    • You can now flag functions as protected, preventing them from being used except from within the class or by subclasses (not sure about inner classes or whatever you call classes that are "within" another class).

    • New nameof() feature allows you to get the name of a functions and variables as a string. Used extensively in UDK code when setting timers and handling RepNotify in the ReplicatedEvent functions.

    • When accessing a member of a within class' container class, you now have to use the special Outer member variable. This presumably helps deal with name clashes.
      class BonusPlayerData extends Object within MyPlayerController;
      function string GetName()
           return Outer.PlayerReplicationInfo.playerName;
      Unfortunately this can lead to maddening statements like GetSceneClient().Outer.Outer.Outer.GetCurrentWorld Info().

    Base Class changes
    • Actor no longer has the TimeSince(float Time) function. Use WorldInfo.TimeSeconds - Time instead.
    • It is no longer possible to directly access DecalMaterial in DecalComponent, instead you must use SetDecalMaterial() and GetDecalMaterial().
    • PlayerReplicationInfo no longer has a TeamID value, suggest using GetTeamNum() or getting Team.TeamIndex instead.
    • PlayerReplicationInfo no longer has the bFromPreviousLevel_Replicated variable which was used to replicated bFromPreviousLevel, meaning that variable is no longer replicated. Unsure if this is a problem or not, although obviously a similar system can be added if necessary.
    • Canvas' DrawText functions have changed. DrawTextClipped is gone and DrawText now takes a FontRenderInfo struct which specifies whether to clip among other things.
    • The system to stitch characters together from selected parts (CustomCharData, etc) appears to be gone or gutted.
    • In PlayerController, RegisterPlayerDataStores() is now final... however it only calls RegisterCustomPlayerDataStores() and RegisterStandardPlayerDataStores(), neither of which is final. So you can override those instead.
    • In PlayerController, ClientHearSound() no longer has the bIsUISound parameter, so you must rely on the bIsUISound attribute of the audio component.
    • Some of the navigation variables have changed in Controller. In particular the Destination vector is gone, replaced with DestinationPosition which is a BasedPosition. BasedPosition appears to be a new system to handle navigation on a moving actor.

  • #2
    Nice initiative, will remove some confusion for people following UT3 tutorials among other things


    • #3
      Nice! I don't know UT3 Unreal Script too well (Was just learning about a week before UDK was released) so I will benefit in the way Crozz mentioned.

      Excellent Initiative Indeed!


      • #4
        Originally posted by immortius View Post
        [*]It is no longer valid to have ` in strings.
        Solution: Put string values in localisation files?
        Escape it:
        myString = "foo \'bar";


        • #5
          The custom character system was custom for the UT3 build of the engine, as far as I could tell - I went through that code with a fine toothed comb, trying to figure out how it worked, and all of the references to it were in the UT3 specific code pieces.


          • #6
            The new nameof() feature for getting the name of a function or variable as a string is pretty nice.