UE crash on play

The compile went through just fine but I had a hard crash when I hit play. Went back through the code but couldn’t see anything out of place. I disconnected the blueprint thinking it was conflicting, still crashes. In the end I was looking over the 3rd person BP and deleted all the old target points, and now it plays just fine. Seems completely bizarre to me that this should have any effect as nothing calls to those old patrol points anymore. Anyways, I’m good and thought I would post in case anyone else hits this snag. Running version 14.14.3

1 Like

Yes, I ran into that also and I believe it had more to do with adding a second location to the Patrol Points CPP. I think he added one to Steve but not the other stooge. Otherwise you end up with an empty array which at this point hadn’t been protected against.

Cheers

Funnily enough the exact thing happened to me,
I used ensure to protect everything else but not the TArray<AActor*> which I forgot to populate, the PatrolPointsCPP ones.

Essentially I muddled through on my own which took me absolutely ages on this part and now I am so much clearer about the Index and Waypoint being separate items that we only continuously but temporarily use and discard each cycle.

The only thing disconcerting in this lecture series is the setup of faulty code structures that need to be in subsequent lectures. The CDO constructor errors were particularly annoying since at that point when first noticed I wasn’t certain if it was intentional or something I missed or was it that I was running 4.15.1 and they written in 4.13 or 4.12. Caused some confusion on this end.

BTW, I was never able to get a complete project-to-date download. I was keen on Lecture 231 or 232. I’m not sure how to accomplish that task. I easily get the c++ piece but not the remainder.

Any ideas ?

Cheers

Go to github.com/UnrealCourse and select the section, select clone and select the htttps, e.g.

https://github.com/UnrealCourse/02_BullCowGame.git

#Then via SourceTree

click “Clone/New” and paste the url into source and select a destination. Then look through the commits and right click the commit and “reset current branch to this commit” and select hard.

#Then via command line
git clone https://github.com/UnrealCourse/02_BullCowGame.git {optional directory}

Now to get to a specific commit like “BC30 Warm Fuzzy Feelings” on github, go to commits, select the git hash, which the end of the URL or below the “browse files” button and do the following

git reset 775f950802673018b9eedb68e6bb9ed952347c8c --hard

Thanks for the response. Have done alot work in Unity and one nice feature was the concept of a unitypackage. I was anticipating the ZIP file would be a similar content(i.e. the assets and blueprints, etc) but a apparently not. From what you have in the reply is that there are two steps from the command line to follow : “git clone…” and then “git reset…”.

Is that correct?

Basically, the zips you can download on the github repo won’t contain any files that are tracked via git LFS hence why I outlined those steps

Think I got it a pull thru git LFS, right?

To solve it I just added an if condition to check if elements in array is bigger than 0. I think when array size is 0 it tries to set the NextIndex to n mod 0 which is undefined.

if (PatrolPoints.Num() > 0) {
	auto Index = BlackboardComp->GetValueAsInt(IndexKey.SelectedKeyName);
	BlackboardComp->SetValueAsObject(WayPoint.SelectedKeyName, PatrolPoints[Index]);

	auto NextIndex = (Index + 1) % PatrolPoints.Num();
	BlackboardComp->SetValueAsInt(IndexKey.SelectedKeyName, NextIndex);
}
2 Likes

This solved the problem. I’m using Unreal version 4.20.3

Privacy & Terms