SkookumScript for UMG (UE4)


#1

Has anyone use Skookum for Unreal Motion Graphics (UMG) logic? Essentially replacing the blueprint graph of a UMG screen with SkookumScript.

Any potential issues there (UMG blueprints are a little different from normal blueprints, UMG objects don’t derive from Actor, etc).


#2

We haven’t used UMG logic much in our projects yet though it should work fine with SkookumScript.

@error454 has used SkookumScript driven UMG a bit in his projects at Hypercane Studios and may have some insights.


#3

Here’s 1 example of how we use UMG via :sk: in our game. It’s production code, so of course over-complicated for a simple answer. It’s similar to the workflow you’d use to interact with UMG via C++, meaning you call the same methods but with the ease of :sk:. TL;DR it just works.

Our base UUserWidget PlayerHud that contains another custom UUserWidget called GamepadButton (circled in red).

GamepadButton has a hierarchy that looks like this, all children here are just standard UMG components.

To modify the ProgressBar_Button from :sk:, I have the function below:

//---------------------------------------------------------------------------------------
// Set button progress for hud    
//---------------------------------------------------------------------------------------

(Real progress) 
[
  !hud : GameLib.player_controller.hud<>PlayerHUD

  // GamepadButton_C_90 is the horribly named button circled in red in the first screenshot
  // percent_set is a UMG provided function that sk automatically knows about.
  hud.@gamepad_button_c_90.@progress_bar_button.percent_set(progress)
]

Edit
Take a look at Entity->Visual->Widget and you’ll find everything you’re looking for.


UMG Examples?