Posts

Showing posts from May, 2021

Setting Build Platforms for plugins in Unreal Engine

Setting Build Platforms for plugins in Unreal Engine To avoid building for platforms that are not needed or won’t compile, add “WhitelistPlatforms” to your .uplugin file like this { "FileVersion": 3, "Version": 1, "VersionName": "1.0", "FriendlyName": "BasePlugin", "Description": "", "Category": "Other", "CreatedBy": "", "CreatedByURL": "", "DocsURL": "", "MarketplaceURL": "", "SupportURL": "", "CanContainContent": true, "IsBetaVersion": false, "IsExperimentalVersion": false, "Installed": false, "Modules": [ { "Name": "BasePlugin", "Type": "Runtime", "LoadingPhase": "Default", "WhitelistPlatforms": [ "Win64" ]

Blueprint functions without exec pins in Unreal Engine

Blueprint functions without exec pins There are 2 types of blueprint functions. Functions with no side-effects These are colored green in the node editor and do not have exec pins. This means they can always be called and do not change anything internally. Such a function can be written in c++ as UFUNCTION(BlueprintPure) FString MyFunction(int32 MyParameter1); Note that these functions must have a return type. The keyword “BlueprintPure” tells that no exec pins are needed. Functions with side-effects These are colored blue in the node editor and have exec pins. Means, they need to be put in a sequential workflow to work Such a function can be written in c++ as UFUNCTION(BlueprintCallable) void MyFunction(int32 MyParameter1); The keyword “BlueprintCallable” tells that exec pins are needed. However, if this does not work, one can also write “BlueprintPure = false” to override the behavior.

Renaming C++ Classes in Unreal Engine

Renaming C++ Classes in Unreal Engine If you rename c++ classes and files, they are not found in non-code assets in your game. To avoid this one can use “Core Redirects”. These are simply lookup values that match the old name of the class (used in your assets) to the new name (that you changed it to). These redirects need to be entered into the “DefaultEngine.ini” file for projects or into the “MyPlugin/Config/DefaultMyPlugin.ini” file for plugins. Note that “MyPlugin” is the name of the plugin and that the config folder may need to be created as it is not created automatically. Now, in that file, under [CoreRedirects] add the following line per class. [CoreRedirects] +ClassRedirects=(OldName="OldClassName",NewName="NewClassName") Note that the class names are without the class prefixes such as U for objects, A for actors and so on. The redirect feature can do way more than that. It can also be used for variables, enums, functions, properties etc. Unreal Engine Core