Pikey Posted August 16, 2023 Posted August 16, 2023 Download from https://github.com/thebgpikester/SWS Put it in your mission, Run Once DO SCRIPT - SWS.lua PREREQS Requires lfs and io desanitized from missionscripting.lua. No 3rd party SSE like Mist or Moose required. WHAT IT DOES Gets the contents of all DCS Airbase warehouses in the mission and saves them to file. Reloads from the save every mission. (no prompts) USAGE Load this script at mission start as a DO SCRIPT. By default, DCS sets unlimited warehouses. Set some warehouses to have limited contents by clicking on them in the Mission Editor and unchecking 'Unlimited' next to any of aircraft, fuel and weapons. Set a fixed limit amount. Optionally, setup supply chains as per pg 104 DCS user manual EN 2020.pdf in your main DCS installation\Doc folder. CONFIGURABLE ITEMS SWS.filepath = lfs.writedir().."SimpleWarehouse.lua" You can configure a custom directory for the save file here if needs be. SWS.updateDelaySeconds = 60 You can change the timer interval for the saving of warehouses here. Now the waffle Administrators and mission makers can now consider warehouse contents in their mission creation flow. Previously we only used "unlimited" warehouse resources such as fuel, aIrcraft, and weapons because we had no way to save, persist, add or subtract from the DCS warehouses. Now we do. For a primer on how some of the weirder things work with the DCS Resource Manager, see For the documentation, see pg 104 DCS user manual EN 2020.pdf in your main DCS folder. There really is a lot to this hidden gem. The usecase for the script is that rather than set pacing of how an extended mission that runs for days works out, the AI is restricted by what is in the DCS Warehouse. There's several ways you can accomplish a "logistical win-lose" mini game in DCS mission editor: - Use the existing Resource Manager, set finite limits, no supply chains - first one to empty loses. - Use DCS Supply chains from warehouse to warehouse, empty the enemy coalition warehouse before you are crippled. - Use finite limits and add your own supply chains using the new API functions to add and remove fuel, units, weapons. - Use fantastic mods like the Hercules mod (soon-to-be-a-thing) and just your own plane and inventory to add resources to a warehouse by landing at the desired aifield and releasing control of the airframe and going to spectators. - Use AI to land at the desired airfield and shutdown, which achieves the same thing by adding the fuel, airframe and weapon loadout to the airbase warehouse. As a parting thing, I'd expect to see this used slowly at first because its a major Server design paradigm shift. Most people have their existing methods. You should see mods like DAWS freely embrace this, with hope, MOOSE may pick it up and utilize the new API functions. Its very easy to create a F-16 factory and having realistic bombing targets now. We relaly need bombing, but previously it was kindda pointless. Happy scripting. 2 3 ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
Recommended Posts