![]() |
|
#1
|
|||
|
|||
![]()
This is probably very obvious, but I just can't seem to crack it. I'm trying to get the actor type when the actor is destroyed ie ship, car, plane etc. here's what I tried
code removed by author
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash. Get the latest COD Team Fusion patch info HERE Last edited by salmo; 10-18-2012 at 09:24 AM. |
#2
|
|||
|
|||
![]()
If you want to observer the individual ground actors use this:
Code:
public override void OnActorDestroyed(int missionNumber, string shortName, maddox.game.world.AiActor actor) { if (actor is AiGroundActor) { AiGroundActor groundActor = actor as AiGroundActor; if (groundActor.Type() == AiGroundActorType.ShipTransport /* || groundActor.Type() == AiGroundActorType.ShipDestroyer || ... */) { GamePlay.gpHUDLogCenter("Ship destroyed"); } } } Code:
public override void OnActorDestroyed(int missionNumber, string shortName, maddox.game.world.AiActor actor) { if (actor is AiGroundGroup) { AiGroundGroup groundGroup = actor as AiGroundGroup; if (groundGroup.GroupType() == AiGroundGroupType.Ship) { GamePlay.gpHUDLogCenter("Ship destroyed"); } } } |
#4
|
|||
|
|||
![]()
Something like this:
Code:
if (actor != null) { if (actor is AiAirGroup) { var airgrp = (AiAirGroup)actor; // processing air group } else if (actor is AiAircraft) { var aircft = (AiAircaft)actor; // processing aircraft } else { LogMessage("Destroyed unknown actor type: {0}", actor.GetType().Name); } } Real problem for me, is in ActorDead handler, to separate between actor killed / disapeared events. Has someone solution? ![]() |
#5
|
|||
|
|||
![]()
here comes pupo ressutecting the dead again.
As anyoen foudn a solution for what Octocat was asking? i need to creat an exception for the actor destroyd, so that planes who are reflown dont count as destroyed. |
#6
|
|||
|
|||
![]()
All disapearing Actors are registered in
OnActorDestroyed(..) If this was the Question. |
![]() |
|
|