Last active
September 7, 2019 20:31
-
-
Save mcu8/a2a6a4f057f52c7de566009ea7746b2b to your computer and use it in GitHub Desktop.
Script for joining Online Party using Kismet in A Hat in Time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class mcu8_SeqAct_JoinOnlineParty extends SequenceAction; | |
var() string LobbyName<Tooltip=Lobby name>; | |
var() bool bDebug<Tooltip=Debug.>; | |
defaultproperties | |
{ | |
ObjName="JoinOnlineParty" | |
ObjCategory="Misc" | |
VariableLinks.Empty | |
VariableLinks(0)=(ExpectedType=class'SeqVar_String',LinkDesc="Lobby name",bWriteable=false,PropertyName=LobbyName) | |
bDebug = false | |
} | |
event Activated() | |
{ | |
local OnlineSubsystem OnlineSubsystem; | |
OnlineSubsystem = class'GameEngine'.static.GetOnlineSubsystem(); | |
if (OnlineSubsystem != None) { | |
class'Hat_GhostPartyPlayerStateBase'.static.ConfigSetUseOnlineFunctionality(True); | |
class'Hat_GhostPartyPlayerStateBase'.static.ConfigSetLobbyName(LobbyName); | |
if (LobbyName != "") | |
{ | |
DebugPrint("Joining lobby '" $ LobbyName $ "'"); | |
class'Hat_GhostPartyPlayerStateBase'.static.LobbyJoinByName(LobbyName); | |
} | |
else | |
{ | |
DebugPrint("Leaving lobby because input is empty or none"); | |
class'Hat_GhostPartyPlayerStateBase'.static.LobbyJoinPublic(); | |
} | |
} | |
else { | |
DebugPrint("Unable to join lobby '" $ LobbyName $ "' because OnlineSubsystem is None"); | |
} | |
} | |
function DebugPrint(string v) { | |
if (bDebug) Hat_PlayerController(class'Engine'.static.GetEngine().GamePlayers[0].Actor).ClientMessage(v); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment