marciola
(marciola)
June 29, 2016, 4:07am
1
I am using the first person shooter template to test the Visual Logger. I am following the tutorial below but am getting an error in the MyCharacter.h and MyCharacter.cpp. I have included the VisualLogger.h file in MyCharacter.cpp.
The error XCode is giving me for MyCharacter.h is:
‘GrabDebugSnapshot’ marked ‘override’ but does not override any member function.
The error XCode is giving me for MyCharacter.cpp is:
No type named ‘GrabDebugSnapshot’ in ‘ACharacter’.
Any help is greatly appreciated! Thanks
marciola
(marciola)
June 30, 2016, 5:51pm
2
Still haven’t been able to find the solution to this
I just ran into this too. It looks like the docs are out of date.
GrabDebugSnapshot() was moved to an interface. Here’s what I did to get it working:
In your header file:
…add this include…
#include "VisualLogger/VisualLoggerDebugSnapshotInterface.h"
…add this above your class declaration…
DECLARE_LOG_CATEGORY_EXTERN(MyLogCategory, Log, All);
…inherit from IVisualLoggerDebugSnapshotInterface…
class AMyCharacter : public ACharacter, public IVisualLoggerDebugSnapshotInterface
In your cpp file:
…add this include…
#include "VisualLogger/VisualLogger.h"
…add this just below your includes…
DEFINE_LOG_CATEGORY(MyLogCategory);
…add your UE_LOG calls whereever…
UE_VLOG(this, MyLogCategory, Verbose, TEXT("I did something"));
…remove the call to Super::GrabDebugSnapshot() from your GrabDebugSnapshot() function…
#if ENABLE_VISUAL_LOG
void AMyCharacter::GrabDebugSnapshot(FVisualLogEntry* Snapshot) const
{
// Remove this --> Super::GrabDebugSnapshot(Snapshot)
const int32 CatIndex = Snapshot->Status.AddZeroed();
FVisualLogStatusCategory& PlaceableCategory = Snapshot->Status[CatIndex];
PlaceableCategory.Category = TEXT("My Category");
PlaceableCategory.Add(TEXT("My Character Class"), TEXT("Log some stuff"));
}
#endif
I hope that helps!
Sqobar
(Sqobar)
December 27, 2016, 10:34pm
4
aaroncox1234 , many many thanks! It’s works.