Now uses "Client" instead of "Player" slots for single-player

This commit is contained in:
Ambroise Garel 2025-08-05 17:38:14 +02:00
parent c3ecc403e2
commit 4232ee723c
5 changed files with 19 additions and 24 deletions

View File

@ -86,7 +86,7 @@
["alt"] = 13,
["alt_type"] = "BARO",
["livery_id"] = "default",
["skill"] = "Player",
["skill"] = "Client",
["speed"] = 138.88888888889,
["AddPropAircraft"] =
{

View File

@ -65,7 +65,7 @@
["alt"] = 22,
["alt_type"] = "BARO",
["livery_id"] = "default",
["skill"] = "Player",
["skill"] = "Client",
["speed"] = 138.88888888889,
["type"] = "Su-25T",
["unitId"] = 1,

View File

@ -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

View File

@ -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

View File

@ -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)