Disabling LeaderScenes - How?

Funny thing is I first used your mentioned way but it didn't work because of derp. ;)
Now it works like a charm and doesn't modify the whole InGame.lua anymore.

Thanks!

The Code now:
print("loading NoLeaderScenes...")
function ChangePlayingMode()
-- NoLeaderScenes ADD BEGIN
-- tell the game it is multplayer, even if it's not
PreGame.SetMultiplayerGame(true)
-- change your name back to "You" instead of having to deal with "Player 1"
PreGame.SetNickName(0,Locale.ConvertTextKey( "TXT_KEY_YOU" ))
-- NoLeaderScenes ADD END
end
Events.LoadScreenClose.Add( ChangePlayingMode );
 
That's fine.

But I was playing around with it. Problem I'm facing now is that gamesaves (including autosaves) are "multiplayer". To enable a mod you have to select "single player" first. But then you don't have access to multiplayer gamesaves folder. But even if you move the gamesave, it won't open.

And the game menu and options screens think you are in muliplayer, so act differently.

This might require a more complicated hack to really work.


Edit:
Playing around with it some more:

PreGame.SetMultiplayerGame(false) doesn't work. PreGame.IsMultiplayerGame() still reports true. However, you can go in and out of multiplayer with:

PreGame.SetGameType(GameTypes.GAME_NETWORK_MULTIPLAYER)
PreGame.SetGameType(GameTypes.GAME_SINGLE_PLAYER)

Using GAME_HOTSEAT_MULTIPLAYER above doesn't remove the leaderscreen.

Once back in single player, you can save a game and load it.

So, maybe solution is to set multiplayer only when leaderscreen would appear. Or, conversely, set single player before gamesaves occur (or when before player goes to game menu). Unfortunately, both of those are complicated.
 
Thanks for your work.
I'm diving into more Lua to resolve this issue.
 
Tried switching to multiplayer from Events.AILeaderMessage, but that's already too late. You could intercept from everywhere that a player initiates dialog in UI files, but that wouldn't help when AI initiates dialog.

You can use Lua to intercept any case where a save could occur or human could get to the game menu or options menu, setting back to single player. Off of the top of my head:

Esc -> Menu
MENU button in upper right corner -> Menu
Cntr-s -> Save
F11 -> Quicksave
Cnrt-o -> Options menu
Events.AIProcessingEndedForPlayer specifically for barb player (this is right before the autosave)

Then set to multiplayer for times when human or AI could initiate dialog. That's easy for human initiated (Events.ActivePlayerTurnStart). For AI initiated, I think you would want to hook up to GameEvents.PlayerDoTurn for whatever AI player comes after active (1 unless mod changes that). Don't use Events.ActivePlayerTurnEnd because it often fires after PlayerDoTurn for player 1.

There is code for something like this in my TableSaverLoader, where we needed to intercept all saves. Follow link in my sig and scroll down to "How to catch a game save using Lua only". You could use that code as is to intercept saves, but you also need to intercept any case of player going to Menu.
 
Top Bottom