Jump to content

Saving current mission situation and reloading in-game


Recommended Posts

Posted (edited)

1. I am trying to create a small script, which allows the player to write the current situation of on the map into a file via the F-10 menu.

 

2. I am trying to enable the player to spawn all the units at the same position and in the same composition they were, when the file in 1. was created.

Here I use the function loadfile(). That`s were I currently stuck. I oriented on MBots DC for the MiG-21Bis, but somehow I cannot get my head around, how to use the loadfile() and the table within the created file.

 

MissionScripting.lua is modified accordingly and attached is the script I have so far.

Basically a unit called "Script Manager" gets an F-10 option to save and reload a status.

 

Currently the script stops in line 99.

 

Maybe someone can point me into the right direction how to get access to the table saved in the file "JaBoG32Template_savefile"?

Edited by SNAFU

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Posted

Use of loadfile() looks ok to me, at least it is by the same principle I utilized. What I noticed is that the table in the status file is built incorrectly (line 20 etc.). Loadfile() tries to run the loaded file as a function, so I guess at that point the faulty table causes the error.

Posted

Thanks a lot for the hint. That was the cause.

 

...one step further... :pilotfly:

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

  • 2 weeks later...
Posted

SLMOD does not save the mission situation AFAIK.

 

There is Ian's Online Mission Planner, I worked with him back then to create exactly this script, but it is not working with MBot's loadfile but rather it saves a file which you then need to run through the Online Mission Planner in order to have the saved status working, so something like this would be very handy!

 

Check the current post -

http://forums.eagle.ru/showthread.php?t=121145&page=6

 

I also added save for static objects and updating warehouse status on page 6.

Posted

Ian's and Xcom's work is great. Mbots way for the DC is more suitable for my needs, since it doesn´t need the Mission Planner tool.

 

I have little time at hands in the moment, but when I get something useful done in this general direction, I`ll surely post it here.

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Posted

I'm very interested in this. By the way, what does SLMOD do then if its not saving the units? It certainly provides a list of units in a text file. It's undocumented, i'm sorry I just assumed.

Line 425

--Set to true to output active, alive units to \Saved Games\DCS\Slmod\activeUnits.txt. activeUnits.txt is updated roughly every 3-4 seconds.

export_world_objs = true

___________________________________________________________________________

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

Posted

Ah ok. I just tried the dotxt in that thread you listed. I got a MissionState.txt file with a bunch of coords but the admintool never updated anything so I can't confirm if I get warehouses saved or anything. I was building a workaround for this but then noticed Mbots campaign and was likewise interested in how to do this as the mission planner has only limited appeal for me too.

___________________________________________________________________________

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...