How do i define what override functions are created automatically when creating a subclass?

In C++ when i subclass from AActor the new class already comes with BeginPlay() and Tick() defined, is there a way to make that template for our own classes?

Example:

I have a ATest class and it has a virtual void DoSomething() function. What do i have to do when i create a new subclass of ATest (using the New C++ class option in the engine) that will define and declare that function automatically without me doing anything. That’s what happens when you create a subclass of AActor, BeginPlay() and Tick() are already there without me writing anything.

Actors come with BeginPlay and Tick. If your custom class Inherits from Actor, you’ll be able to override BeginPlay and Tick in your own class. You can’t use BeginPlay and Tick with any class because not every class in UE4 comes with a BeginPlay and Tick function.

I know, what i’m saying is, say i have ATest class and it has a virtual void DoSomething() function. What do i have to do when i create a new subclass of ATest (using the New C++ class option in the engine) that will define and declare that function automatically without me doing anything. Because that’s what happens when you create a subclass of AActor, BeginPlay() and Tick() are already there without me writing anything.

Okay, this is not the easiest thing in the world but heres where you’ll want to start: If you go to Program Files/Epic Games/UE4.XX/Engine/Content/Editor/Templates, you’ll find all of the class template files. I’ve never tried adding my own template, but I don’t see why it wouldn’t work. These template files get fetched inside of the GameProjectUtils.cpp class, which eventually writes the data to a .cpp and .h file when you create your class. Good luck, let me know how it works out!

This is exactly what i needed, thank you, i’ll try to create a TestClass.cpp.template and TestClass.h.template and see if it works.