Download

what class should i use to expose STEAM API functions to blueprints?

what class should i use to expose STEAM API functions to blueprints?

for example i’m reading https://partner.steamgames.com/documentation/matchmaking, first function they talk about is

Searching for lobbies
To have your game search for a lobby, you need to call:
SteamAPICall_t RequestLobbyList()

so i want make my own C++ function that expose functionality of RequestLobbyList to blueprints, because i really like visual programming (simple scripting) instead of raw C++ when possible

so what kind of new class would be better make in editor from “File” -> “Add code to project”? most common offered are:

none
character
pawn
actor
player camera managment
player controller
game mode
world settings
hud
player state
game state
blueprint function library
slate widget
slate widget style

?

i have to note, that i want use matchmaking function in empty level for main menu, so there won’t be available actors and other things

If you’re just exposing the methods then a Blueprint Function Library is probably what you want, it would effectively be a thin wrapper around the SteamWorks API.

seems it’s bad idea, because then you will have UE compile error like

Error This blueprint (self) is not a Steam_Functions, therefore ’ Target ’ must have a connection.

and you can’t remove “target pin” for any unknown to me reasons, so it’s better to use Actor based, then on “target pin” you can simply right click - promote to variable or just cast, even when it empty, compile won’t fail, cast on actor based work fine too

I am under the assumption that the blueprint nodes that already exist: Create, Destroy, Find and Join already use the steam API subsystem under the hood if you have steam selected as your Online Subsystem.

Creating a lobby would be equivalent to doing something along the lines of:
GameNameLobbyGameMode: <- Just used to set the PlayerController/PlayerState
GameNameLobbyPlayerController: <-You could disable input other than UI and what not here.
GameNameLobbyPlayerState: <-Boolean to test if the player is ready or not.

To create a lobby:
A player would go to the main menu, click the “create a lobby” button which would transition to the lobby map and call the “Create Session” node.
Other players would go to the main menu, click the “find a lobby” button which would give them a list of lobbies. They would select one and join it and then press ready or whatever else they need to select.
Once all players are ready, you would transition to the game map.

Of course, to be able to check if the session you’re looking at is a lobby or not, you’ll need to create a custom session class.
I believe that is UOnlineSession, but to be honest, I cannot remember off the top of my head.