![]() |
#1
|
|||||
|
|||||
![]()
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: Quote:
![]() 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 ![]() So building on that code from before lets add a line. Quote:
Inside the stop.cmd we'll have this: Quote:
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: Quote:
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: Quote:
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#! |
|
|