Ciribob ED Testers Team

Join Date: Mar 2015 Location: Brighton, UK Posts: 1,939

Dedicated Server Script



The method WILL break when DCS updates and have to be redone, and is not for the faint hearted.



Firstly, make sure you server is set to auto login on start or you can't use this method.



Step one: use Notepad++ or another good editor to edit C:\Eagle Dynamics\DCS World\MissionEditor\MissionEditor.lua



Find the function onShowMainInterface and put in the code snippet between "DEDICATED CODE" below:



Code: -- used in __EMBEDDED__ function onShowMainInterface() --print("--onShowMainInterface()---") if tooltipSkin_ == nil then tooltipSkin_ = Gui.GetTooltipSkin() else Gui.SetTooltipSkin(tooltipSkin_) end prepareMissionPath() mmw.setLastWallpaper() openReturnScreen() -- START DEDICATED CODE - ADD FROM THIS LINE -- if grgFirstRun == nil then grgFirstRun = true local net = require('net') local lfs = require('lfs') local Tools = require('tools') local mpConfig = Tools.safeDoFile(lfs.writedir() .. 'Config/serverSettings.lua', false) local dediConfig = Tools.safeDoFile(lfs.writedir() .. 'Config/dedicated.lua', false) if dediConfig and dediConfig.dedicated ~= nil and dediConfig.dedicated["enabled"] == true then net.set_name(dediConfig.dedicated["name"]) net.start_server(mpConfig.cfg) net.log("Starting Dedicated Server...") end end -- -- END DEDICATED CODE - ADD UP TO THIS LINE end Step two: Create a file called dedicated.lua in C:\Users\<USER NAME>\Saved Games\DCS\Config and add:



Code: dedicated = { ["enabled"] = false, ["name"] = "Server Player Name", } Step 3: Configure your server as normal using the normal server launcher and launch it once. This ensures the settings are saved to the normal config file.



Step 4: Quit DCS, edit the dedicated.lua in C:\Users\<USER NAME>\Saved Games\DCS\Config and set enabled to true like so:



Code: dedicated = { ["enabled"] = true, ["name"] = "Server Player Name", } Step 5: Load DCS and marvel as after login it loads your multiplayer server!



If you ever want DCS to startup as normal so you can make modifications, edit the dedicated.lua and set enabled to false.



I highly recommend you do the registry tweak listed here so DCS doesnt show an error window and is easy to restart.



Note: If you press fly, you'll only be able to see the DCS home screen (dont worry the server is running!) and if you hit f10 you can see the map. Dont press buttons on the DCS home screen!



Next Steps: Use a program to automate the DCS Server launch and restart when crashed.



After a quick google I've found this and I'm going to try a few once I have some time:



Please don't hold me responsible if you wreck your DCS....



Thanks to Xcom, Greg and Crash for help and testing!



EDIT: Disable the windows error message so you can restart it easily - https://www.raymond.cc/blog/disable-...s-server-2008/ With a few modifications to some internal DCS LUA files, you can make DCS load a Multiplayer server mission on launch....The method WILL break when DCS updates and have to be redone, and is not for the faint hearted.Firstly, make sure you server is set to auto login on start or you can't use this method.use Notepad++ or another good editor to editFind theand put in the code snippet between "DEDICATED CODE" below:Create a file calledin C:\Users\ \Saved Games\DCS\Config and add:Configure your server as normal using the normal server launcher and launch it once. This ensures the settings are saved to the normal config file.Quit DCS, edit the dedicated.lua in C:\Users\ \Saved Games\DCS\Config and set enabled to true like so:Load DCS and marvel as after login it loads your multiplayer server!I highly recommend you do the registry tweak listed here so DCS doesnt show an error window and is easy to restart. http://forums.eagle.ru/showpost.php?...03&postcount=7 If you press fly, you'll only be able to see the DCS home screen (dont worry the server is running!) and if you hit f10 you can see the map. Dont press buttons on the DCS home screen!Next Steps: Use a program to automate the DCS Server launch and restart when crashed.After a quick google I've found this and I'm going to try a few once I have some time: https://www.raymond.cc/blog/keep-app...n-when-closed/ Please don't hold me responsible if you wreck your DCS....Thanks to Xcom, Greg and Crash for help and testing!

Scripts: Complete Transport And Logistics Deployment - CTLD /







Projects:

DCS-SimpleRadio Troubleshooting Post / DCS-SimpleRadio Free Support Channel on Discord __________________ CTLD Examples - Lots of example of how to use CTLD CSAR Script - Downed Pilot Rescue / Dedicated Server Script - Automatically launch DCS Multiplayer server at startup Range Scoring Script - Get scores and counts hits on targets for gunnery or bombs / SimpleSlotBlock - Multiplayer dynamic Slot Blocking Script DCS-SimpleRadio Standalone - DCS Radio Integration for All Aircraft - NO TeamSpeak Required! Last edited by Ciribob; 04-25-2018 at 05:41 PM . Reason: Fixed spelling mistake