Chapter 12. Working with UE4 APIs

The Application Programming Interface (API) is the way in which you, as the programmer, instruct the engine, and so the PC, what to do. All of UE4's functionality is encapsulated into modules, including very basic and core functionality. Each module has an API for it. To use an API, there is a very important linkage step, where you must list all APIs that you will be using in your build in a ProjectName.Build.cs file, which is located in your Solution Explorer window.

Tip

Do not name any of your UE4 projects the exact same name as one of the UE4 API names!

Working with UE4 APIs

There are a variety of APIs inside the UE4 engine that expose functionality to various essential parts of it. Some of the interesting APIs that we'll explore in this chapter are as follows:

  • Core/Logging API – Defining a custom log category
  • Core/Logging API – FMessageLog to write messages to the Message Log
  • Core/Math API – Rotation using FRotator
  • Core/Math API – Rotation using FQuat
  • Core/Math API – Rotation using FRotationMatrix to have one object face another
  • Landscape API – Landscape generation with Perlin noise
  • Foliage API – Adding trees procedurally to your level
  • Landscape and Foliage APIs – Map generation using Landscape and Foliage APIs
  • GameplayAbilities API – Triggering an actor's gameplay abilities with game controls
  • GameplayAbilities API – Implementing stats with AttributeSet
  • GameplayAbilities API – Implementing buffs with GameplayEffect
  • GameplayTags API – Attaching GameplayTags to an actor
  • GameplayTasks API – Making things happen with GameplayTasks
  • HTTP API – Web request
  • HTTP API – Progress bars

Introduction

The UE4 engine's base functionality available in the editor is quite broad. The functionality from C++ code is actually grouped out into little sections called APIs. There is a separate API module for each important functionality in the UE4 codebase. This is done to keep the codebase highly organized and modular.

Tip

Using different APIs may require special linkage in your Build.cs file! If you are getting build errors, be sure to check that the linkage with the correct APIs is there!

The complete API listing is located in the following documentation: https://docs.unrealengine.com/latest/INT/API/.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.187.207