Multiplayer in GTA 2 Coding
You do not need to create a .scr script for each amount of players who might be on the level in a game. GTA 2 will automatically ignore any PLAYER_PED commands for which there isn’t a human player. You then create a .mmp file for each number of players you want your level to support, linking to the same .scr.
One Script to Rule Them All…
From my slayer.mis script:
// Players:
PLAYER_PED p1 = (103.5,90.5,255.0) 10 90
PLAYER_PED p2 = (072.5,090.5,255.0) 7 0
PLAYER_PED p3 = (192.5,107.5,255.0) 11 0
PLAYER_PED p4 = (081.5,121.5,255.0) 13 90
PLAYER_PED p5 = (186.0,151.5,255.0) 8 180
PLAYER_PED p6 = (122.5,164.5,255.0) 12 90
// Player Cars:
PARKED_CAR_DATA p1car = (105.5,092.5) 28 90 STINGRAY
PARKED_CAR_DATA p2car = (071.5,093.5) 35 180 STINGRAY
PARKED_CAR_DATA p3car = (192.5,110.5) 20 90 STINGRAY
PARKED_CAR_DATA p4car = (084.5,120.5) 31 0 STINGRAY
PARKED_CAR_DATA p5car = (187.5,149.5) 02 0 STINGRAY
PARKED_CAR_DATA p6car = (122.0,162.5) 33 90 STINGRAY
This script can be used for any number of players. All six cars will appear in all games. GTA 2 will only create a PLAYER_PED for human players, the rest of them will be ignored. If you only have four players, then p5 and p6 won’t be created.
You have to compile your .mis into a .src using a program. I use Delfi’s Mis Pad.
Multiplayer Map Packages (*.mmp)
Here’s how I set up multiplayer from my MultiSlayer level.
1 Player
The test1.seq sets single player games:
MainOrBonus = MAIN
GMPFile = slayer.gmp
STYFile = slayer.sty
SCRFile = slayer.scr
Description = City 3 Map
If your multiplayer level has some single player missions in a different .scr then you should link to that script in the test1.seq file.
You can also play by yourself from the multiplayer interface. From my slayer1p.mmp:
[MapFiles]
GMPFile = slayer.gmp
STYFile = slayer.sty
SCRFile = slayer.scr
Description = MultiSlayer 1 Player
PlayerCount = 1
2 Players
From my slayer2p.mmp file:
[MapFiles]
GMPFile = slayer.gmp
STYFile = slayer.sty
SCRFile = slayer.scr
Description = MultiSlayer 2 Player
PlayerCount = 2
6 Players
From my slayer6p.mmp file:
[MapFiles]
GMPFile = slayer.gmp
STYFile = slayer.sty
SCRFile = slayer.scr
Description = MultiSlayer 6 Player
PlayerCount = 6