Jump to content

MIST / Lua to save mission progress


rvotri

Recommended Posts

Well, maybe mission scripters or someone else could provide me some help, and i think it might be usefull for everyone running online servers or just, wanting to keep a mission progress going.

 

I have a huge MP mission where both coalitions can transport troops (thanks ctld) and takeover Airdromes, but everytime i shutdown my server, mission restarts and both teams have to work all again... so i was thinking:

 

Maybe there is a way to set something like this by using the trigger editor and MIST or LUA togheter, something like this:

 

Switched Condition > Coalition Has Airdrome ("Airdrome Name","Coalition name") Then

Do Script / Do Script File (write to a simple TXT file ) : Coalition_Has_Aidrome ("Airdrome", "Coalition")

 

Then, when mission restarts, it would have a script to check this file, read and set proper coalition airdromes... This would be easy by spawning an armoured unit over the airport from the coalition.

 

The problem is, i don't know how to read and write strings to/from a file by using Mist or Lua. So.. can someone help me on this?

 

 

Thanks in advance.

Who cares...

Link to comment
Share on other sites

Apart from daws just doing this you dont need to capture the owners of airports, just the units that were in it. The airport would flip depending on who captured it. You could look at the blue flag mission file if you want to see a mission write out data then load it at start. Once you read that you can cross out the part where it says easy and make your own.

___________________________________________________________________________

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

Link to comment
Share on other sites

Thank you guys, sorry for the long time to answer back......

 

 

 

Hey! Nice one! But unfortanelly it doesn't work... Says that my mission was created with a newer version of editor. I still have the option to continue anyway, but when i try to run mission, it gets stuck on loading screen...

And thats a pity because i've read all documentation about DAWS and it is exactly what i want...

 

Apart from daws just doing this you dont need to capture the owners of airports, just the units that were in it. The airport would flip depending on who captured it. You could look at the blue flag mission file if you want to see a mission write out data then load it at start. Once you read that you can cross out the part where it says easy and make your own.

 

yea.. i was thinking something about that... The problem is that i can't output flag values...

 

I even had left a single armoured vehicle from both coalitions in each airport with "Late activation" checked, so i just have to set it to active to get the aiport to desired coalition.

 

I already created a flag for each Airdrome, for example: Flag 1 "Gudata", it would work as follows:

if flag 1 = 1 then Blue,

if flag 1 = 2 then Red,

if Flag 1 = 0 then "no coalition"

Who cares...

Link to comment
Share on other sites

  • 1 month later...

Missed your reply.

some things to get you started:

local CheckExistingCampaign = loadfile("Campaigninprogress.lua")

if CheckExistingCampaign == nil then

 

local exportData = "local status = 1"

File = io.open("Campaigninprogress.lua", "w")

File:write(exportData)

File:close()

 

and getuserflag and setuserflag are your friends.

 

Thank you guys, sorry for the long time to answer back......

 

 

 

 

Hey! Nice one! But unfortanelly it doesn't work... Says that my mission was created with a newer version of editor. I still have the option to continue anyway, but when i try to run mission, it gets stuck on loading screen...

And thats a pity because i've read all documentation about DAWS and it is exactly what i want...

 

 

 

yea.. i was thinking something about that... The problem is that i can't output flag values...

 

I even had left a single armoured vehicle from both coalitions in each airport with "Late activation" checked, so i just have to set it to active to get the aiport to desired coalition.

 

I already created a flag for each Airdrome, for example: Flag 1 "Gudata", it would work as follows:

if flag 1 = 1 then Blue,

if flag 1 = 2 then Red,

if Flag 1 = 0 then "no coalition"

___________________________________________________________________________

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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