![]() |
#21
|
|||
|
|||
![]() Quote:
However we should try: 1) make a mission with internal triggers without script 2) make a mission with script that loads the first mission in. 3) load more missions when needed. I will not have time to try this for a couple of days however (( Alternatively you can program all the triggers in a script by hand. Check links in the 1st message of this thread for examples. e.g. Code:
/ / $ Reference Campaign.dll / / - $ Debug using System; using maddox.game; using maddox.game.world; public class Mission: maddox.game.campaign.Mission { public override void OnTrigger (int missionNumber, string shortName, bool active) { if ("trigger". Equals (shortName) & & active) { GamePlay.gpHUDLogCenter ("Triggers trigger"); } } } Code:
using System; using maddox.game; using maddox.game.world; class Mission: maddox.game.AMission { public override void OnActorDead (int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List <DamagerScore> damages) { base.OnActorDead (missionNumber, shortName, actor, damages); AiAction action = GamePlay.gpGetAction ("TestAction"); if (action! = null) { action.Do (); } } } Code:
using System; using maddox.game; using maddox.game.world; using System.Collections.Generic; public class Mission : maddox.game.AMission { private List<AiAction> actions = new List<AiAction>(); private int round = 1; private bool completed = false; public override void OnBattleStarted() { AiAction action = GamePlay.gpGetAction("startGroup2"); if (action != null) actions.Add(action); action = GamePlay.gpGetAction("startGroup3"); if (action != null) actions.Add(action); GamePlay.gpHUDLogCenter(String.Format("Раунд {0}", round)); } public override void OnActorDead(int missionNumber, string shortName, AiActor actor, System.Collections.Generic.List<DamagerScore> damages) { base.OnActorDead(missionNumber, shortName, actor, damages); if (!(actor is AiAircraft)) return; // Не самолет int army = (actor as AiAircraft).Group().Army(); if (army == 1) { if (!completed) { bool fail = (actor as AiAircraft).AirGroup().DiedAircrafts >= (actor as AiAircraft).AirGroup().InitNOfAirc; if (fail) { GamePlay.gpHUDLogCenter("Миссия провалена."); } } } else { bool next = (actor as AiAircraft).AirGroup().DiedAircrafts >= (actor as AiAircraft).AirGroup().InitNOfAirc; if (next) { if (round == 3) { completed = true; GamePlay.gpHUDLogCenter("Поздравляем, миссия пройдена!"); } else { round++; startNewRound(); } } } } private void startNewRound() { GamePlay.gpHUDLogCenter(String.Format("Раунд {0}", round)); if (actions.Count > 0) { actions[0].Do(); actions.RemoveAt(0); } } } http://translate.google.com/translat...hp%3Ft%3D68369 Would you tell us what exactly you are trying to do and what does not work. Run my script it loads missions on timing more or less. Does not always destroy planes on the server however. Last edited by Ataros; 04-30-2011 at 01:23 AM. |
|
|