Announcement

Collapse
No announcement yet.

4.7 C++ Transition Guide

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

    #31
    Hi,

    IOnlineFriends have been changed to add the delegate inside the parameter functions like ReadList..
    IChatInterface have been added, so you must implement it in your OSS Class.

    I'm still converting my project, but those one were not highlighted in the release notes

    Thanks,

    Comment


      #32
      Blackboard Key Init

      Header.h

      Code:
      uint8 enemyKeyID; // no change
      Source.cpp
      Code:
      blackboardComp->SetValueAsObject(enemyKeyID, InPawn);
      
      /* becomes */
      
      #include "BehaviorTree/Blackboard/BlackboardKeyType_Object.h" 
      ...
      
      blackboardComp->SetValue<UBlackboardKeyType_Object>(enemyKeyID, InPawn);
      I don't really understand why they did this , but now you need to include each file for each type (Object , Float , bool ,...)
      Last edited by Madness; 02-28-2015, 11:23 AM.
      Portfolio: www.pierrelaot.com

      Comment


        #33
        Rama,

        No reason, I just noted that adding a call to Super() from a default empty constructor makes the editor impossible to launch, that's all.

        Comment


          #34
          Originally posted by Rama View Post
          Dear DamirH,

          Is there a reason you are avoiding the ObjectInitializer constructor?

          ~~~

          4.7 Class Constructors

          For those who might be confused about all this:

          You can easily create a constructor in 4.7 using this arrangement:

          .h
          Code:
          UCLASS()
          class AYourClass : public AYourSuperClass
          {
          	GENERATED_BODY()
          public: 
          	AYourClass(const FObjectInitializer& ObjectInitializer);
          
          };
          .cpp
          Code:
          AYourClass::AYourClass(const FObjectInitializer& ObjectInitializer)
          	: Super(ObjectInitializer)
          {
             //add your constructor code / other constructor function calls here
          }
          Enjoy!

          Rama
          "Creating sub-objects for Unreal classes now has a new simple syntax."

          I tried finding some documentation on what this means, but haven't found any luck. Previously in the constructor I was using as you show it with the FObjectInitializer. In the default constructor now without the initializer, how would you create a sub-object? For now I will stick with the old constructor style but was just curious.

          Comment


            #35
            Originally posted by xconverge View Post
            "Creating sub-objects for Unreal classes now has a new simple syntax."

            I tried finding some documentation on what this means, but haven't found any luck. Previously in the constructor I was using as you show it with the FObjectInitializer. In the default constructor now without the initializer, how would you create a sub-object? For now I will stick with the old constructor style but was just curious.

            There's a post in this thread, just do this:

            UCLASS()
            class WAPROTOTYPE_API AWaCharacterBase : public ACharacter
            {
            GENERATED_BODY()

            //A bunch of functions and properties

            public:
            AWaCharacterBase();
            }

            AWaCharacterBase::AWaCharacterBase()
            {
            //Constructor code here

            }

            Comment


              #36
              Originally posted by xconverge View Post
              I tried finding some documentation on what this means, but haven't found any luck. Previously in the constructor I was using as you show it with the FObjectInitializer. In the default constructor now without the initializer, how would you create a sub-object? For now I will stick with the old constructor style but was just curious.
              Just replace
              Code:
              ObjectInitializer.CreateDefaultSubobject< Type >(this, Name);
              with
              Code:
              CreateDefaultSubobject< Type >(Name);

              Comment


                #37
                I think you're confused with 'calling' super like this:

                Code:
                AWaCharacterBase::AWaCharacterBase() : Super()
                {
                    //constructor code
                }
                This is what you're supposed to do, it specifies which version of the superclass constructor should be called just before this constructor is run. If you are just using the superclass default constructor you don't even need to do : Super(), since it does that by default.

                Comment


                  #38
                  Originally posted by kamrann View Post
                  Just replace
                  Code:
                  ObjectInitializer.CreateDefaultSubobject< Type >(this, Name);
                  with
                  Code:
                  CreateDefaultSubobject< Type >(Name);
                  thanks! it was the "this" I wasn't omitting, was still using the 2 argument overload

                  Comment


                    #39
                    Originally posted by The Beej View Post
                    I think you're confused with 'calling' super like this:

                    Code:
                    AWaCharacterBase::AWaCharacterBase() : Super()
                    {
                        //constructor code
                    }
                    This is what you're supposed to do, it specifies which version of the superclass constructor should be called just before this constructor is run. If you are just using the superclass default constructor you don't even need to do : Super(), since it does that by default.
                    That was indeed the case. I was under the impression that the two were equivalent to each other.

                    Comment


                      #40
                      'bReplicateInstigator' : undeclared identifier
                      Guess this one is gone?

                      warning C4996: 'IOnlineSession::ClearOnCreateSessionCompleteDelegate': The ClearOnCreateSessionCompleteDelegate function is deprecated - please use the AddOnCreateSessionCompleteDelegate_Handle function and pass its return value to ClearOnCreateSessionCompleteDelegate_Handle instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
                      This one too.. (among many other IOnlineSession codes)
                      Last edited by KillerPenguin; 03-01-2015, 10:28 PM.

                      Comment


                        #41
                        In 4.7 AAIController::MoveToActor() doesn't really automatically updating its target position like it use to.

                        I've tested using AAIController::GetImmediateMoveDestination() and it seems to be updating once it reach the first target.
                        Wierd yet, after that my AI running back and forth between its original position and next points along its path.
                        Last edited by KillerPenguin; 03-02-2015, 09:26 PM.

                        Comment


                          #42
                          Does someone know why the background of this changes : 'bReplicateInstigator' : undeclared identifier?
                          What happened to this behavior? Is it acting as True or false?

                          IOnlineFriends - Watch out, the function signature are not all the same. I mean, that some changed with passing a delegate to it to be called once it's over, and the others still work in the old fashion.
                          FYI I raised a Answers question on this
                          It will help to understand where we are going in the future...

                          Comment


                            #43
                            Originally posted by Elvince View Post
                            Does someone know why the background of this changes : 'bReplicateInstigator' : undeclared identifier?
                            What happened to this behavior? Is it acting as True or false?
                            bReplicateInstigator got removed from the engine!

                            It's in the release notes that they removed certain unused actor replication variables

                            Have fun today Elvince!



                            Rama
                            100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                            UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                            Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                            Comment


                              #44
                              Bump for those still converting to 4.7
                              100+ UE4 C++ Tutorials on the UE4 Code Wiki, including UE4 Multi-Threading!

                              UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                              Visit www.ue4code.com to see lots of videos about my C++ Creations! ♥ Rama

                              Comment


                                #45
                                Heh, reminds me of Blade's Unrealscript upgrade threads before, nice one Rama. Thanks!

                                Comment

                                Working...
                                X