#1
|
|||
|
|||
Destroy (delete) earlier spawned actor
I have a problem that I'm hoping some fresh brains can offer a solution for. The pseudocode is as follows:
a. When an AiAircraft actor is created I want to test to see if there is a previous version of the same actor (aircraft). b. If a previous (ealier spawned) version exists, then I want to delete (remove) the earlier AiAircraft from the battle. Options: 1. I tried using actor.tag to hold the spawn time of the actor but this keeps throwing null errors after deleting actors. 2. Log spawning times of actors? Clunky? 3. get mission number of an actor & look for lower mission number? 4. other methods? Below some non-working code: 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:23 AM. |
#2
|
|||
|
|||
My initial thought is that there is no association between the about to spawn aircraft and old aircraft even though they possibly are the same type.
Many solutions probably. I'd attempt, Store the onactorcreated mission number, shortname and actor to a list, then test the list against play for true/false if they are alive or landed and then if alive destroy. You are trying to test the about to spawn against those ingame, they are different so always false. Also if you have a list, you could look for how many left and spawn in replacements of the missing or landed. Last edited by Smokeynz; 08-13-2012 at 03:00 AM. |
#3
|
|||
|
|||
oh with the list you would probably need to add a spawn number or name to associate it with a specific trigger event, what ever it is.
|
|
|