WinterWildfire

ugs snippets

Announcement

Hey guys ! Just wanted to let you know that I need to run some maintenance on the website because of the recent domain name changes from netlify. So, some pages will appear like this for a few days... but guess what's coming new to the pages ? A Dark theme switch !!!

This namespace contains snippets and commandlets to let us interact with the UGameplayStatics class, DataTables, AssetRegistry, Asynchronous asset loading.

Complete list of snippet codes can be found here.

Associated classes


  • GampleplayStatics has gameplay utility functions. UE4 Wiki
  • Subsystems are used to make game-specific GameInstances. (Game instances persist across levels and are useful for storing state information while switching levels.) UE4 Wiki

They solve very specific problems and you might never use them. Just keep the snippet codes in mind. Explore them and fit it to your projects. It's aWIP namespace to which I keep adding as I learn.

See you later... 🖐

Some examples


This section has some general advice about usage of few of the classes/functions generated by the codes above. Sometimes there migth be better ways to do things and I will list them here.

This part is not important to use the extension. Feel free to skip.

ugs_objectfind

Used to load assets by path in C++ code. Try not to load assets directly in C++ like this. Having EditAnywhere (Or even better, fully data-driven using DataTables) is better.

That said, this is useful when loading textures for UI etc.

static ConstructorHelpers::FObjectFinder<${3:UStaticMesh}> ${1:UniqueName}(TEXT("/Game/$2"));
if(${1:UniqueName} != null) {
    ${4:TargetObject} = ${1:UniqueName}.Object;
}

ugs_classfind

Used to load classes(One of few ways to load BP classes into C++).

static ConstructorHelpers::FClassFinder<${3:ParentClass}> ${1:UniqueName}(TEXT("/Game/$2"));
if(${1:UniqueName} != null) {
    ${4:TargetSubClassOf} = ${1:UniqueName}.Class;
}

Thank you for visiting!

Hope you got the resources you needed. Come visit again :)

I upload weekly and revamp bi-monthly. You can support my work at Patreon | Paypal | Marketplace | Gumroad