Open N00dACF_GASPlayer_BP_Child and create a new event called SetupCharacterData with an input named Info of type FN00dLobbyCharacterInfoData. Create a variable called CharacterInfo and set its replication condition to RepNotify. Connect to Info input pin
NOTE: This is the same struct that we used in the Data Table we created earlier, so if you have a different struct associated with your own data table, this would be that data type instead.
Double click the CharacterInfo variable and inside, use the data to reconstruct the skeletal mesh of the character. This is a simple example, whatever other data you have here in your data table would want to be reconstructed here too, or pulled from a save if you are using dynamic features for your character that were selected on the lobby.
You may close this character window. We are done with this class.
Next, open the N00dACF_GASUltimateGameMode_BP_Child and add BPC_N00dLobby_Child to the components window
Override SpawnDefaultPawnFor and call SpawnGamePawnFor from the lobby component
Also override OnPostLogin and call OnPostGameLogin from the lobby component
Make sure Seamless Travel is checked in the Class Defaults.
In the Class Defaults, define our new player controller and player character
You may close this Game Mode window. This class is complete
Open N00dACFLobbyGameMode_BP and add the lobby component
Override ChoosePlayerStart and call ChooseLobbyStart from the lobby component
Override SpawnDefaultPawnFor and call SpawnLobbyPawnFor from the lobby component
Override BeginPlay and call InitialiseLobby, override OnPostLogin and call OnPostLobbyLogin both from the lobby component
Define the controller, pawn, and if you're using the spectator, define that here too.
You may close this class
Open N00dACFMenuGameModeBP_Child and add the lobby component
In the Class Defaults, make sure Seamless Travel is checked
Define our new menu controller in the Class Defaults
You may now close this class.
Open N00dACF_UIMenuPC_BP_Child and add the lobby component
In the Class Defaults under ACF, define the Main Menu widget that we created a copy of from the n00dLobby plugin
You may now close this class
Open BP_N00dLobbyPlayerController and add the lobby component
Set the input mode to UI only (only do this if you are spectating, otherwise UI and Game)
Open N00dACFUltimatePlayerControllerBP_Child and add the lobby component
You may now close this class
Open your child of the lobby component and create a new variable called CharacterData. This should be the struct that corresponds to your data table, for the example we are using that is FN00dLobbyCharacterInfoData
These are the functions we are overriding
BuildCharacterList constructs the CharacterData array with the character data table, DT_LobbyCharacterData
Get name on Index feeds the UI the character name from our array
SwapDynamicCharacter updates the pawn data pulled from the PlayerPawnMap that the system has logged for you.
If you are spawning specific classes and not building the data dynamically on the character when spawned, GetPawnToSpawn is where you'd pull that data from the data table. We are just using our defined default.
GetMaxCharacters limits the system to the array's length
UpdatePawnData casts to the pawn and calls the event we created with the RepNotify that constructs the character aesthetics on boot into the main map