Jump to content

Recommended Posts

Simple Saving

 

 

I did two basic mission persistence scripts that some people might use. It's not in the league of DAWS or Igneous' Kaukasus offensive or any of the major league hitters, but it's a very accessible, simple saving tool and it works with MOOSE in 2019.

 

 

These come in two scripts:

https://github.com/thebgpikester/SimpleGroupSaving

https://github.com/thebgpikester/SimpleStaticSaving

 

 

To ensure version quality, you'll need to download directly from Github.

 

 

Simple Group Saving scans all Ground Groups and Units and puts them in a file every few seconds. When you reload the mission, you get back exactly what you had before restart, minus the debris.

 

 

Simple Static Saving does the same with Statics Units, which behave differently to Normal Groups. Not every scenario would appreciate these being merged, it was a core aim to simplify this down to provide flexibility.

 

 

I did a very boring video going into depth how it works. Probably of interest to scripters and admins that hadn't learned how to do this already. Maybe 5 or 6 of us worldwide, the subsect of DCS players, that weren't already from a formal developer background, that went and learned both DCS and LUA! Panda's have a more stable population...

 

 

 

 

 

 

FAQ:

 

What is the difference between this and DAWS?

This is just saving Ground units, no messing around with mods, different mission files, weather, time of day or any other complexities. It also works fine with MOOSE. DAWS is better for folks not using additional scripting over the top, or if it works just fine for you.

 

 

What type of person might be interested?

I'd say anyone wanting to look at scripting and start their own campaign, but didn't know how to begin. Server admins looking for a bit extra or an 'off-the-shelf' solution to saving their game. People wanting to explore the ideas in Dynamic persistent campaigns their own way, rather than the DCS style campaign which is unconnected strings of linear missions. Sandbox people.

 

 

Why no routes!?

Well I didn't know either, that if you give a group a route, you cannot extract that route back out! Until I got quite a way down this road! Sure, you can get the original route but this is so restrictive as to render it pointless to grab as it's old age by the time a mission had run. Eagle Dynamics, please give us this ability :)

 

 

Why no Naval?

I didn't touch Ships because of the fundamental limitations of spawning ships that have AI and Client slot starts. Just can't be done, you can't move slots outside of what is in the actual mission file. To do that it would require a design that rewrites the mission as it was, just like DAWS did. Sure I could do a version that excluded any carriers or helicopter frigates but then it's getting confusing, why would you only persist some ships and not others? Eagle Dynamics, please give us this ability also (moving farps, ships mod mission)

 

 

Why didn't you delete all the statics and respawn them in the static script just like for Groups?

I saw some issues with rapid spawning of statics and destroying them whilst having a SET and I bailed on that idea and just blew them up at the start instead. If I discover the reasons I got script errors by doing it that way, I'd like to revert to spawning in dead and alive statics instead.

 

 

Why do servers need to be restarted when DCS is so performant now?

Restarts are needed on persistent servers for several reasons that are not performance related, even if there were no memory accumulation issues, patching or maintenance required. My two favourite reasons are:

1. There is no way to tidy up dead ground units.

2. Runways don't fix themselves and AI will stop using airbases if a runway is bombed. (At least they haven't since many years and if it's just changed then please supply details). With the advent of JDAM, I can shut down AI at four airbases in one sortie.

 

 

Will you support and develop this?

Highly unlikely, I wrote it for myself and just felt that sharing was appropriate. Features can be forked on Github however you like. It's a very small script and it just works how it's meant to and nothing more.

 

 

If you found this useful I'd like to hear how you used it and what you came up with. There's a few things you can extend on this. The SET can be configured for more or less with Filters. You can access the SaveUnits table and do other things with it, like a mini database. For counting and such.

 

 

Have fun.

[Added demo mission]

SimpleSaving.miz


Edited by Pikey
added demo miz

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites

Update 25th March 2020

I took some time to fix some nagging issues with SGS and SSS. Note that Simple Scenery saving also exists as a tool.

 

 

 

SGS:

1. Someone had discovered that the GetHeading() returned from a unit is in Radians and I hadn't coverted it to degrees or vice-versa. I've now fixed that so that units should correctly face the way you intended.

 

 

SSS:

1. Mostly rewritten, since, programmatically speaking, statics are a GIANT PAIN IN THE BACKSIDE that do not obey convention in DCS.

2. Now excludes Farps and SeaShelf Objects, Smoke Effects and anything that will refuse to report its type of category or details that are required. This was a showstopper in various patches.

3. Will now replace the Static that was destroyed with a destroyed object of the same type by default, but this is easy to remove.

 

 

Scenery Tools:

1. I added this a while back and don't think I made any notes on the release specifically. This is a tool that can persist 'map scenery' (or remove it with explosions) rather than unit or statics. It also can be used to

 

-create an explosion at a marker point

-Get the COORDINATE of the marker point

-Record target scenery and add to a list of targets

 

 

 

KNOWN ISSUES:

When spawning a new dead static, Moose will error as it attempts to inject the new dead static into the Moose database. I don't know why, but this is mostly cosmetic since you dont need to think about these objects, they are for visual continuity , mission to mission. You can disable the dead model swap on restart.

 

Ships, always report they are alive, even after sunk. This is a DCS thing, probably a legacy from where the model is replaced for statics, but for ships it has animation to sink and disappear slowly. Cannot do anything about it, so just avoid Static ships, the only use case is for harbour decoration, if its a ship target, use a UNIT type please.


Edited by Pikey
Updates!

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites

Thank you so much for this! Had a few questions about how this could be done on our discord a little while back! I think this will be very useful and going to give this a try later this evening!

[sIGPIC][/sIGPIC]



The Fraternity - Georgia Reign - PvE MP

24/7 Server: 107.150.36.234:10308

Live Map& Stats: Georgia Reign

Join Our Discord

Link to post
Share on other sites

Yes. Literally at any point in time it captures what is alive (ground groups). So if something appears, then disappears, it was in the table saved, then removed. Will capture any spawned unit of any type, mods included, from any script, coalition.addGroup, SPAWN, dyn.add, whatever.

 

To give you an idea, it was super handy for catching deployed CTLD stuff.

 

 

For JTACs I'll need another script to go through the table after mission start to check by names and do the CTLD command for JTAC. The group and unit names are the same, so you can use any of the table.insert() on the internal CTLD tables. There's probably more things you can do to work around things like that, but should do most of the heavy lifting.

 

 

Have fun! :)

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites
  • 3 weeks later...

Nice job! I have test it and work fine!

 

I have 2 questions:

 

1- It's possible add the persistence for ONLY red ships? like Moskva?

2-It's possible add the persistence for time ad date of mission?

[sIGPIC][/sIGPIC]

 

SimItaliaGames.com - si vis pacem, para bellum

 

101^Squadrone Multiruolo Ariete - Acta Non Verba

 

=WebSite==

 

=YouTube==

 

=FaceBook=

 

=PersistentDinamicMission=

Link to post
Share on other sites

1- It's possible add the persistence for ONLY red ships? like Moskva?

 

From the script comments:

 

 

--LIMITATIONS

--Only Ground Groups and Units are specified, play with the SET Filter at your own peril. Could be adjusted for just one Coalition or a FilterByName().

--See line 107 and 168 for the SET.

--See https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_GROUP)

--Naval Groups not Saved. If Included, there may be issues with spawned objects and Client slots where Ships have slots for aircraft/helo. Possible if not a factor

 

Link to post
Share on other sites
From the script comments:

 

 

 

 

--LIMITATIONS

 

--Only Ground Groups and Units are specified, play with the SET Filter at your own peril. Could be adjusted for just one Coalition or a FilterByName().

 

--See line 107 and 168 for the SET.

 

--See https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_GROUP)

 

--Naval Groups not Saved. If Included, there may be issues with spawned objects and Client slots where Ships have slots for aircraft/helo. Possible if not a factor

 

 

 

Yes, i have read the comment. I talk about ship without spawn slot.

[sIGPIC][/sIGPIC]

 

SimItaliaGames.com - si vis pacem, para bellum

 

101^Squadrone Multiruolo Ariete - Acta Non Verba

 

=WebSite==

 

=YouTube==

 

=FaceBook=

 

=PersistentDinamicMission=

Link to post
Share on other sites
Yes, i have read the comment. I talk about ship without spawn slot.

 

I guess there shouldn't be a problem then:

 

--Naval Groups not Saved. If Included, there may be issues with spawned objects and Client slots where Ships have slots for aircraft/helo. Possible if not a factor

 

---Ok, so provided we don't have spawn slots on ships, then I guess it's a matter of replacing lines 107 and 168

 

---Line 107:

AllGroups = SET_GROUP:New():FilterCategories("ground"):FilterActive(true):FilterStart()

 

---Replace by:

AllGroups = SET_GROUP:New():FilterCoalitions("red"):FilterCategories("ship"):FilterActive(true):FilterStart()

 

 

---Line 168:

AllGroups = SET_GROUP:New():FilterCategories("ground"):FilterActive(true):FilterStart()

 

---Replace by:

AllGroups = SET_GROUP:New():FilterCoalitions("red"):FilterCategories("ship"):FilterActive(true):FilterStart()

 

 

 


Edited by Hardcard
Link to post
Share on other sites
I guess there shouldn't be a problem then:

 

--Naval Groups not Saved. If Included, there may be issues with spawned objects and Client slots where Ships have slots for aircraft/helo. Possible if not a factor

 

---Ok, so provided we don't have ship spawns, then I guess it's a matter of replacing lines 107 and 168

 

---Line 107:

AllGroups = SET_GROUP:New():FilterCategories("ground"):FilterActive(true):FilterStart()

 

---Replace by:

 

AllGroups = SET_GROUP:New():FilterCoalitions("red"):FilterCategories("ship"):FilterActive(true):FilterStart()

 

 

---Line 168:

AllGroups = SET_GROUP:New():FilterCategories("ground"):FilterActive(true):FilterStart()

 

---Replace by:

AllGroups = SET_GROUP:New():FilterCoalitions("red"):FilterCategories("ship"):FilterActive(true):FilterStart()

 

 

 

 

 

ok... i think is necessary new file .lua only for ship . I will try it, many thanks

 

 

Inviato dal mio iPhone utilizzando Tapatalk

[sIGPIC][/sIGPIC]

 

SimItaliaGames.com - si vis pacem, para bellum

 

101^Squadrone Multiruolo Ariete - Acta Non Verba

 

=WebSite==

 

=YouTube==

 

=FaceBook=

 

=PersistentDinamicMission=

Link to post
Share on other sites
ok... i think is necessary new file .lua only for ship

 

If your goal is to save ground units as well as red coalition ships, then you'll need to include additional code in that script (I don't think a separate script is required).

 

But if you're only interested in saving red ships, I think that replacing those two lines should be enough.

 

Hopefully Pikey will come back and clear this up for us.


Edited by Hardcard
Link to post
Share on other sites
If your goal is to save ground units as well as red coalition ships, then you'll need to include additional code in that script (I don't think a separate script is required).

 

But if you're only interested in saving red ships, I think that replacing those two lines should be enough.

 

Hopefully Pikey will come back and clear this up for us.

 

 

 

My goal is add ship red( offensive ships) and keep ground units

 

 

Inviato dal mio iPhone utilizzando Tapatalk

[sIGPIC][/sIGPIC]

 

SimItaliaGames.com - si vis pacem, para bellum

 

101^Squadrone Multiruolo Ariete - Acta Non Verba

 

=WebSite==

 

=YouTube==

 

=FaceBook=

 

=PersistentDinamicMission=

Link to post
Share on other sites
  • 2 weeks later...
My goal is add ship red( offensive ships) and keep ground units

 

 

Inviato dal mio iPhone utilizzando Tapatalk

 

 

Hi,

You see this line

 

 

AllGroups = SET_GROUP:New():FilterCategories("ground"):FilterActive(true):FilterStart()

 

 

what you sound like you need is a combination of that plus:

AllGroups2 = SET_GROUP:New():FilterCategories("ship"):FilterCoalitions("red"):FilterActive(true):FilterStart()

 

I'm writing this right out into a post so haven't tested but I did something similar with a couple of lines after that went like this:

 

AllGroups2:ForEachGroup(function(grp)
AllGroups:AddGroupsByName(grp:GetName())
end)

 

 

Which adds all the groups from AllGroups2 to the AllGroups SET.

 

 

 

The SET is from MOOSE: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_GROUP).FilterCategories

 

 

You could try playing with stuff from here. You could also use Prefixes and such. Let me know if you had any success, i'm not inclined to try it as I know it leads down a bad path, but it should be possible to do at least what you said.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites
Hi,

You see this line

 

 

AllGroups = SET_GROUP:New():FilterCategories("ground"):FilterActive(true):FilterStart()

 

 

what you sound like you need is a combination of that plus:

AllGroups2 = SET_GROUP:New():FilterCategories("ship"):FilterCoalitions("red"):FilterActive(true):FilterStart()

 

I'm writing this right out into a post so haven't tested but I did something similar with a couple of lines after that went like this:

 

AllGroups2:ForEachGroup(function(grp)
AllGroups:AddGroupsByName(grp:GetName())
end)

 

 

Which adds all the groups from AllGroups2 to the AllGroups SET.

 

 

 

The SET is from MOOSE: https://flightcontrol-master.github.io/MOOSE_DOCS_DEVELOP/Documentation/Core.Set.html##(SET_GROUP).FilterCategories

 

 

You could try playing with stuff from here. You could also use Prefixes and such. Let me know if you had any success, i'm not inclined to try it as I know it leads down a bad path, but it should be possible to do at least what you said.

 

 

 

Many thanks! It work fine! Now i will try to save the time and date of the mission!

 

 

Inviato dal mio iPhone utilizzando Tapatalk

[sIGPIC][/sIGPIC]

 

SimItaliaGames.com - si vis pacem, para bellum

 

101^Squadrone Multiruolo Ariete - Acta Non Verba

 

=WebSite==

 

=YouTube==

 

=FaceBook=

 

=PersistentDinamicMission=

Link to post
Share on other sites

That is not doable :(

You can't change the time and the date of a mission (you can get them, but you cannot change them inside a mission)

 

 

Maybe check out the METAR script that does this. It gets super painful because it has to create a new mission to load from an existing. Very much like DAWS (which might still work for you if you can find a copy).

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites
That is not doable :(

You can't change the time and the date of a mission (you can get them, but you cannot change them inside a mission)

 

 

Maybe check out the METAR script that does this. It gets super painful because it has to create a new mission to load from an existing. Very much like DAWS (which might still work for you if you can find a copy).

 

 

 

Yep, i know but i have an idea! I will teel

to you if i will complete my goal

 

 

Inviato dal mio iPhone utilizzando Tapatalk

[sIGPIC][/sIGPIC]

 

SimItaliaGames.com - si vis pacem, para bellum

 

101^Squadrone Multiruolo Ariete - Acta Non Verba

 

=WebSite==

 

=YouTube==

 

=FaceBook=

 

=PersistentDinamicMission=

Link to post
Share on other sites
  • 2 months later...
  • 1 month later...

Hello Surrexen,

I haven't touched this since May and I had to look at it to find out if I even tried. I save the heading of the units then I use Ed's coalition.addGroup in the format that it wants. I believed it was saving the heading and reusing it. I certainly felt during testing that was also fine. Could you provide any further feedback on this, if it was consistent with different uses?

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites
  • 4 weeks later...
  • 2 weeks later...

I cannot support CTLD even though I tried. Any JTAC, FOB, CTLD known object reverts to a normal object after restart because CTLD doesnt know about it. I did try to insert them into the tables of CTLD but that didnt work. I think I spoke to Ciribob about it some time back but he was busy and coulnt remember much more.

 

So, script is working as expect, object copied over, CTLD doesn't work.

 

 

If you manage to fix this, let me know how, I spent a while trying.

 

Hi there.

 

Pikey, one question : CTLD FOB are not showing up after a restart, only the motar simulating the beacon.

 

Am I wrong with something using this script ?

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to post
Share on other sites
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...