Announcement

Collapse
No announcement yet.

Converting to C++ from UnrealScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Converting to C++ from UnrealScript

    Hi all,

    I've a few mods here and there in UDK with the script for side-scrolling cameras, or weapons etc, is there a way to bring my old code into UE4, or does it need to be completely re-written?

    Im more designer/artist than code so if this is the case, it will write UE4 off for me as my core engine..

    Cheers in advance

    Dodge

    #2
    gonna have to rewrite it as unrealscript was completely removed, its full C++ now
    Self-Learning to program, Open to advice!

    Comment


      #3
      No, there no Unreal Script so you will need to re-write, but if you artist you might find Blueprint frendly for you. Here example of a guy with same issue like you have,who making game right now:

      =========
      My Tutorials:
      Basic knowledge about Classes and UObject environment and stuff like that

      Comment


        #4
        Originally posted by Dodge View Post
        Hi all,

        I've a few mods here and there in UDK with the script for side-scrolling cameras, or weapons etc, is there a way to bring my old code into UE4, or does it need to be completely re-written?

        Im more designer/artist than code so if this is the case, it will write UE4 off for me as my core engine..

        Cheers in advance

        Dodge
        You shouldn't need to reinvent too many wheels, depending on what your code was doing. The general idea to keep in mind, UnrealScript has similar syntax to C++ already, and by and large, your algorithms should be able to be ported over to C++ with virtually no difficulty, and should continue to work.

        The only things that are absolutely not able to be ported are States, replication blocks and your default properties block. States do not exist any longer, replication is handled in a very similar fashion, but not exactly the same, and your default properties block is now your C++ constructor, as it should have been the whole time.

        It is quite unfortunate that you feel this is too much of an undertaking, as I think that working in C++ has been a pretty healthy release from the UnrealScript world. I am playing with the idea of writing an UnrealScript binding that would allow you to move your UDK based UnrealScript to work in UE4 land. If you are interested in it, I would love to have a chat and maybe sort out the details.
        About Me | JavaScript and UE4 | Exodus | Code Notes

        Comment


          #5
          There is also the option of not porting the code if it seems like its going to be too daunting a task, you could finish up what you were doing on UDK and start a smaller learning project on UE4 if youre not entirely confident

          Comment


            #6
            I would rather ask here instead of starting a new thread. Looks like I'm a total noob once again lol. Since states are gone, what do we do now to go about making such behavior?

            Check out my discord -> https://discord.gg/kQdVwJ3

            Follow us on twitter to get updates on new products and special offers -> https://twitter.com/BlackFangTech

            Black Fang Technologies' products -> https://www.unrealengine.com/marketp...20Technologies

            Comment


              #7
              Originally posted by BlackRang666 View Post
              Since states are gone, what do we do now to go about making such behavior?
              You can recreate a similar type of functionality, but nothing quite as easy to parse at a glance in C++. One road is to have a switch that executes sub methods for each state, and default for when that state should skip an event.

              You can also play with composition, where you compose a given object with a reference to an instance of a method that is friendly and executes something, similar to components. The trick here is that you need to swap instances in and out as your states need to be transitioned.

              There are other opportunities for you as well, like making extremely obfuscated Macros that allow you to do one or both of the above. There is, however, no simpler solution in C++, at least not yet =) Maybe I will go ahead and write it if you all send me a check.

              [BTW]
              This is absolutely not a NOOB question. You did good, keep it up. Questions like this are the inspiration to many.
              [/BTW]
              About Me | JavaScript and UE4 | Exodus | Code Notes

              Comment


                #8
                Originally posted by BlackRang666 View Post
                I would rather ask here instead of starting a new thread. Looks like I'm a total noob once again lol. Since states are gone, what do we do now to go about making such behavior?
                Behavior Trees are built in. That is probably the easiest built in way to do AI in UE4.

                Comment


                  #9
                  Originally posted by BlackRang666 View Post
                  I would rather ask here instead of starting a new thread. Looks like I'm a total noob once again lol. Since states are gone, what do we do now to go about making such behavior?
                  Well UnrealScript has similar syntax to C++ and i seen UE APIs are made so it's very easy to transition, you could five it a shot
                  =========
                  My Tutorials:
                  Basic knowledge about Classes and UObject environment and stuff like that

                  Comment


                    #10
                    But I don't use states just for AI, I made a fresh UDK install about 5 days ago and have a pawn that uses states for all of its different movement behavior (I was experimenting with wall-running and the like). Looks like its back to if statements. :P

                    Check out my discord -> https://discord.gg/kQdVwJ3

                    Follow us on twitter to get updates on new products and special offers -> https://twitter.com/BlackFangTech

                    Black Fang Technologies' products -> https://www.unrealengine.com/marketp...20Technologies

                    Comment


                      #11
                      Originally posted by Shadowriver View Post
                      Well UnrealScript has similar syntax to C++ and i seen UE APIs are made so it's very easy to transition, you could five it a shot
                      With that mindset you would also be able to argue that transitioning between Java and C is an easy transition. I know of no one who would agree with that. Unrealscript has its oddities and will require a non trivial amount of time to move over. The syntax constructs, and organization of code is similar, but there are some patterns that you fall into found in the language that may need to be unlearned, like accessed Nones.
                      About Me | JavaScript and UE4 | Exodus | Code Notes

                      Comment


                        #12
                        Originally posted by Bob_Gneu View Post
                        With that mindset you would also be able to argue that transitioning between Java and C is an easy transition. I know of no one who would agree with that. Unrealscript has its oddities and will require a non trivial amount of time to move over. The syntax constructs, and organization of code is similar, but there are some patterns that you fall into found in the language that may need to be unlearned, like accessed Nones.
                        What mean by "easy to transition" is fact that in API i can see exact same patterns which might be helpful with transitioning once you learn C++ basis which i know it's wall which once you cross it things become easier.

                        I don't it simply my felling
                        Last edited by Shadowriver; 03-21-2014, 10:30 PM.
                        =========
                        My Tutorials:
                        Basic knowledge about Classes and UObject environment and stuff like that

                        Comment


                          #13
                          Okay, I've made a project and I have a few simple scripts that successfully compile. Let me check my understanding. I will be using my class constructors as I used to use default properties and postbeginplay?

                          Check out my discord -> https://discord.gg/kQdVwJ3

                          Follow us on twitter to get updates on new products and special offers -> https://twitter.com/BlackFangTech

                          Black Fang Technologies' products -> https://www.unrealengine.com/marketp...20Technologies

                          Comment


                            #14
                            Constructors do replace defaultproperties, but not BeginPlay. You override that function in C++ just like you did in UnrealScript.
                            Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
                            Twitter: @EpicJamesG

                            Comment


                              #15
                              wow!!
                              its really wonderful

                              Comment

                              Working...
                              X