Hotseat compatibility

They only way I know of to make a mod playable in hotseat is to edit the original game files instead of making a "proper" mod.
 
What's necessary to make a mod playable in hotseat, other than the checkbox?

First a custom setup screen.

Then you'll have to edit it to set the slots for human players and computer players.

For human I use :

Code:
PreGame.SetSlotStatus( i, SlotStatus.SS_TAKEN )
PreGame.SetSlotClaim( i, SlotClaim.SLOTCLAIM_RESERVED )

Where i is the player number, and for computer :

Code:
PreGame.SetSlotStatus(i, SlotStatus.SS_COMPUTER)
PreGame.SetSlotClaim(i, SlotClaim.SLOTCLAIM_ASSIGNED)

And make sure to launch the game in hotseat mode :

Code:
PreGame.SetGameType(GameTypes.GAME_HOTSEAT_MULTIPLAYER)

Hotseat is working even when launching the game using the single player engine with this :

Code:
Events.SerialEventStartGame()

So far I've failed at launching a lan/net game with the above code, and the code below :

Code:
Matchmaking.LaunchMultiplayerGame()

disable all mods internally.

If you want an example of a custom setup for a hotseat game, see RedEuro1940Setup.lua in my WW2 mod.

I know for sure that it work for WB map, and I don't see why it won't for mapscript, but I haven't tried it.

For WB maps, I've also had to use a small hack because the player 0 is always human on such a map, so I've added an empty civ at this position in WB (and I kill it at game start) to allow any combination of human/computer player on the map.
 
Back
Top Bottom