![]() |
Getting the actor type?
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 |
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) Code:
public override void OnActorDestroyed(int missionNumber, string shortName, maddox.game.world.AiActor actor) |
Thanks Banks :)
|
Something like this:
Code:
if (actor != null) Real problem for me, is in ActorDead handler, to separate between actor killed / disapeared events. Has someone solution? :cool: |
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. |
All disapearing Actors are registered in
OnActorDestroyed(..) If this was the Question. |
No kodiak.
in my code i give points to teams on a plane his destroyed. yet the game also uses destroy to get rid of planes. so if i refly, the plane i refly gets caught by onactordestryed, and a kill is given to the enemy. is there a way to avoid this? |
You can use two events:
Code:
public override void OnAircraftKilled(int missionNumber, string shortName, AiAircraft aircraft) Code:
public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages) OnActorDead is called later after a plane is hitting the ground or a GroundActor or AiPerson or AiGroup (a Ships is an AiGroup) is killed. And you can check the damagers. OnActorDestroyed is called every time a Actor is removed from the game, so its also called if a script removed a empty plane. So you should use OnAircraftKilled or OnActorDead. |
Quote:
Also, since you are here ( :P ), im havign were a damaged plane, when landed is not destroyed. code here Quote:
|
You would like to destoy a plane only if a player is present in that plane?
|
All times are GMT. The time now is 11:10 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.