![]() |
Are Destroyed triggers working ?
I'm testing out triggers and was wondering if the TGroupDestroyed or TGroundDestroyed are working.
The triggers are defined in the .mis file as: Code:
[Trigger] Code:
public override void OnTrigger(int missionNumber, string shortName, bool active) WildWillie |
Yes they working without problem for me, not tested with your example.
For testing i use this code: Code:
public override void OnTrigger(int missionNumber, string shortName, bool active) |
Quote:
I just posted on this myself and I do not think the TGroupDestroyed is working for vehicles, trains and moving ground units, TGroupDestroyed is only working for air groups TGroundDestroyed is workiing for static units. So you can destroy static objects but the TGroupDestroyed does not seem to be triggering for gound units like 0_Chief only air groups. or prove me wrong???? see script here http://forum.1cpublishing.eu/showthread.php?t=30069 |
No it works for Groundgroups also.
Ok it not work for trains :/ but you can use OnActorDead as a Workaround: example: Code:
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages) Server: missionNumber: 0, shortName: 0_Chief3, Type: bob:Wagon.14T_Tank Server: missionNumber: 0, shortName: 0_Chief4, Type: bob:Wagon.10T_Cattle Server: missionNumber: 0, shortName: 0_Chief5, Type: bob:Wagon.10T_Cattle Server: missionNumber: 0, shortName: 0_Chief1, Type: bob:Wagon.C_Class_0-6-0_tender Server: missionNumber: 0, shortName: 0_Chief2, Type: bob:Wagon.14T_Tank Server: missionNumber: 0, shortName: 0_Chief0, Type: bob:Wagon.C_Class_0-6-0 Server: missionNumber: 0, shortName: 0_Chief11, Type: bob:Wagon.12T_CoveredGoods_SR Server: missionNumber: 0, shortName: 0_Chief10, Type: bob:Wagon.10T_Cattle Server: missionNumber: 0, shortName: 0_Chief7, Type: bob:Wagon.12T_CoveredGoods_SR Server: missionNumber: 0, shortName: 0_Chief6, Type: bob:Wagon.13T_5Plank_OpenGoods So you can count how many Wagon are destroyed and if enough you can show a Message etc. btw i found this in my log.txt 447] ERROR [VEHICLE] 0_Chief1 : Die by collision with crater [447] ERROR [VEHICLE] 0_Chief2 : Die by collision with crater [447] ERROR [VEHICLE] 0_Chief3 : Die by collision with crater [447] ERROR [VEHICLE] 0_Chief4 : Die by collision with crater [447] ERROR [VEHICLE] 0_Chief5 : Die by collision with crater [449] ERROR [VEHICLE] 0_Chief0 : Die by collision with crater [449] ERROR [VEHICLE] 0_Chief1 : Die by collision with crater [449] ERROR [VEHICLE] 0_Chief2 : Die by collision with crater [449] ERROR [VEHICLE] 0_Chief3 : Die by collision with crater [449] ERROR [VEHICLE] 0_Chief4 : Die by collision with crater [629] ERROR [VEHICLE] 0_Chief5 : Die by collision with crater [629] ERROR [VEHICLE] 0_Chief1 : Die by collision with crater [629] ERROR [VEHICLE] 0_Chief2 : Die by collision with crater [631] ERROR [VEHICLE] 0_Chief0 : Die by collision with crater May be this blocked the activation of the trigger? |
Thanks FG28_Kodiak,
I thought about OnActorDead as possible work around. Yes when I destroy the train I get the ERROR [VEHICLE]..... also and I think that is the reason the trigger is not working. Have you tried swapping the train for a moving Vehicle or Column? You will notice the trigger still does not work. But unlike the train you will not get the ERROR message. I think it is an issue with moving vehicles/trains. Thanks for the above code. I will give it a shot. I think this is a bug for Dev team to fix. |
Have tried some ingame columns and custom columns also. Ive got always a trigger (TGroupDestroyed 50%)
used this mission Code:
[PARTS] Code:
using System; |
All times are GMT. The time now is 01:56 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.