Cybernetic pig wrote:Nobody has managed it, but there must be a way.
Does HX count?
However, for SinglePlayer here is the roadmap what one needs to do to properly fix it.
The basic problem is that the game does a travels with bItems and manually tries to reset all player state, which is bad and error prone. So the basic idea is to travel with bItems=False into the new game (or training) and pass the selected options when starting inside the URL.
Everything like StartNewGame, StartTrainingMission, ShowIntro, etc. calls Level.Game.SendPlayer(), which is implemented as
Code: Select all
//
// Send a player to a URL.
//
function SendPlayer( PlayerPawn aPlayer, string URL )
{
aPlayer.ClientTravel( URL, TRAVEL_Relative, true );
}
The last parameter is bItems and specifies whether everything marked with travel should be carried over to the next map or not. We don't want to do that, so the first thing to do is to replace those Level.Game.SendPlayer( aPlayer, URL) with aPlayer.ClientTravel( URL, TRAVEL_Relative, False ).
The next thing to do is to start turning everything inside MenuScreenNewGame which directly sets properties on the player into options which get added to the URL like SkillPointsAvail, the selected skills, playername.
One classic way to grab URL params is to handle it in GameInfo's InitGame. You could save everything which is needed, so you can later initialize the playerpawn in AcceptInventory (or somewhere else). Things like the CombatDifficulty setting etc, should probably even for SP not be a playerpawn property but instead be handled by the gameinfo. You could store it there and autoappend it to the URL when travel etc. Note that the GameInfo is actually saved to the disk and gets loaded back (and not replaced) when you revisit a map.
Further notes:
- Inside event AcceptInventory( Pawn PlayerPawn ) you can check whether the PlayerPawn has a NanoKeyRing and if not start initialize him.
- There is also some weired stuff going on with the 'PlayerTraveling' flag, one probably needs to account for it.
Basically no big deal, it just can end up in quite some work walking through messy ION code. But this is the way to go for actually fixing this bug and not hacking around it.