Hello guys.
I need some help with setting up a local multiplayer with split screen. I will try to explain my problem in the best way.
First of all, I don’t remember exactly all the changes I made in UTGame Classes, but I know I made many changes, even though my custom game types are extended from UTTeamGame. I changed many things like I removed kismet messages on screen, I removed the narrators voice “Red Team won the match”, I removed the taunt animations on end of the match, I removed the UTGame phrases like player killed player, and many other things. Also for the campaign game mode I changed the rules, like Goalscore in the DefaultGame.ini:
[AnaIrhabi.Campaign]
GoalScore=0
bPlayersBalanceTeams=true
bWeaponStay=true
MaxLives=1
So on the campaign maps I end the match manually with kismet after the player completes all the mission objectives (everything done in kismet).
However, for the multiplayer custom game type I created, I made something different, I tried to keep it as close as standard UTTeamGame:
class Multiplayer extends UTTeamGame;
defaultproperties
{
bDelayedStart=false //We want to jump straight into the game
DefaultMaxLives=5
bScoreDeaths=true
bScoreTeamKills=true
bOvertime=false
bMustJoinBeforeStart=false
bTeamGame=true
TeamAIType(0)=class'UTGame.UTTeamAI'
TeamAIType(1)=class'UTGame.UTTeamAI'
EndMessageWait=0
TeammateBoost=+0.3
FriendlyFireScale=+0.0
bMustHaveMultiplePlayers=true
FlagKillMessageName=TAUNT
DefaultPawnClass=class'AnaIrhabi.AnaIrhabiPawn'
PlayerControllerClass=class'AnaIrhabi.AnaIrhabiPlayerController'
DefaultInventory(0)=class'UTWeap_AIKnife'
Acronym="MP"
MapPrefixes[0]="MP"
//HUDType=class'UTGame.UTTeamHUD'
OnlineGameSettingsClass=class'UTGame.UTGameSettingsTDM'
MidgameScorePanelTag=TDMPanel
}
And here follows the Multiplayer configuration on DefaultGame.ini:
[AnaIrhabi.Multiplayer]
GoalScore=5
bPlayersBalanceTeams=true
bWeaponStay=true
MaxLives=5
As you can see, I setup 5 points the Goal Score and the maximum lives of each player. So that means the first player to perform 5 kills wins the match.
Here is the basic kismet sequence I used to spawn player 2 (I want only 2 players) and Split the Screen:
I basically used the Console Command DebugCreatePlayer 1 to spawn player 2 (index 1, because player 1 is index 0) and split the screen.
I also used the Console Command DebugRemovePlayer 1 before DebugCreatePlayer 1 because each time the map is loaded, if player 1 is not removed (cleaned), it will add a third player on the match, and split the screen into 3. These 2 character icons you see on kismet are just custom spawn points I created (using the notepad actor), but changing the icon texture. I found it better for me visualize where I placed the enemies on the map, to elaborate a better gameplay. If I would use pathnodes to spawn the enemies it would not give me a good visual feedback for me planning better the enemies placement through the map.
I used the teleport node alongside Access ObjectList to randomize the respawn points of each player, as I placed 4 custom spawn points for each player. If I use the UTTeam Player Start actors, yes, it works automatically, each time the players spawn randomly arround the map. However, I don`t know why many bots are spawned on the map, even though I added a UTMap Info on the map properties and set the min and maximum number of players to 2.
So using my custom spawn points with Access ObjecList and teleport actor node I could manually achieve this, random spawn points for each player (without spawning new bots). I only added one default Player Start for the map, and as Player 1 and Player 2 Spawn on this same point, to avoid one player dying (because one of them die if they spawn at the same time on the same point) I added a small delay of 0.05 seconds before spawning Player 2 with DebugCreatePlayer 1.
It works like a charm, whenever I play in editor as you can see here. Each player, after he dies, is respawned automatically (on different points). And whenever player 1 wins (after killing 5 times player 2), in example, the camera does a close on the winning player and the Game Ended event (of my kismet sequence) is activated automatically and the game ends as I added a kismet node for it (Console Command Exit).
But now my problem is whenever I cook this map the match simply does not end:
After player1 kills player2 5 times, instead of finishing the map, the game continues running with a message on player2 screen “Press Fire to Respawn” as you can see here:
And whenever player2 presses fire it enters in the spectator mode. The same happens on the reverse, if player2 kills player1 5 times the match simply does not end!
Any help is appreciated.