Jump to content

Save Game Function (aka Dynamic Campaigns!!)


A Hamburgler

Recommended Posts

So ill keep this sort and sweet. I finally made my Save Game function. This function will allow the mission maker to transfer units and their positions and the variables you want to transfer over to another mission. Don't know if this has been done before as a separate function but as far as I know it has not. The only one whos done this is MBOT with his amazing campaign. I want to give MBOT a boat load of credit for this. I had to write most of this code all new but I used his external scripting idea for this. Would have never have been able to even think about this if he never posted his campaigns.

 

A quick run down on how it works:

 

Basically all the units that spawn in will get put into an array. Once the mission exits by the player or by a trigger all the units will get checked if they are alive if the units alive the units and their position will get stored in a newly external LUA file. The variables will also the same. After this the it will unpack a mission and import or transfer these new files over and repack the mission and then Load it.

 

 

Now this function is great for dynamic campaigns because you can now transfer almost anything you want over. Im still working on this and will try and release this as its own function with a sample mission so you guys can build off of it and make your own campaigns.

 

Heres a video of it in action... https://youtu.be/tcfxGAEP7ec

 

NEW video https://youtu.be/nM0Smj05h7I


Edited by A Hamburgler
Link to comment
Share on other sites

You do realize that if this works as I understand it works then you don't even need to create multiple mission files to stitch a campaign. Start with a Lua file containing all units and overwrite it everytime you exit the mission. It will act like a mission save for a finite number of resources in a conflict. You can even script resupply with spawn functions. Can't wait to see it.

[sIGPIC]OK[/sIGPIC]

Link to comment
Share on other sites

You do realize that if this works as I understand it works then you don't even need to create multiple mission files to stitch a campaign. Start with a Lua file containing all units and overwrite it everytime you exit the mission. It will act like a mission save for a finite number of resources in a conflict. You can even script resupply with spawn functions. Can't wait to see it.

The way I have mine set up is I just use two missions. The first one lays down the ground work to get the campaign started and the second one is the one that is played infinitely. The reason behind this is because since the first one sets up certain parts of the mission it has to use different scripts that would not work or screw up the mission when loaded again. So the second mission uses some different scripts that can be loaded at the mission start over and over again. Don't know if that made sense or not.


Edited by A Hamburgler
Link to comment
Share on other sites

Check DAWS script

 

It seems that it does not work in 2.5.

 

Does your script save spawned groups and units? Does it keep the original its names?

 

This is very important to make it compatible with other scripts such as CTLD, IADS etc, where you need to put specific names to make triggers to work.


Edited by ESAc_matador
Link to comment
Share on other sites

Check DAWS script

 

It seems that it does not work in 2.5.

 

Does your script save spawned groups and units? Does it keep the original its names?

 

This is very important to make it compatible with other scripts such as CTLD, IADS etc, where you need to put specific names to make triggers to work.

Interesting but yes it does save dynamically spawned groups and yes you can transfer over the groups original names.

Link to comment
Share on other sites

Check DAWS script

 

It seems that it does not work in 2.5.

 

Does your script save spawned groups and units? Does it keep the original its names?

 

This is very important to make it compatible with other scripts such as CTLD, IADS etc, where you need to put specific names to make triggers to work.

 

Now It's online 2.5.2 version for testing, and with working scenery object persistence :smilewink:

(if works....)

 

A Hamburgler, why don't you give a chance to DAWS for your dynamic campaign idea? if you check in the downloaded packages you will see some unfinished disabled functions and files that need talented coder to be done... and I don't have the time to do that :).

Feel free to PM me if you're interested.

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Now It's online 2.5.2 version for testing, and with working scenery object persistence :smilewink:

(if works....)

 

A Hamburgler, why don't you give a chance to DAWS for your dynamic campaign idea? if you check in the downloaded packages you will see some unfinished disabled functions and files that need talented coder to be done... and I don't have the time to do that :).

Feel free to PM me if you're interested.

Ill definitely look into it but I already have put a lot of time into my scripts and its almost complete. Definitely still going to release it because the more scripts out there the easier it is for people to learn from it. But after my initial release Ill definitely look at your scripts maybe we can work on some scripts together in the future.

Link to comment
Share on other sites

because the more scripts out there the easier it is for people to learn from it.

 

I agree :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

  • 2 weeks later...

So you run mission 1 the first time and the second mission after that? Corrector do the first switch you over to the second?

BlackeyCole 20years usaf

XP-11. Dcs 2.5OB

Acer predator laptop/ i7 7720, 2.4ghz, 32 gb ddr4 ram, 500gb ssd,1tb hdd,nvidia 1080 8gb vram

 

 

New FlightSim Blog at https://blackeysblog.wordpress.com. Go visit it and leave me feedback and or comments so I can make it better. A new post every Friday.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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