Basic Persistence Kit

Home > User Files > Basic Persistence Kit
Tutte le versioni
Altro

Basic Persistence Kit

Caricata da - Wizard1393
Data - 09.11.2021 21:33:07
BASIC PERSISTENCE KIT by Jinx / ChrisofSweden - Update 2020-11-10 22:20

Purpose:
This is and is very much intended to be a Basic persistence kit that is as easy to use as possible. Demographically aimed at those that want to easily build a mission in the editor, populate it with lots of units, and be able to fly it one day, kill some stuff, log off, and keep going where they left off another day, perhaps with a friend, giving the sense of an ongoing ground war campaign.

How it works:
It works by storing information on what ground units the gets destroyed in a file. This can be done manually or automatically at an interval you choose. On mission start/restart, loads this file and removes all previously destroyed units the mission.

What this does NOT:
It does not save unit positions or routes so any units that moved during the mission will be back at initial position at mission start/restart.
It does not save destroyed static objects or scenery/buildnings.
It does not work with dynamically spawned ground units.

FILE CONTENTS

readme.txt
This text.

Mission.lua
Contains mission configuration variables, an event handler for logging destroyed units and calls to save and load file functions.

File_IO_functions.lua
Contains the actual file IO functions that creates/saves and loads dead units table to/from file.

Persistence_demo.miz
Example DCS mission file


PREREQUISITES:


To allow DCS Scripting Environment to create the save state file in your file system you also need to modify file:
"DCS World\Scripts\MissionScripting.lua"

Change:

do
    sanitizeModule('os')
    sanitizeModule('io')
    sanitizeModule('lfs')
    require = nil
    loadlib = nil
end

--To:

do
    --sanitizeModule('os')
    --sanitizeModule('io')
    --sanitizeModule('lfs')
    require = nil
    loadlib = nil
end



USAGE:

Put the unzipped folder "Basic Persistance Kit" into your Saved Games\DCS\Missions\ folder

Open file Mission.lua and configure the few variables in the USER CONFIG section, they are all explained and examples supplied.
Save and close Mission.lua.

Open DCS Mission Editor.
Create a mission and populate it how you want, or open an existing mission you would like to add persistence to.
Give the mission the same name you put in Mission.lua and save it.
Add a trigger TYPE "ONCE" with CONDITION "TIME MORE" set to 3, and add two ACTIONS:
    DO SCRIPT FILE and load the "File_IO_functions.lua" script.
    DO SCRIPT FILE and load the "Mission.lua" script.

Save your mission and play.

Enjoy!
  • Licenza: Gratuito - Versione gratuita, distribuzione illimitata
  • Lingua: Inglese
  • Dimensione: 14.46 Kb
  • Scaricato: 464
  • Commenti: 2
Tags: persistence
  • Commenti
Caricamento dei commenti...
FOLLOW US