Made some test with the TGroupDestroyed trigger
Found a additional problem with the TGroupDestroyed trigger, the trigger is only active before the group reached the endpoint. On the endpoint the trigger is automaticaly disabled. Seems to be a feature and not a bug, but i think its good to know.
One of my test the 0_Chief had the shortest way (few meters), i don't destroy any target, only fly around. After the trigger is disabled automatically it no longer possible to activate the trigger.
Server: Des_1 Trigger: True
Server: Des_2 Trigger: True
Server: Des_3 Trigger: True
Server: --------------------------
Server: Des_1 Trigger: True
Server: Des_2 Trigger: True
Server: Des_3 Trigger: True
Server: --------------------------
Server: Des_1 Trigger: True
Server: Des_2 Trigger: True
Server: Des_3 Trigger: True
Server: --------------------------
Server: Des_1 Trigger: True
Server: Des_2 Trigger: True
Server: Des_3 Trigger: True
Server: --------------------------
Server: Des_1 Trigger: False
Server: Des_2 Trigger: True
Server: Des_3 Trigger: True
Server: --------------------------
Server: Die Schlacht ist beendet.
My testscript and mission, the script shows the state of trigger every 10sec. :
Code:
[PARTS]
core.100
bob.100
[MAIN]
MAP Land$English_Channel_1940
BattleArea 251703 183294 91819 60561 10000
TIME 12
WeatherIndex 0
CloudsHeight 1000
BreezeActivity 10
ThermalActivity 10
player BoB_LW_LG2_I.000
[GlobalWind_0]
Power 3.000 0.000 0.000
BottomBound 0.00
TopBound 1500.00
GustPower 5
GustAngle 45
[splines]
[AirGroups]
BoB_LW_LG2_I.01
[BoB_LW_LG2_I.01]
Flight0 1
Class Aircraft.Bf-109E-4
Formation FINGERFOUR
CallSign 26
Fuel 100
Weapons 1
Skill 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3
[BoB_LW_LG2_I.01_Way]
NORMFLY 288810.19 211014.55 500.00 300.00
NORMFLY 290995.02 216329.47 500.00 300.00
[CustomChiefs]
[Chiefs]
0_Chief Vehicle.AEC_Matador gb
2_Chief Vehicle.AEC_Matador gb
1_Chief Vehicle.AEC_Matador gb
[0_Chief_Road]
291352.13 215913.05 38.40 0 2 4.17
291328.78 215953.20 38.40
[2_Chief_Road]
291173.38 215887.72 38.40 0 5 2.08
S 2563 0 0.80 40.00 P 291185.31 215916.13
S 2563 0 0.62 20.00 P 291263.63 216119.81
S 2563 0 0.24 20.00 P 291455.81 216619.78
291470.13 216668.56 38.40
[1_Chief_Road]
291638.69 216413.20 38.40 0 7 4.17
S 2564 0 0.25 20.00 P 291552.34 216412.75
S 2564 0 0.32 20.00 P 291449.75 216409.33
S 2564 0 0.50 20.00 P 291139.50 216399.00
S 2562 0 0.58 20.00 P 291026.44 216393.27
S 2562 0 0.84 40.00 P 290816.22 216703.83
290805.72 216727.70 38.40
[Stationary]
[Buildings]
[BuildingsLinks]
[Trigger]
Des_1 TGroupDestroyed 0_Chief 50
Des_2 TGroupDestroyed 1_Chief 50
Des_3 TGroupDestroyed 2_Chief 50
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using maddox.game;
using maddox.game.world;
public class Mission : AMission
{
Stopwatch MessageTimer = new Stopwatch();
public override void OnBattleStarted()
{
base.OnBattleStarted();
MessageTimer.Start();
MissionNumberListener = -1;
}
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
{
base.OnActorDead(missionNumber, shortName, actor, damages);
GamePlay.gpLogServer(null, "Actor: {0}", new object[] { actor.Name() });
}
public override void OnTickGame()
{
base.OnTickGame();
if (MessageTimer.Elapsed.TotalSeconds >= 10)
{
GamePlay.gpLogServer(null, "Des_1 Trigger: {0}", new object[] { GamePlay.gpGetTrigger("Des_1").Enable.ToString() });
GamePlay.gpLogServer(null, "Des_2 Trigger: {0}", new object[] { GamePlay.gpGetTrigger("Des_2").Enable.ToString() });
GamePlay.gpLogServer(null, "Des_3 Trigger: {0}", new object[] { GamePlay.gpGetTrigger("Des_3").Enable.ToString() });
GamePlay.gpLogServer(null, "--------------------------", null);
MessageTimer.Restart();
}
}
public override void OnTrigger(int missionNumber, string shortName, bool active)
{
base.OnTrigger(missionNumber, shortName, active);
GamePlay.gpLogServer(null, "Trigger: {0}", new object[] { shortName });
GamePlay.gpHUDLogCenter(null, "Trigger: {0}", new object[] { shortName });
GamePlay.gpGetTrigger(shortName).Enable = false;
}
}