![]() |
How to remove Static4 Stationary.Environment objects
Hi all,
this used to work but now it is not. any ideas on how to fix? Below code is in the .mis file that items the stationary objects i want to remove after 58 minutes. Code:
Code:
using System; |
Stationaries are not Actors!
You can use Code:
public static void RemoveStaticAt(double xPos, double yPos, double radius) GamePlay.gpGroundStationarys(double x, double y, double radius) GamePlay.gpGroundStationarys(string country) GamePlay.gpGroundStationarys(string country, double y, double radius) you get a Array of GroundStationary on a Position with a given radius, additional you can specify a country. Or you can get all Stationaries of a country you specify. |
Sweet. Will test
|
Quote:
|
Quote:
But for this topic I don't to delete in a radius area, I want to delete every object I load in a sub mission. Example, I load a bomber mission, the targets spawn at same time as bomnbers. Then 1 hour later if the bombers did not make it or if they did, all Ground objects that were spawned in on that submission are removed. so maybe I use the below and place it in the sub mission .cs file Code:
|
OK, so if your loading from a sub-mission, I'll presume you know the mission number from which you want all the actor objects deleted. How about this ...
Code remove by author |
Not Actors :rolleyes: Stationaries
So Code:
using System; |
Thanks Salmo, will test tonight. With regards to mission number.. well I can't say it is always mission 3 or mission 12. As the game goes on missions load and count in and the mission number can be mission 256
Anyways I will test that tonight. it is clean and looks like it will do the job. My other way I looked at today was this but have not tested yet. The below code removes all objects loaded in the mission that are from a country. example de Code:
|
salmos code wouldn't work for stationaries he uses AiActor but a GroundStantionary is not an Actor. So it's never registered in OnActorCreated,
|
Wolfie, Kodiak's code is appropriate for groundStationaries. My code is for AiActors & as Kodiak says, won't work for stationaries (I had it for stationaries originally then changed it). You need to decide exactly what you want to do: delete groundstationaries for a given country? or stationaries from a given sub-mission?
In any event you will need to trap the mission number of the mission you want the stationaries deleted from. |
All times are GMT. The time now is 12:01 PM. |
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.