x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Access violation - Project Crashes On load

Hey All.

My project has been working without any problems till that i decided to restart unreal engine.

Now i cant even open my project. :/

Any Suggestions? :)


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

UE4Editor_Engine!UEngine::AddOnScreenDebugMessage() + 4 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\engine\private\unrealengine.cpp:6141] UE4Editor_Prison_4522!AFPSGameMode::AFPSGameMode() + 287 bytes [d:\projects\unreal\prison\source\prison\fpsgamemode.cpp:16] UE4Editor_CoreUObject!UClass::CreateDefaultObject() + 435 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\class.cpp:2506] UE4Editor_CoreUObject!UObjectLoadAllCompiledInDefaultProperties() + 805 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:739] UE4Editor_CoreUObject!ProcessNewlyLoadedUObjects() + 146 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\coreuobject\private\uobject\uobjectbase.cpp:815] UE4Editor_CoreUObject!TBaseStaticDelegateInstance::ExecuteIfSafe() + 7 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegateinstancesimpl_variadics.inl:921] UE4Editor_Core!TBaseMulticastDelegate::Broadcast() + 149 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\public\delegates\delegatesignatureimpl_variadics.inl:1030] UE4Editor_Core!FModuleManager::LoadModuleWithFailureReason() + 2194 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\core\private\modules\modulemanager.cpp:359] UE4Editor_Projects!FModuleDescriptor::LoadModulesForPhase() + 784 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\projects\private\moduledescriptor.cpp:350] UE4Editor_Projects!FProjectManager::LoadModulesForProject() + 581 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\projects\private\projectmanager.cpp:53] UE4Editor!FEngineLoop::LoadStartupModules() + 705 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:1863] UE4Editor!FEngineLoop::PreInit() + 11141 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launchengineloop.cpp:1400] UE4Editor!GuardedMain() + 251 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\launch.cpp:110] UE4Editor!GuardedMainWrapper() + 26 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:126] UE4Editor!WinMain() + 249 bytes [d:\buildfarm\buildmachine_++depot+ue4-releases+4.7\engine\source\runtime\launch\private\windows\launchwindows.cpp:202] UE4Editor!__tmainCRTStartup() + 329 bytes [f:\dd\vctools\crt\crtw32\dllstuff\crtexe.c:618]

CODE:

FPSGameMode.h

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "GameFramework/GameMode.h"
 #include "FPSGameMode.generated.h"
 
 /**
  * 
  */
 UCLASS()
 class PRISON_API AFPSGameMode : public AGameMode
 {
     GENERATED_UCLASS_BODY()
 
     //AFPSGameMode::AFPSGameMode(const class FObjectInitializer& PCIP);
     
     virtual void StartPlay() override; // Note that engine version 4.3 changed this method's name to StartPlay(), because of this engine versions before 4.3, or older tutorials, use BeginPlay()    
 };

FPSGameMode.cpp

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "Prison.h"
 #include "FPSGameMode.h"
 #include "Engine.h" //for version 4.4+
 
 
 
 
 AFPSGameMode::AFPSGameMode(const class FObjectInitializer& PCIP): Super(PCIP)
 {
     static ConstructorHelpers::FObjectFinder<UBlueprint> MyBlueprintObject(TEXT("Blueprint'/Game/Blueprints/BP_FPSCharacter.BP_FPSCharacter_C'"));

     if (PlayerPawnObject.Class != NULL)
     {
         DefaultPawnClass = PlayerPawnObject.Class;
     }
 }
 
 void AFPSGameMode::StartPlay()
 {
     Super::StartPlay();
 
     StartMatch();
 }

FPSCharacter.h

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #pragma once
 
 #include "GameFramework/Character.h"
 #include "FPSCharacter.generated.h"
 
 UCLASS()
 class PRISON_API AFPSCharacter : public ACharacter
 {
     GENERATED_BODY()
 
 public:
     // Sets default values for this character's properties
     AFPSCharacter();
 
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
 
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
 
     //handles moving forward/backward
     UFUNCTION()
         void MoveForward(float Val);
     //handles strafing
     UFUNCTION()
         void MoveRight(float Val);
 
     //sets jump flag when key is pressed
     UFUNCTION()
         void OnStartJump();
     //clears jump flag when key is released
     UFUNCTION()
         void OnStopJump();
 
 public:
     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Camera)
         UCameraComponent* FirstPersonCameraComponent;
 
     AFPSCharacter(const FObjectInitializer& ObjectInitializer);
 
 
     /** Pawn mesh: 1st person view (arms; seen only by self) */
     //UPROPERTY(VisibleDefaultsOnly, Category = Mesh)
     //    USkeletalMeshComponent* FirstPersonMesh;
 
 protected:
     //virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
     
 };

FPSCharacter.cpp

 // Fill out your copyright notice in the Description page of Project Settings.
 
 #include "Prison.h"
 #include "FPSCharacter.h"
     
 // Sets default values
 AFPSCharacter::AFPSCharacter()
 {
      // 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;
 
 }
 
 // Called when the game starts or when spawned
 void AFPSCharacter::BeginPlay()
 {
     Super::BeginPlay();        
 }
 
 // Called every frame
 void AFPSCharacter::Tick( float DeltaTime )
 {
     Super::Tick( DeltaTime );
 
 }
 
 
 // Called to bind functionality to input
 void AFPSCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent)
 {
     Super::SetupPlayerInputComponent(InputComponent);
 
     // set up gameplay key bindings
     InputComponent->BindAxis("MoveForward", this, &AFPSCharacter::MoveForward);
     InputComponent->BindAxis("MoveRight", this, &AFPSCharacter::MoveRight);
 
     InputComponent->BindAxis("Turn", this, &AFPSCharacter::AddControllerYawInput);
     InputComponent->BindAxis("LookUp", this, &AFPSCharacter::AddControllerPitchInput);
 
     InputComponent->BindAction("Jump", IE_Pressed, this, &AFPSCharacter::OnStartJump);
     InputComponent->BindAction("Jump", IE_Released, this, &AFPSCharacter::OnStopJump);
 
 }
 
 void AFPSCharacter::MoveForward(float Value)
 {
     if ((Controller != NULL) && (Value != 0.0f))
     {
         // find out which way is forward
         FRotator Rotation = Controller->GetControlRotation();
         // Limit pitch when walking or falling
         if (GetCharacterMovement()->IsMovingOnGround() || GetCharacterMovement()->IsFalling())
         {
             Rotation.Pitch = 0.0f;
         }
         // add movement in that direction
         const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::X);
         AddMovementInput(Direction, Value);
     }
 }
 
 void AFPSCharacter::MoveRight(float Value)
 {
     if ((Controller != NULL) && (Value != 0.0f))
     {
         // find out which way is right
         const FRotator Rotation = Controller->GetControlRotation();
         const FVector Direction = FRotationMatrix(Rotation).GetScaledAxis(EAxis::Y);
         // add movement in that direction
         AddMovementInput(Direction, Value);
     }
 }
 
 void AFPSCharacter::OnStartJump()
 {
     bPressedJump = true;
 }
 void AFPSCharacter::OnStopJump()
 {
     bPressedJump = false;
 }
 
 AFPSCharacter::AFPSCharacter(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
 {
     // Create a CameraComponent 
     FirstPersonCameraComponent = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("FirstPersonCameraComponent"));
     FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();
 
     // Position the camera a bit above the eyes
     FirstPersonCameraComponent->RelativeLocation = FVector(0, 0, 50.0f + BaseEyeHeight);
     // Allow the pawn to control rotation.
     FirstPersonCameraComponent->bUsePawnControlRotation = true;
 
 
 }
 




Product Version: Not Selected
Tags:
more ▼

asked Mar 17 '15 at 08:49 PM in C++ Programming

avatar image

Quaso
26 2 3 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

Yeah. Finally. I've fixed it.

What i missing was "not removing binary folder". :) I've removed it, then rebuilt the code. Thanks for your help.

more ▼

answered Mar 18 '15 at 07:15 PM

avatar image

Quaso
26 2 3 7

avatar image eXi Mar 18 '15 at 07:56 PM

Oh ok, glad to hear you solved it (:

I will go ahead an make your comment the solving answer.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I think the error comes from trying to use AddOnScreenDebugMessage inside your constructor. Constructors are called even before the Editor is fully loaded (during the loading pop-up). My guess is that it tries to write the message onto the Editor's screen, which hasn't started yet and thus you are getting a crash.

more ▼

answered Mar 18 '15 at 09:49 AM

avatar image

Swiftle
109 19 26 32

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Hey there, would you mind showing me your code?

I am not good in reviewing these error logs, but it seems you are trying to access a Nullpointer in your GameMode.

If i can trust this log, then it happened in one of your OnScreenDebugMessages.

more ▼

answered Mar 17 '15 at 10:12 PM

avatar image

eXi
6.8k 332 185 468

avatar image Quaso Mar 18 '15 at 09:41 AM

Hey.

I've included code to first message. Thank you :)

avatar image eXi Mar 18 '15 at 09:52 AM

Hey,

ok first of all. Please make sure that "GEngine" is not null.

Make an

 if(GEngine)
 {
     GEngine->AddOnScreen....;
 }

Around every GEngine method you use. It could be that GEngine is still null when you call the constructor of the GameMode.

Second, try to use:

 static ConstructorHelpers::FObjectFinder<UBlueprint> MyBlueprintObject(TEXT("Blueprint'/Game/Blueprints/BP_FPSCharacter.BP_FPSCharacter_C'"));


Instead of your classfinder. Since you want to find a Blueprint and use its class later, you will want to find the object first.

If this doesn't solve the crash, then i would need some information on what the last you did was. (:

avatar image Quaso Mar 18 '15 at 07:04 PM

Thanks.

But no luck so far :/

I've updated the code as you mentioned. I've removed all debug functions. :) (OnScreenDebugMessages).

The last thing i did is creating blueprint based on my FPSCharacter. And then i've deleted previous GameMode blueprint.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question