PDA

View Full Version : DediServer/MP How to rotate missions.


ATAG_Bliss
09-24-2011, 12:30 AM
I'm sure others may have figured this out (rotating missions), but I was baffled for the longest time on how to do it. One of the things we always ran into was if you loaded another mission, even after the battle stop command, the initial mission would still be running - the server/map time would not change, the map would not change, and the only thing that would happen is the objects of the 2nd, 3rd, etc, mission being loaded would be the only thing showing up. For instance going from an English channel map to a quake map would simply keep the English channel map going, with it's current time etc and it would not change.

So here's how we've figured out how to do it. I'm sure there are other ways, but this is what we've found out how to work.

Some basic understanding 1st: I load missions with .cmd files (right or wrong), so lets say I want to load a mission - I open up the dedi server and direct the server to load the .cmd file of the mission I want to load.

For instance, lets say mission1.cmd is the name. (on a side note the dedicated server / dos window's default loading directly is in the Documents\1C SoftClub\il-2 sturmovik cliffs of dover folder - the same spot the confs.ini is in for example)

So if I want to load mission1.cmd I'll type f mission1.cmd in the dos box. f is the command to load a file in the dos/server window. For a further list of commands you can type ? or help in the dedi server box. So here's an example of what will be inside mission1.cmd:

missLoad missions/multi/dogfight/mission1.mis
battle start

Basically typingf mission1.cmd in the dos box will load the mission in the .cmd file :) (duh right?) and it's obviously easier typing out that than all the words quoted to simply load a mission and start the battle.

So moving on. We now have a mission running, but lets say we want to move on to another mission after a certain amount of time. (again I'm sure this could be done with scripting, but this is my way :grin:)

So building on that code from before lets add a line.

missLoad missions/multi/dogfight/mission1.mis
battle start
timeout 60 f stop.cmd

timeout 60 will wait 60 seconds then load stop.cmd (before anyone asks I have to tell you that you can not use a timeout command followed by a missLoad (mission load) command. So timeout 60 missLoad xxxxx.mis will not work and cause an error)

Inside the stop.cmd we'll have this:

battle stop
file mission2.cmd

***This is the important part***

Battle stop is the command to stop the battle on the server. This readies the server for another mission. So now that we've stopped the current battle, it's time to load another mission. If you notice I'm not using f mission2.cmd but instead am using file mission2.cmd. (if you don't use file this will not work and your 1st mission will remain) The file command seems to break/interrupt the current mission and allows the new mission to be loaded (new map, time etc.) Did I say you have to use file? :)

So now the battle has stopped and we are loading mission2.cmd with file, here's an example of what could be inside mission2.cmd:

missLoad missions/multi/dogfight/mission2.mis
battle start
timeout 60 f stop2.cmd

This loads your mission named mission2 and starts the battle. What players will experience is a screen of only a few seconds stating the battle has ended/stopped, then almost immediately they will see the loading bar at the bottom of the screen and be in the new mission!

So now we've started one mission and within 60 seconds rotated to a another mission. Inside the stop2.cmd we could have something that looks like this:

battle stop
file mission1.cmd

So if you get what's happening now, you'll notice that I've created a never ending loop. Basically mission1 will load and within 60 seconds mission2 loads, and in another 60 seconds it will go back to mission1 and repeat indefinitely.

Obviously the timeout's (say 3 hours or so) could be used instead of 60 seconds, and you could daisy chain as many missions as you want in a row as I've done to have many more missions rotating than 2. But in order to do this you must be able to de-spawn/destroy all the static objects in your mission before you load another one as they will accumulate from mission to mission if you don't.

So if you had a timeout of an hour or 3600s, you should put your despawn/destroy script roughly 5-10 seconds before the mission change 3550s. And you should be all set.

Hope this helps.

And hopefully someone will post up a way of loading a completely new mission (mission rotation) via C#!

Troll2k
09-24-2011, 01:20 AM
Have you looked at trying to adapt Server Commander to Clod?

I use it to rotate maps on my dedicated 1946 server.

Ataros
09-24-2011, 08:43 AM
The file command seems to break/interrupt the current mission and allows the new mission to be loaded (new map, time etc.) Did I say you have to use file? :)

Great find! Many thanks for sharing!

What happen to objects of the 1st mission when you use file command? E.g. do all airgroups disappear in the air?

Is the f command just a short version of the file command and should do the same and just bugged or there supposed to be a difference between f and file commands? Was it the case in original IL-2? (I do not have experience with original IL-2 server.)

ATAG_Bliss
09-24-2011, 12:25 PM
The objects will remain. You definitely will need some sort of despawn script. Hopefully someone can make one that will destroy all objects. (anyone? :) )

The f and file command both do the same thing, but the file command seems to break/interrupt a mission so when you do initiate a different mission another mission is loaded instead of just adding on the 1st one.

Original IL-2 was like this as well. But, old IL-2's dedicated server program hasn't been used in a long time with things like FBDj/daemon/server commander.

@ Troll

I agree with ya. Wish I knew how to make it work for the IL2COD.

Ataros
09-24-2011, 12:38 PM
The objects will remain. You definitely will need some sort of despawn script. Hopefully someone can make one that will destroy all objects. (anyone? :) )

The f and file command both do the same thing, but the file command seems to break/interrupt a mission so when you do initiate a different mission another mission is loaded instead of just adding on the 1st one.

If objects from the 1st mission remain then I do not understand what you mean by saying that the file command stops the old mission.

The only problem with battle stop/battle start was multiple "NotDestroyedActor" errors iirc. Because of this error Repka uses launcher restart 2 times a day to clear memory from all the objects of the old mission.

FG28_Kodiak
09-24-2011, 12:38 PM
Problem is that only Actors are accessible, so they could destroy()ed, but the other static object not. Maybe you can ask the devs? So they can made a function for this in a later update, or they can give you a hint how it works in the current version ;)

Ataros
09-24-2011, 12:56 PM
Problem is that only Actors are accessible, so they could destroy()ed, but the other static object not. Maybe you can ask the devs? So they can made a function for this in a later update, or they can give you a hint how it works in the current version ;)

The devs said it is planned for the future.
Frankly speaking I think statics should be avoided in online missions because they increase loading time and lag but do not add much to gameplay imho.

AAA, AT guns are excessable via a script. The rest of the scenario should be done with moving objects (actors) which is more fun I think than having static objects like in original IL-2.

ATAG_Bliss
09-24-2011, 12:57 PM
If objects from the 1st mission remain then I do not understand what you mean by saying that the file command stops the old mission.

The only problem with battle stop/battle start was multiple "NotDestroyedActor" errors iirc. Because of this error Repka uses launcher restart 2 times a day to clear memory from all the objects of the old mission.

What I mean by f and file is that if you have a battle stop on a mission and load another mission via f, the original mission will remain and the new mission will act as a submission. If you use file, the old mission is gone and the new mission will show up. For instance if I battle stop an english channel map and load a volcanic island map through "f" the english channel map will still remain. Using file on a battle stop (ed) mission will have the volcanic island map show up!

Problem is that only Actors are accessible, so they could destroy()ed, but the other static object not. Maybe you can ask the devs? So they can made a function for this in a later update, or they can give you a hint how it works in the current version ;)

Hmm, that stinks. Lets hope so ;)