![]() |
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 |
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. |
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.
|
All times are GMT. The time now is 02:49 AM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.