![]() |
Rotating server missions
I'm trying to script the rotation (restarting same mission) of server missions every 2 hrs. The mission restarts OK, but it appears that existing planes are not destroyed before launching the mssion again. This leads to an excess of planes sitting around the airfields radius. Can anyone suggest how to correct this. Here's the comand scripts I'm using, I start the server with using
f start1.cmd. START1.CMD Code:
battles stop Code:
battle stop |
If you do not change map you do not have to use battle stop command. Just destroy all unnecessary actors of the previous mission with a script and load new mission.
|
Thanks for advice, changed some of the cmd file text. I'm now using these cmd files. RotateMap.mis contains just the volcano map. Seems to work, but load times between missions can be 1-2 minutes & I'm not sure if this is the most efficient method. I start the server with using f start1.cmd.
Start1.cmd Code:
Code:
|
Quote:
using maddox.game.world; public void DestroyAllActors() { for each AiActor a in maddox.game.world { a.destroy(); } } |
Quote:
|
Salmo -
This is what I use to destroy actors between missions: 1st create a list to store all the objects at the top of the mission script: Code:
private Dictionary<String, AiActor> allActors = new Dictionary<String, AiActor>(); Code:
public override void OnActorCreated(int missionNumber, string shortName, AiActor actor) Finally I use the OnBattleStopped trigger to destroy any Actors which have not already been destroyed. Code:
public override void OnBattleStoped() WildWillie |
All times are GMT. The time now is 01:52 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.