Announcement

Collapse
No announcement yet.

4.5 Transition Guide, Community Contributions Welcome!

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

    4.5 Transition Guide, Community Contributions Welcome!

    Dear Community,

    Here again is my thread where we can post what we are learning as we upgrade our projects to 4.5!

    Please feel free to post any compile errors and the solutions you found while upgrading your C++ code to 4.5!

    I'll start!

    ~~~

    ULocalPlayer::GetUniqueNetId() Removed

    There is a new CachedID logic, and if you are not yet using it you should use GetPreferredUniqueNetId()

    Code:
    /** 
    	 * Retrieves this player's unique net ID from the online subsystem 
    	 *
    	 * @return unique Id associated with this player
    	 */
    	TSharedPtr<class FUniqueNetId> GetUniqueNetIdFromCachedControllerId() const;
    
    	/** 
    	 * Retrieves this player's unique net ID that was previously cached
    	 *
    	 * @return unique Id associated with this player
    	 */
    	TSharedPtr<class FUniqueNetId> GetCachedUniqueNetId() const;
    
    	/** Sets the players current cached unique net id */
    	void SetCachedUniqueNetId( TSharedPtr<class FUniqueNetId> NewUniqueNetId );
    
    	/** 
    	 * Retrieves the preferred unique net id. This is for backwards compatibility for games that don't use the cached unique net id logic
    	 *
    	 * @return unique Id associated with this player
    	 */
    	TSharedPtr<FUniqueNetId> GetPreferredUniqueNetId() const;


    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

    #2
    Online Session Interface

    OnJoinSessionCompleteDelegate



    The signature for this delegate

    Code:
    /** Delegate after joining a session */
    FOnJoinSessionCompleteDelegate OnJoinSessionCompleteDelegate;
    has changed from

    Code:
    void AVictoryGameSession::OnJoinSessionComplete(FName SessionName, bool bWasSuccessful)
    {
    to

    Code:
    void FTestSessionInterface::OnJoinSessionComplete(FName SessionName, EOnJoinSessionCompleteResult::Type Result)
    {

    now to test success you use:

    Code:
    if (Result == EOnJoinSessionCompleteResult::Success)
    {
    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


      #3
      Am i mistaken that FOnJoinSessionCompleteDelegate is now taking a new parameters type in 4.5?

      DEFINE_ONLINE_DELEGATE_TWO_PARAM(OnJoinSessionComplete, FName, EOnJoinSessionCompleteResult::Type);

      Just noticing that this wasn't in the log (or at least I couldn't find it.)

      ps. Dang it, Rama posted the correction before I finished typing rofl.

      Comment


        #4
        Originally posted by KillerPenguin View Post
        ps. Dang it, Rama posted the correction before I finished typing rofl.
        Hee hee!

        ~~~

        STextBlock::GetText()

        This function now returns an FText by Reference, instead of an FString by value!

        Code:
        /**
        	 * Gets the text assigned to this text block
        	 *
        	 * @return	This text block's text string
        	 */
        	const FText& GetText() const
        	{
        		return BoundText.Get();
        	}
        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


          #5
          LogCompile:Error: Static array cannot be exposed to blueprint HatredBaseCharacter.EmotionalsIntervals

          Code:
          UPROPERTY(BlueprintReadWrite, Category = "Pawn")
          	float EmotionalsIntervals[EHatredEmotionalState::MAX];
          So far, no clue how to fix this. This was nice feature to show enum names as indices in arrays.

          The fix is pretty simple change BlueprintReadWrite to EditDefaultsOnly, this BlueprintReadWrite wasn't intended here
          Last edited by Pierdek; 10-15-2014, 08:05 AM.

          Comment


            #6
            4.5 Is Awesome for C++ People

            I've posted my feedback on 4.5 from C++ perspective here!
            https://forums.unrealengine.com/show...l=1#post163844

            It's incredible!

            I was able to upgrade my entire code base that I've been building since the Beta in just a few minutes!

            And my compile times are twice as fast now, even when doing .h changes!

            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


              #7
              Just want to add that i have some issues with the camera / Arrow componet.
              In 4.4 and erlier Ue 4 whould fix the placement (location/ rotation) the same way as a arrow component same goes for the character mesh.

              My camera is attached to a socket on my chars face in PostInitzeliseComponents();
              But now that nice functionality is not working any more.
              And my camera is now turned 90 degres both to the side and rotation.

              Comment


                #8
                I've experienced some camera issues as well WCode, luckily mine were easy to fix.

                If you manage to fix your problem let us know, if you don't mind, because I'm thinking of implementing a solution which resembles what you described.
                Good luck!
                [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

                Looking for fellow programmers to develop a project.

                Comment


                  #9
                  Originally posted by Horus View Post
                  I've experienced some camera issues as well WCode, luckily mine were easy to fix.

                  If you manage to fix your problem let us know, if you don't mind, because I'm thinking of implementing a solution which resembles what you described.
                  Good luck!
                  Can i ask what problem you had and how you solved it?
                  And defenatly as soon as i figuer out the resson for the camera / arrow bug i will let everyone know in this thread.

                  Tilting your head gets old fast, lol.

                  EDIT: Also seems Epic removed FMatrix::InverseSafe();
                  Last edited by WCode; 10-15-2014, 07:50 AM.

                  Comment


                    #10
                    @WCode- Basically I changed the camera type, I've been meaning to change it for some time now but hadn't wasted time looking for the right vars to make it work like I want.
                    I added CharacterMovement->bUseControllerDesiredRotation = true; instead of CharacterMovement->bOrientRotationToMovement = true; simply because it suited my purpose, and the wacky camera stopped being wacky to play as I wanted lol.

                    Though I'm pretty sure this wont help you..
                    [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

                    Looking for fellow programmers to develop a project.

                    Comment


                      #11
                      Originally posted by Horus View Post
                      @WCode- Basically I changed the camera type, I've been meaning to change it for some time now but hadn't wasted time looking for the right vars to make it work like I want.
                      I added CharacterMovement->bUseControllerDesiredRotation = true; instead of CharacterMovement->bOrientRotationToMovement = true; simply because it suited my purpose, and the wacky camera stopped being wacky to play as I wanted lol.

                      Though I'm pretty sure this wont help you..
                      Hey mate I found a fix for the camera issue, (Use Pawn Control Rotation)
                      Click image for larger version

Name:	FPS_Cam.PNG
Views:	1
Size:	23.0 KB
ID:	1057808
                      Cheers!

                      Comment


                        #12
                        Originally posted by WCode View Post
                        Hey mate I found a fix for the camera issue, (Use Pawn Control Rotation)
                        [ATTACH=CONFIG]14239[/ATTACH]
                        Cheers!
                        Glad to hear it!
                        [On Hold]WIP: Vertex-Based Ledge Detection/Parkour Engine

                        Looking for fellow programmers to develop a project.

                        Comment


                          #13
                          Originally posted by Pierdek View Post
                          LogCompile:Error: Static array cannot be exposed to blueprint HatredBaseCharacter.EmotionalsIntervals

                          Code:
                          UPROPERTY(BlueprintReadWrite, Category = "Pawn")
                          	float EmotionalsIntervals[EHatredEmotionalState::MAX];
                          So far, no clue how to fix this. This was nice feature to show enum names as indices in arrays.

                          The fix is pretty simple change BlueprintReadWrite to EditDefaultsOnly, this BlueprintReadWrite wasn't intended here
                          I believe this is actually a spurious error - your property is not a static array - it's a statically-sized array member variable. It should work fine.

                          Comment


                            #14
                            If you're dealing with lights SetBrightness(float) has been replace with SetIntensity(float) .

                            ^_^

                            Comment


                              #15
                              I was experiencing issues with the CameraComponents too (mine is derived from the base third-person C++ template). Turns out that bUseControllerViewRotation property of the components is now deprecated. It won't kick up any errors or anything during compile time, but it also won't actually do anything during runtime due to it being an empty UPROPERTY. If you wanna see more on why it was deprecated I'd suggest peeking its definition in Visual Studio and the code comments will explain it.

                              Meanwhile the functionality can be achieved same as before but by using the new bUsePawnControlRotation property.

                              Comment

                              Working...
                              X