I am trying to create a C++ component on my door object, and I go through and create the “OpenDoor” class just fine, and it opens up in VScode. However I do not see any listed components on my door after creating it. I’ve then tried to re-create it, but it says it exists already. I even try clicking add component and search for the newly made class “OpenDoor” but there is nothing there.
I have then tried deleting the class files in windows explorer, and binaries folder, which caused it to not be able to recompile when I open UE4.
I found a workaround to get the project loading since then, but am now stuck back where I started. No matter what I try, when I add component to my door, it does not add the component, and I cannot find it anywhere, even though it exists.
DanM
May 28, 2021, 7:36am
2
Are you sure you derived from UActorComponent and not AActor? Could you post your code?
I’m not sure, I clicked on the door model, and clicked Add Component from there. Now the project won’t open, I’m getting the message:
“The BuildingEscapeEditor.target file does not exist. Would you like to build the editor?”
After I click yes, it says starting build for a few seconds, and then I get another error:
“BuildingEscape could not be compiled. Try rebuilding from source manually”
DanM
May 30, 2021, 9:10am
4
In your Source folder you should have a file called `BuildingEscapeEditor.target.cs". If you don’t add it with this content
using UnrealBuildTool;
using System.Collections.Generic;
public class BuildingEscapeEditorTarget : TargetRules
{
public BuildingEscapeEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
ExtraModuleNames.AddRange( new string[] { "BuildingEscape" } );
}
}
That file already exists in the source folder. The only difference is I have this line within the “BuildingEscapeEditorTarget”:
DefaultBuildSettings = BuildSettingsVersion.V2;
DanM
May 30, 2021, 8:14pm
6
Could you post the most recent log within Saved > Logs?
sure!
Log file open, 05/29/21 10:06:33
LogInit: LLM is enabled
LogInit: LLM CsvWriter: off TraceWriter: off
LogInit: Display: Running engine for game: BuildingEscape
LogPlatformFile: Not using cached read wrapper
LogTaskGraph: Started task graph with 5 named threads and 47 total threads with 3 sets of task threads.
LogStats: Stats thread started at 0.204965
LogD3D11RHI: Loaded GFSDK_Aftermath_Lib.x64.dll
LogICUInternationalization: ICU TimeZone Detection - Raw Offset: -8:00, Platform Override: ''
LogPluginManager: Mounting plugin MeshPainting
LogPluginManager: Mounting plugin XGEController
LogPluginManager: Mounting plugin AISupport
LogPluginManager: Mounting plugin EnvironmentQueryEditor
LogPluginManager: Mounting plugin Paper2D
LogPluginManager: Mounting plugin LightPropagationVolume
LogPluginManager: Mounting plugin CameraShakePreviewer
LogPluginManager: Mounting plugin CryptoKeys
LogPluginManager: Mounting plugin CurveEditorTools
LogPluginManager: Mounting plugin AssetManagerEditor
LogPluginManager: Mounting plugin DataValidation
LogPluginManager: Mounting plugin FacialAnimation
LogPluginManager: Mounting plugin GeometryMode
LogPluginManager: Mounting plugin MobileLauncherProfileWizard
LogPluginManager: Mounting plugin MacGraphicsSwitching
LogPluginManager: Mounting plugin PluginBrowser
LogPluginManager: Mounting plugin SpeedTreeImporter
LogPluginManager: Mounting plugin MaterialAnalyzer
LogPluginManager: Mounting plugin DatasmithContent
LogPluginManager: Mounting plugin GameplayTagsEditor
LogPluginManager: Mounting plugin AnimationSharing
LogPluginManager: Mounting plugin AutomationUtils
LogPluginManager: Mounting plugin VariantManagerContent
LogPluginManager: Mounting plugin AlembicImporter
LogPluginManager: Mounting plugin BackChannel
LogPluginManager: Mounting plugin ChaosCloth
LogPluginManager: Mounting plugin ChaosEditor
LogPluginManager: Mounting plugin ChaosNiagara
LogPluginManager: Mounting plugin ChaosClothEditor
LogPluginManager: Mounting plugin ChaosSolverPlugin
LogPluginManager: Mounting plugin CharacterAI
LogPluginManager: Mounting plugin GeometryCache
LogPluginManager: Mounting plugin GeometryCollectionPlugin
LogPluginManager: Mounting plugin GeometryProcessing
LogPluginManager: Mounting plugin MotoSynth
LogPluginManager: Mounting plugin PlanarCut
LogPluginManager: Mounting plugin ProxyLODPlugin
LogPluginManager: Mounting plugin PlatformCrypto
LogPluginManager: Mounting plugin SkeletalReduction
LogPluginManager: Mounting plugin Niagara
LogPluginManager: Mounting plugin LuminPlatformFeatures
LogPluginManager: Mounting plugin MagicLeap
LogPluginManager: Mounting plugin MagicLeapLightEstimation
LogPluginManager: Mounting plugin MagicLeapMedia
LogPluginManager: Mounting plugin MagicLeapPassableWorld
LogPluginManager: Mounting plugin MLSDK
LogPluginManager: Mounting plugin UdpMessaging
LogPluginManager: Mounting plugin TcpMessaging
LogPluginManager: Mounting plugin OnlineSubsystem
LogPluginManager: Mounting plugin OnlineSubsystemNull
LogPluginManager: Mounting plugin OnlineSubsystemUtils
LogPluginManager: Mounting plugin LevelSequenceEditor
LogPluginManager: Mounting plugin MatineeToLevelSequence
LogPluginManager: Mounting plugin ActorSequence
LogPluginManager: Mounting plugin LauncherChunkInstaller
LogPluginManager: Mounting plugin TemplateSequence
LogPluginManager: Mounting plugin AndroidMedia
LogPluginManager: Mounting plugin AvfMedia
LogPluginManager: Mounting plugin MediaCompositing
LogPluginManager: Mounting plugin ImgMedia
LogPluginManager: Mounting plugin ScreenshotTools
LogPluginManager: Mounting plugin ActorLayerUtilities
LogPluginManager: Mounting plugin AndroidDeviceProfileSelector
LogPluginManager: Mounting plugin AndroidPermission
LogPluginManager: Mounting plugin AndroidMoviePlayer
LogPluginManager: Mounting plugin AppleImageUtils
LogPluginManager: Mounting plugin AppleMoviePlayer
LogPluginManager: Mounting plugin AssetTags
LogPluginManager: Mounting plugin ArchVisCharacter
LogPluginManager: Mounting plugin AudioCapture
LogPluginManager: Mounting plugin AudioSynesthesia
LogPluginManager: Mounting plugin ChunkDownloader
LogPluginManager: Mounting plugin CableComponent
LogPluginManager: Mounting plugin EditableMesh
LogPluginManager: Mounting plugin GoogleCloudMessaging
LogPluginManager: Mounting plugin CustomMeshComponent
LogPluginManager: Mounting plugin ExampleDeviceProfileSelector
LogPluginManager: Mounting plugin GooglePAD
LogPluginManager: Mounting plugin IOSDeviceProfileSelector
LogPluginManager: Mounting plugin LocationServicesBPLibrary
LogPluginManager: Mounting plugin LinuxDeviceProfileSelector
LogPluginManager: Mounting plugin MobilePatchingUtils
LogPluginManager: Mounting plugin PhysXVehicles
LogPluginManager: Mounting plugin PostSplashScreen
LogPluginManager: Mounting plugin ProceduralMeshComponent
LogPluginManager: Mounting plugin PropertyAccessEditor
LogPluginManager: Mounting plugin SoundFields
LogPluginManager: Mounting plugin RuntimePhysXCooking
LogPluginManager: Mounting plugin SignificanceManager
LogPluginManager: Mounting plugin Synthesis
LogPluginManager: Mounting plugin WebMMoviePlayer
LogPluginManager: Mounting plugin WindowsMoviePlayer
LogPluginManager: Mounting plugin CLionSourceCodeAccess
LogPluginManager: Mounting plugin CodeLiteSourceCodeAccess
LogPluginManager: Mounting plugin GitSourceControl
LogPluginManager: Mounting plugin KDevelopSourceCodeAccess
LogPluginManager: Mounting plugin PlasticSourceControl
LogPluginManager: Mounting plugin SubversionSourceControl
LogPluginManager: Mounting plugin NullSourceCodeAccess
LogPluginManager: Mounting plugin PluginUtils
LogPluginManager: Mounting plugin PerforceSourceControl
LogPluginManager: Mounting plugin PropertyAccessNode
LogPluginManager: Mounting plugin RiderSourceCodeAccess
LogPluginManager: Mounting plugin UObjectPlugin
LogPluginManager: Mounting plugin VisualStudioSourceCodeAccess
LogPluginManager: Mounting plugin VisualStudioCodeSourceCodeAccess
LogPluginManager: Mounting plugin XCodeSourceCodeAccess
LogPluginManager: Mounting plugin MediaPlayerEditor
LogPluginManager: Mounting plugin WebMMedia
LogPluginManager: Mounting plugin WmfMedia
LogPluginManager: Mounting plugin ContentBrowserClassDataSource
LogPluginManager: Mounting plugin ContentBrowserAssetDataSource
LogPluginManager: Mounting plugin OnlineSubsystemGooglePlay
LogPluginManager: Mounting plugin OnlineSubsystemIOS
LogPluginManager: Mounting plugin OculusVR
LogPluginManager: Mounting plugin SteamVR
LogXGEController: Cleaning working directory: C:/Users/Sasha/AppData/Local/Temp/UnrealXGEWorkingDir/
LogXGEController: Cannot use XGE Controller as Incredibuild is not installed on this machine.
Running C:/Program Files/Epic Games/UE_4.26/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="C:/Users/Sasha/Documents/Unreal Projects/BuildingEscape/BuildingEscape.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
@progress push 5%
@progress pop
Building BuildingEscapeEditor...
Using Visual Studio 2019 14.28.29914 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910) and Windows 10.0.19041.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 4 actions with 16 processes...
@progress 'Compiling C++ source code...' 0%
@progress 'Compiling C++ source code...' 25%
[1/4] WorldPosition.cpp
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(58): error C2338: Invalid argument(s) passed to FMsg::Logf_Internal
C:\Users\Sasha\Documents\Unreal Projects\BuildingEscape\Source\BuildingEscape\WorldPosition.cpp(23): note: see reference to function template instantiation 'void FMsg::Logf_Internal<wchar_t[29],const TCHAR*,FString>(const ANSICHAR *,int32,const FLogCategoryName &,ELogVerbosity::Type,const FmtType (&),const TCHAR *,FString)' being compiled
with
[
FmtType=wchar_t [29]
]
C:\Users\Sasha\Documents\Unreal Projects\BuildingEscape\Source\BuildingEscape\WorldPosition.cpp(23): note: see reference to function template instantiation 'void UWorldPosition::BeginPlay::<lambda_db33cd8ccc955dc22a9b5a29293e4675>::operator ()<FLogCategoryLogTemp,wchar_t[29],const TCHAR*,FString>(const FLogCategoryLogTemp &,const wchar_t (&)[29],const TCHAR *const &,const FString &) const' being compiled
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(60): error C4840: non-portable use of class 'FString' as an argument to a variadic function
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(60): note: 'FString::FString' is non-trivial
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Containers/UnrealString.h(190): note: see declaration of 'FString::FString'
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Logging/LogMacros.h(60): note: the constructor and destructor will not be called; a bitwise copy of the class will be passed as the argument
C:\Program Files\Epic Games\UE_4.26\Engine\Source\Runtime\Core\Public\Windows/WindowsCriticalSection.h(9): note: see declaration of 'FString'
LogCore: Engine exit requested (reason: EngineExit() was called)
LogExit: Preparing to exit.
LogModuleManager: Shutting down and abandoning module DesktopPlatform (48)
LogModuleManager: Shutting down and abandoning module PlatformCryptoOpenSSL (46)
LogModuleManager: Shutting down and abandoning module PlatformCryptoTypes (44)
LogModuleManager: Shutting down and abandoning module PlatformCrypto (42)
LogModuleManager: Shutting down and abandoning module XGEController (40)
LogXGEController: Cleaning working directory: C:/Users/Sasha/AppData/Local/Temp/UnrealXGEWorkingDir/
LogModuleManager: Shutting down and abandoning module AnimationModifiers (38)
LogModuleManager: Shutting down and abandoning module AudioEditor (36)
LogModuleManager: Shutting down and abandoning module PropertyEditor (35)
LogModuleManager: Shutting down and abandoning module TextureCompressor (32)
LogModuleManager: Shutting down and abandoning module RenderCore (30)
LogModuleManager: Shutting down and abandoning module Landscape (28)
LogModuleManager: Shutting down and abandoning module SlateRHIRenderer (26)
LogModuleManager: Shutting down and abandoning module OpenGLDrv (24)
LogModuleManager: Shutting down and abandoning module D3D11RHI (22)
LogModuleManager: Shutting down and abandoning module AnimGraphRuntime (20)
LogModuleManager: Shutting down and abandoning module Renderer (18)
LogModuleManager: Shutting down and abandoning module Engine (16)
LogModuleManager: Shutting down and abandoning module CoreUObject (14)
LogModuleManager: Shutting down and abandoning module NetworkFile (12)
LogModuleManager: Shutting down and abandoning module CookedIterativeFile (10)
LogModuleManager: Shutting down and abandoning module StreamingFile (8)
LogModuleManager: Shutting down and abandoning module SandboxFile (6)
LogModuleManager: Shutting down and abandoning module PakFile (4)
LogModuleManager: Shutting down and abandoning module RSA (3)
LogExit: Exiting.
Log file closed, 05/29/21 10:09:26
DanM
May 31, 2021, 7:42am
8
That essentially says you forgot * for formatting an FString on line 23 in WorldPosition.cpp.
DanM:
WorldPosition.cp
I’ve added the needed * and am able to open the project once again, however I am still having issues adding my OpenDoor component to the door model.
This image shows it already exists (I can see it in my file explorer as well)
However, when I try to add the component, it is nowhere to be found
Another weird thing I’ve noticed, is my compile button is no longer here!
DanM
June 1, 2021, 7:32am
10
Could you please post your code?
zonfar
June 3, 2021, 8:42pm
11
Should I post the OpenDoor.cpp/OpenDoor.h? Or is there another section of code I should post?
zonfar
June 4, 2021, 7:13pm
13
Here is OpenDoor.cpp
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "OpenDoor.generated.h"
UCLASS( ClassGroup=(Custom), meta=(BlueprintSpawnableComponent) )
class BUILDINGESCAPE_API UOpenDoor : public UActorComponent
{
GENERATED_BODY()
public:
// Sets default values for this component's properties
UOpenDoor();
protected:
// Called when the game starts
virtual void BeginPlay() override;
public:
// Called every frame
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
};
Here is OpenDoor.h
#include "OpenDoor.h"
// Sets default values for this component's properties
UOpenDoor::UOpenDoor()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
// off to improve performance if you don't need them.
PrimaryComponentTick.bCanEverTick = true;
// ...
}
// Called when the game starts
void UOpenDoor::BeginPlay()
{
Super::BeginPlay();
// ...
}
// Called every frame
void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
// ...
}
DanM
June 5, 2021, 8:05am
14
Oh! you’re searching the wrong thing here. Your searching the list of components that are already on the actor.
You need to click “Add Component” and search for it there to add it.
zonfar
June 5, 2021, 6:18pm
15
Super weird! I was searching under add component before, and it wasn’t showing up there either. It is now showing up, so I’m not sure what to think. However, it is working now! Thank you for your help
1 Like
system
Closed
June 6, 2021, 6:18pm
16
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.