Announcement

Collapse

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

Unrealscript in Unreal Engine 4?

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    what exactly do you guys mean by sub-system changes?

    Comment


    • #32
      In my opinion, there will be no big change except part with 3D rendering - Tesselation etc... For sure will be more Kismet - some sort of it was already implemented in UE2.5 and they add only visuals and more complexity in UE3. UScript will stay like it is - from the beginning, because is faster than Kismet and it keep community running - maybe only more functions will pass to native.
      Switch to C++ only..? I don't think so...
      More open - yes... It's a Kismet job to do that...

      Comment


      • #33
        Code:
        class Me extends Actor;
        
        /* Totally non-random variable. */
        var string MyString;
        
        DefaultProperties
        {
             MyString = "Non-empty string"; // Notice a semicolon
        }
        
        // If you notice, this is found AFTER the DefaultProperties.
        event PostBeginPlay()
        {
             MyString = "I love Epic!";
        }
        
        /* More code here. */
        Yes, it compiles.

        Comment


        • #34
          Why should not..? It's wrong place for DefaultProperties, but it seems that Epic is took into account this nOObish approach...

          Comment


          • #35
            Originally posted by VendorX View Post
            Why should not..? It's wrong place for DefaultProperties, but it seems that Epic is took into account this nOObish approach...
            Why is it the wrong place if it is allowed?
            Maybe what you wanted to say was that it's not the recommended place for it.

            Saying that it is "nOObish" would allow me to say that doing this:
            Code:
            function Timer()
            {
                 // Some code.
            }
            function PostBeginPlay()
            {
                 // Whatever.
            }
            is "nOObish", because Timer and PostBeginPlay are events and not functions .
            (The Timer event is used with SetTimer)


            By the way, I do write my DefaultProperties at the end because it's faster to navigate to it like that (CTRL+END) and everyone knows where it is.

            Comment


            • #36
              Originally posted by 100GPing100 View Post
              Saying that it is "nOObish" would allow me to say that doing this:
              Code:
              function Timer()
              {
                   // Some code.
              }
              function PostBeginPlay()
              {
                   // Whatever.
              }
              is "nOObish", because Timer and PostBeginPlay are events and not functions .
              (The Timer event is used with SetTimer)
              There is nothing wrong if you understand the difference between an event and function...

              Comment


              • #37
                Originally posted by VendorX View Post
                There is nothing wrong if you understand the difference between an event and function...
                At unreal script level there's no difference.

                Comment


                • #38
                  You're sure..? Well, let see what we can find in Unreal Wiki...

                  Default properties:
                  The compiler removes defaultproperties and cpptext sections from source files during import. Cpptext lines will be replaced by the comment // (cpptext) to prevent line number changes, the defaultproperties block is removed without replacement, which is why it should always be placed at the end of the file after all other code.

                  Functions:
                  A function in UnrealScript is a subroutine associated with a specific class. Functions can define zero or up to sixteen parameters and optionally a return type. Various modifiers can be used in the declaration to change the way the function can be accessed or how it behaves when called.

                  Events:
                  ...the keyword event may replace the keyword function without any effect on the UnrealScript level. However, when exporting native header files from script code, event functions will have calling stubs generated so the UnrealScript function can be called more easily from C++ code. These generated C++ methods have the name eventNameOfUnrealScriptFunction and their parameters and possible return type reflects the UnrealScript function declaration.

                  Most important difference is, that that native call -event- you can enable/disable - function not.

                  If you want to know how, look in to Object.uc...
                  Code:
                  //
                  // Probe messages.
                  //
                  
                  native(117) final function Enable( name ProbeFunc );
                  native(118) final function Disable( name ProbeFunc );

                  Comment


                  • #39
                    How is that some of you guys prefer Unreal Script?

                    Ideally UScript should be removed completely from UE4 since with C++ not only you practically have infinite information resources all over the web (for UScript all we basically have is this forum, udn and unrealwiki) but it is also faster, native code and to my books it's not that harder to learn than UScript.

                    Of course i know that's not going to happen but, oh well.. just saying.

                    Comment


                    • #40
                      Originally posted by macattackk View Post
                      what exactly do you guys mean by sub-system changes?
                      For instance the Components sub-system were added in UE3 and sub-systems like effects was completely revamped in each iteration of the engine. Over the years classes extending from Object have swollen right out, now we have sub-systems for scaleform(gfx), apex physics(nx) and all kinds of other things

                      Originally posted by TK-Master View Post
                      Ideally UScript should be removed completely from UE4 since with C++ not only you practically have infinite information resources all over the web (for UScript all we basically have is this forum, udn and unrealwiki) but it is also faster, native code and to my books it's not that harder to learn than UScript.
                      When was the last time you needed to manage memory (other than struct replication) in UnrealScript? There are concepts in UnrealScript that arnt contained within C++ specs for a reason, ofcoarse you can expand by using C++0x. UnrealScript is also around 15 years newer than C++ and has undergone more changes in its life than C++ has since UnrealScripts creation.

                      Lets put it this way, compare a weapon from a game written in C++ like say halflife I think to a UT3 weapon and you might start understanding why UnrealScript is very useful for gameplay code and events.

                      Comment


                      • #41
                        Originally posted by VendorX View Post
                        You're sure..? Well, let see what we can find in Unreal Wiki...

                        Default properties:
                        The compiler removes defaultproperties and cpptext sections from source files during import. Cpptext lines will be replaced by the comment // (cpptext) to prevent line number changes, the defaultproperties block is removed without replacement, which is why it should always be placed at the end of the file after all other code.

                        Functions:
                        A function in UnrealScript is a subroutine associated with a specific class. Functions can define zero or up to sixteen parameters and optionally a return type. Various modifiers can be used in the declaration to change the way the function can be accessed or how it behaves when called.

                        Events:
                        ...the keyword event may replace the keyword function without any effect on the UnrealScript level. However, when exporting native header files from script code, event functions will have calling stubs generated so the UnrealScript function can be called more easily from C++ code. These generated C++ methods have the name eventNameOfUnrealScriptFunction and their parameters and possible return type reflects the UnrealScript function declaration.

                        Most important difference is, that that native call -event- you can enable/disable - function not.

                        If you want to know how, look in to Object.uc...
                        Code:
                        //
                        // Probe messages.
                        //
                        
                        native(117) final function Enable( name ProbeFunc );
                        native(118) final function Disable( name ProbeFunc );
                        As I said, at unreal script level there's no difference between event and function (I wasn't referring to the DefaultProperties).


                        UE4 will most probably use Unreal Script, might have some differences but it'll be Unreal Script.

                        Comment


                        • #42
                          I don't see why anyone would want to use C++? Unrealscript is a simple and powerful language when used right. I originally came from actionscript 3 and no problem adapting to unrealscript at all. In fact, if Epic changed over to C++, more and more people would probably become even more scared of programming. C++ is a messy language, heck to even fully understand it you'd have to firstly learn C.

                          Comment


                          • #43
                            Games are programmed in C++, this is an almost universal truth. The switch to it means "real" game developers don't have to learn a new language just to start making games. Executing equivalent code in C++ over UnrealScript also means significant improvements in speed (in the order of 20-30 times faster).

                            You don't have to learn C first. I've never learnt 'C'.

                            Comment


                            • #44
                              Originally posted by ambershee View Post
                              Games are programmed in C++, this is an almost universal truth. The switch to it means "real" game developers don't have to learn a new language just to start making games. Executing equivalent code in C++ over UnrealScript also means significant improvements in speed (in the order of 20-30 times faster).

                              You don't have to learn C first. I've never learnt 'C'.
                              I said, you'd have to learn C first if you want to fully UNDERSTAND C++. You can't exactly compare C++ to an interpreted language (Unrealscript), it'll always be faster in performance!

                              Comment


                              • #45
                                I don't think you need to fully understand C++ for gameplay programming.

                                Comment

                                Working...
                                X