Announcement

Collapse
No announcement yet.

4.7 C++ Transition Guide

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

  • replied
    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.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    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,

    Leave a comment:


  • replied
    4.7 Class Constructors

    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
    Last edited by Rama; 02-28-2015, 08:58 AM.

    Leave a comment:


  • replied
    Originally posted by Jarek View Post
    Hi DamirH,
    I've tried adding Super() to constructor initialization list in 4.7 to the above code in fresh project and I had not reproduced any crash. Is it something that was re-occuring to you? Could you provide more details how to reproduce the crash?

    We'd like to investigate, but without repro it's not possible.

    Thanks,
    Jarek
    Hey Jarek,

    It was recurring, I couldn't launch the project all, ever. I am not in the office right now so I'll be able to post code in the morning.

    EDIT:

    Ok, I can replicate it. Editor loads up to 70% then crashes.

    Code

    Crash Log
    Last edited by DamirH; 02-28-2015, 01:00 AM.

    Leave a comment:


  • replied
    Simply use the normal constructor with the ObjectInitializer. It won't kill you doing so, and you would save nothing by using the default constructor.

    Leave a comment:


  • replied
    Originally posted by DamirH View Post
    As I learned the hard way, not only are you not required to add a call to Super() in the constructor, but if you do, your editor will crash on startup.
    Hi DamirH,
    I've tried adding Super() to constructor initialization list in 4.7 to the above code in fresh project and I had not reproduced any crash. Is it something that was re-occuring to you? Could you provide more details how to reproduce the crash?

    We'd like to investigate, but without repro it's not possible.

    Thanks,
    Jarek

    Leave a comment:


  • replied
    I can confirm that with Game Mode and GameState you still need to use an ObjectInitializer.

    As kamrann said further up, it depends if the inherited class uses GENERATED_BODY or GENERATED_UCLASS_BODY. With GameState and GameMode thats the case. Looking at HUD, I also see GENERATED_UCLASS_BODY so you would still need an ObjectInitializer for that too.

    Leave a comment:


  • replied
    I could swear I replaced it in my game mode. Will double check when I'm in the office tomorrow.

    Leave a comment:


  • replied
    Regarding constructors, it seems there's no way to replace AYourHud(const FObjectInitializer& ObjectInitializer) and AYourGameMode(const FObjectInitializer& ObjectInitializer) with versions without FObjectInitializer's.
    You must keep them for HUD and GameMode.

    Leave a comment:


  • replied
    Originally posted by milliams View Post
    I was just bitten by DrawDynamicElements being removed from scene proxies. It seems it was deprecated in UE 4.5 and was planned to be removed since then. It's shame that Epic didn't add a deprecation warning to those using DrawDynamicElements (to cause compiler warning) in the meantime but it wasn't too difficult to track down the reason my meshes weren't being displayed.

    It's a simple enough change to make since the replacement function is very similar but you can see what I had to do at https://github.com/volumesoffun/cubi...ommit/2a81df4b

    I believe that the wiki tutorial on procedural mesh generation will need updating too.
    Thanks for sharing Milliams, very important info!

    For anyone who is interested, here's Epic's 4.7 Release note on this topic:

    "GetDynamicMeshElements path on scene proxies is enabled by default
    PreRenderView / DrawDynamicElements are no longer used and have been removed"


    ~~~

    Request

    Milliams or someone else who is currently doing dynamic mesh stuff, can you update the Procedural Mesh Generation wiki to 4.7 ?

    https://wiki.unrealengine.com/Proced...esh_Generation

    I want to make sure a fully rigorous test case is used to verify the new code and I dont have such a test case right now.

    Rama
    Last edited by Rama; 02-26-2015, 09:43 PM.

    Leave a comment:


  • replied
    I was just bitten by DrawDynamicElements being removed from scene proxies. It seems it was deprecated in UE 4.5 and was planned to be removed since then. It's shame that Epic didn't add a deprecation warning to those using DrawDynamicElements (to cause compiler warning) in the meantime but it wasn't too difficult to track down the reason my meshes weren't being displayed.

    It's a simple enough change to make since the replacement function is very similar but you can see what I had to do at https://github.com/volumesoffun/cubi...ommit/2a81df4b

    I believe that the wiki tutorial on procedural mesh generation will need updating too.

    Leave a comment:


  • replied
    Bah, I misunderstood what you wrote... Yeah, that sucks indeed, but the old way with FObjectInitializer still works so you can fall back to that for classes that don't have the constructor yet.

    Leave a comment:


  • replied
    Originally posted by DamirH View Post
    Well it should be trivial to add a constructor to parent classes.
    I don't think anyone is going to be rebuilding the engine from source every time they want to derive from another class, just to avoid having to write an extra argument into their constructor.

    Leave a comment:


  • replied
    Well it should be trivial to add a constructor to parent classes.

    Leave a comment:

Working...
X