Why are some public methods missing?

I’ve just started exploring SkookumScript today, and wanted to convert some of my terribly bloated blueprints for UI interaction over to code. In doing this, I noticed that some of the public methods for a few of the widget classes aren’t available. Most of these aren’t really an issue, but the TextBlock’s SetText function is a requirement for me.

So I guess my question is, why isn’t this method available, and what can I do to add it myself?

1 Like

It looks like TextBlock::text_set() (from the C++ UTextBlock::SetText()) is missing because the class Text (FText in UE4 C++) is not exported as a class.

When the engine scripts are generated, any methods that refer to classes that do not exist are omitted.

I’m pretty sure that is what is going on. :thinking:

You are also not the first to ask for this:

The solution would be to add the Text class and regenerate the reflected engine methods.

If you are ambitious enough to try this on your own, you would need the source for the SkookumScript plugin through GitHub and then add the bindings to a Text class from the C++ FText.

The best example would be how Name (C++ FName) is hooked up - SkookumScript\Source\SkookumScriptRuntime\Private\Bindings\Engine\SkUEName.cpp

This is probably a lot to aim for while you are just starting out with SkookumScript. :madsci:

We have flagged this as a priority though we are also in the middle of doing a bunch of contract work for Epic Games so we might not be able to get to it for a while. :ue4:

If you are looking for help from the SkookumScript community then @error454 might be able to lend a hand.

Let us know how you would like to proceed.

1 Like

What I’d recommend as far as cleaning up crazy UMG blueprints is to create some simple functions in your UMG blueprint that you can call from :sk:. This can be as low-level as a function that takes a String and does nothing more than set the text of your TextBlock or something higher level that takes an enum and drills down into your canvas panel slot to change a color.

Ultimately it’d be nice to have FText supported, this is already on my personal todo list of community contributions but free time is at a premium!

1 Like

Hi. I’m trying to implement FText but got error:
“|| sizeof(_DataType) <= sizeof(tUserData), “If _DataType does not fit inside m_user_data, it will be allocated from the heap, hence there must be a constructor to allocate the memory.”);”
How can i fix it?