Project keeps crashing

After i overload the constructor of one of my c++ file, this project keeps crashing.

However edit that c++ file in VS2015 is not helping.

###################################################################

MachineId:ED9C08E14727D7F48D91E1A5C960EB45
EpicAccountId:361c0e7ec59a495485458098d8d9f1ab

Access violation - code c0000005 (first/second chance not available)

“”

UE4Editor_Geometry_Test_7996!AMyCreature::AMyCreature() [d:\unreal project\geometry_test\source\geometry_test\private\mycreature.cpp:8]
UE4Editor_CoreUObject!UClass::CreateDefaultObject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\coreuobject\private\uobject\class.cpp:2657]
UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:658]
UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:752]
UE4Editor_CoreUObject!TBaseStaticDelegateInstance::ExecuteIfSafe() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:921]
UE4Editor_Core!TBaseMulticastDelegate::Broadcast() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:809]
UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\modules\modulemanager.cpp:426]
UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\projects\private\moduledescriptor.cpp:370]
UE4Editor_Projects!FProjectManager::LoadModulesForProject() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\projects\private\projectmanager.cpp:53]
UE4Editor!FEngineLoop::LoadStartupModules() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launchengineloop.cpp:1989]
UE4Editor!FEngineLoop::PreInit() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launchengineloop.cpp:1495]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launch.cpp:110]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Show us how did you overloaded constructor AMyCreature::AMyCreature,
declaration and definition.

Thanks for reply me
I overloaded Creature and its subclass MyCreature
This is what i did

in Creature.h
ACreature();

in Creature.cpp

// Sets default values
ACreature::ACreature()
{
// Set this character to call Tick() every frame. You can turn this off to improve performance if you don’t need it.
PrimaryActorTick.bCanEverTick = true;

///All pickups start active.
bIsActive = true;

///Create the static mesh component
CreatureMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("CreatureMesh"));
RootComponent = CreatureMesh;

}

in MyCreature.h
AMyCreature();

in MyCreature.cpp

AMyCreature::AMyCreature()
{
GetMesh()->SetSimulatePhysics(true);

TeamIndex = 0;
Strength = 3;
Agility = 3;
Intelligence = 3;
MaxHP = 100 + (Strength * 190);
MaxMP = 100 + (Intelligence * 180);
CurrentHP = MaxHP;
CurrentMP = MaxMP;
HpRegeneration = 0.1+Strength*0.06;
MpRegeneration = 0.1+Intelligence*0.04;
MaxLevel = 100;
CurrentLevel = 1;
MaxExp = 100;
CurrentExp = 0;
Hits = 55000 + (Agility * 200);
GoldBalance = 100;
MoveSpeed = 100 + (Agility * 5);
AttackSpeed = 10 + Agility;
AttackValue = 1 + Strength * 3 + Agility * 2 + Intelligence * 3;
DefenceValue = 1 + (Strength + Agility) * 2;
AttributesPoints = 5;

}

This looks suspicious:

GetMesh()->SetSimulatePhysics(true); can you comment this out and make a test if still crashing?

What is exactly at line 8:
UE4Editor_Geometry_Test_7996!AMyCreature::AMyCreature() [d:\unreal project\geometry_test\source\geometry_test\private\mycreature.cpp:8]

?

Thanks Peirdek

I see GetMesh() might return NULL,and it gonna cause crash.

And i have made both constructors empty in VS2015 and compiled,but still,i can’t open this project in UE4,it gives same crashing message,i guess i need to compile in the engine.

At line 8 is:

line 8: AMyCreature ()
{


}

Hey jz2010927-

Peirdek is correct about the “GetMesh()” line. Replacing GetMesh with the pointer to the mesh component should allow SetSimulatePhysics to be called without an issue. If you are still having issues after making the change, please post the full constructor for AMyCreature().

Cheers

Thanks

But i can only do that in Visual Studio,and i still can’t open the project in the engine.

Opening the .sln for the project, making these changes, and compiling the project again should allow the project to be opened in the editor. Please try the steps mentioned and let me know if you’re able to open the project after compiling or what message you get if the compile fails.