diff --git a/Miz/PlayerGroup-Debug.lua b/Miz/PlayerGroup-Debug.lua index 009d756..cc02d2d 100644 --- a/Miz/PlayerGroup-Debug.lua +++ b/Miz/PlayerGroup-Debug.lua @@ -86,7 +86,7 @@ ["alt"] = 13, ["alt_type"] = "BARO", ["livery_id"] = "default", - ["skill"] = "Player", + ["skill"] = "Client", ["speed"] = 138.88888888889, ["AddPropAircraft"] = { diff --git a/Miz/PlayerGroup-Release.lua b/Miz/PlayerGroup-Release.lua index 73af1ec..3ffdd77 100644 --- a/Miz/PlayerGroup-Release.lua +++ b/Miz/PlayerGroup-Release.lua @@ -65,7 +65,7 @@ ["alt"] = 22, ["alt_type"] = "BARO", ["livery_id"] = "default", - ["skill"] = "Player", + ["skill"] = "Client", ["speed"] = 138.88888888889, ["type"] = "Su-25T", ["unitId"] = 1, diff --git a/README.md b/README.md index fa5ea21..d7f6ae9 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Please also note that PvP is not supported at the moment and that the mission wi - [ ] Additional commands in the "navigation" menu - [ ] Vector to nearest airfield - [ ] Weather report - - [ ] Use of "Client" slot instead of "Player" slot even in single-player missions, allowing the player to respawn on death/ejection instead of having to start the whole mission again + - [x] Use of "Client" slot instead of "Player" slot even in single-player missions, allowing the player to respawn on death/ejection instead of having to start the whole mission again - [ ] Single-player mission autostart on player take off - Quality of life/minor tweaks - [ ] AI wingmen "Two was shot down!" call when witnessing another wingman killed diff --git a/Script/Script.lua b/Script/Script.lua index cdfd6d4..f422f32 100644 --- a/Script/Script.lua +++ b/Script/Script.lua @@ -68,29 +68,25 @@ function TUM.initialize() end if #DCSEx.envMission.getPlayerGroups() == 0 then - TUM.log("No \"Player\" or \"Client\" aircraft slots have been found. Please fix this problem in the mission editor.", TUM.logger.logLevel.ERROR) + TUM.log("No \"Client\" aircraft slots have been found. Please fix this problem in the mission editor.", TUM.logger.logLevel.ERROR) return nil end if world:getPlayer() then - coreSettings.multiplayer = false + TUM.log("A \"Player\" aircraft slot has been found. The Universal Mission only uses \"Client\" slots, even for single-player missions. Please fix this problem in the mission editor.", TUM.logger.logLevel.ERROR) + return nil + end - if #DCSEx.envMission.getPlayerGroups() > 1 then - TUM.log("Multiple players slots have been found in addition to the single-player \"Player\" aircraft. Please fix this problem in the mission editor.", TUM.logger.logLevel.ERROR) - return nil - end - else - coreSettings.multiplayer = true + coreSettings.multiplayer = (#DCSEx.envMission.getPlayerGroups() > 1) - if #DCSEx.envMission.getPlayerGroups(coalition.side.BLUE) == 0 and #DCSEx.envMission.getPlayerGroups(coalition.side.RED) == 0 then - TUM.log("Neither BLUE nor RED coalitions have player slots. Please make sure one coalition has player slots in the mission editor.", TUM.logger.logLevel.ERROR) - return nil - end + if #DCSEx.envMission.getPlayerGroups(coalition.side.BLUE) == 0 and #DCSEx.envMission.getPlayerGroups(coalition.side.RED) == 0 then + TUM.log("Neither BLUE nor RED coalitions have player slots. Please make sure one coalition has player slots in the mission editor.", TUM.logger.logLevel.ERROR) + return nil + end - if #DCSEx.envMission.getPlayerGroups(coalition.side.BLUE) > 0 and #DCSEx.envMission.getPlayerGroups(coalition.side.RED) > 0 then - TUM.log("Both coalitions have player slots. The Universal Mission is a purely singleplayer/PvE experience and does not support PvP. Please make sure only one coalition has player slots in the mission editor.", TUM.logger.logLevel.ERROR) - return nil - end + if #DCSEx.envMission.getPlayerGroups(coalition.side.BLUE) > 0 and #DCSEx.envMission.getPlayerGroups(coalition.side.RED) > 0 then + TUM.log("Both coalitions have player slots. The Universal Mission is a purely singleplayer/PvE experience and does not support PvP. Please make sure only one coalition has player slots in the mission editor.", TUM.logger.logLevel.ERROR) + return nil end if not TUM.territories.onStartUp() then return nil end diff --git a/Script/The Universal Mission/Mission.lua b/Script/The Universal Mission/Mission.lua index 53f71ca..addea63 100644 --- a/Script/The Universal Mission/Mission.lua +++ b/Script/The Universal Mission/Mission.lua @@ -205,12 +205,11 @@ do end end - if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end - + -- if TUM.settings.getValue(TUM.settings.id.MULTIPLAYER) then return end -- When player dies in single-player, fail the mission - if event.id == world.event.S_EVENT_CRASH or event.id == world.event.S_EVENT_EJECTION or event.id == world.event.S_EVENT_PILOT_DEAD then - TUM.mission.endMission(TUM.mission.endCause.FAILED) - end + -- if event.id == world.event.S_EVENT_CRASH or event.id == world.event.S_EVENT_EJECTION or event.id == world.event.S_EVENT_PILOT_DEAD then + -- TUM.mission.endMission(TUM.mission.endCause.FAILED) + -- end end function TUM.mission.playMissionSummaryRadioMessage(onlyShowIncomplete, delayed)