Skip to content

Miscellaneous Things

Allowing Normal Player Input During Dialogue

Usually when you start a dialogue using the BP_SudsProDialogueRunner, player input is disabled (or rather, the UI should do it on request).

However, if you want normal player input to be allowed during the dialogue, because you want the player to be able to move around, you can do this:

[set AllowPlayerInput true]

This makes dialogue not request to take the player input away during the setup of the UI. It's still up to your UI to respect this request.

You might want to do this to provide tutorial text on top of gameplay, or non-interactive dialogue. In both cases because you're allowing the player to continue playing, you have to advance the dialogue through some other means than what you'd normally do in interactive dialogue. But SUDS scripts can be very useful for these purposes.

Letterbox / Black Bars

Sometimes it's useful to indicate that the player is in a dialogue, or in a cutscene, by adding black bars at the top/bottom of the camera.

To do this with Cine Cameras:

1. Make sure "Constrain Aspect Ratio" is enabled
2. Under Crop Settings > Cropped Aspect Ratio, set an aspect ratio > 16:9 (e.g. 2)
3. This will ensure that letterbox effect is used

When blending to/from the camera in any way, the bars will animate at the same speed.

You can also add bars using the "Sensor Height" property, but this does NOT animate when blending between cameras, so is not as good.

UI Foibles

The Example Project features a dialogue UI which works pretty well; it handles button prompts, multiple choices, supports both mouse and controller interfaces, typewriter text and many more features.

It uses the StevesUEHelpers library to provide convenient UI features. You don't have to use that, but bear in mind that there are a lot of little corner cases you have to manage otherwise, like making sure controller focus works. You're free to solve these issues other ways of course.

Assuming you're using the helpers library, here's a few notes:

Mouse cursor in dialogue

In order to make sure the mouse cursor disappears reliably when a gamepad is used, and re-appears when you move the mouse, it's a good idea to change your Game Viewport Client Class in Project Settings to StevesGameViewportClientBase, or a sublass of that, which handles many of the little edge cases around that.

Render Focus Rule

It's important to turn off "Render Focus Rule" in Project Settings > Engine > User Interface (set to Never), otherwise you get a supplemental highlight line on focussed UI elements.

Other Focus Issues

When switching between mouse and gamepad, you can sometimes get into issues around making sure focus on buttons is handled correctly.

StevesUEHelpers has a few menu classes, which help with this. Making Dialogue UI a subclass of MenuBase, and a containter that subclasses from MenuStack helps sort out some focus issues when switching between mouse & gamepad. You can look at their implementations and replicate that separately if you'd prefer not to use them directly.