Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 07-24-2012, 06:38 AM
hc_wolf hc_wolf is offline
Approved Member
 
Join Date: Jul 2010
Posts: 439
Default

Quote:
Originally Posted by FG28_Kodiak View Post
1) they stay destroyed

2) Radars are no GroundActors they are static objects so you must use the new OnStationaryKilled (works since the latest beta patch)
Code:
    /*------------------Remove Static stationary Ground method---------------*/


    Dictionary<AiGroundActorType, int> PointsforGroundTargets = new Dictionary<AiGroundActorType, int>()
    {
        {AiGroundActorType.Radar, 12},
     };


    /*------------------Remove AIGround method---------------*/
    private void destroyGroundActor(AiGroundActorType type, int army)
    {
        if (GamePlay.gpGroundGroups(army) != null)
        {
            foreach (AiGroundGroup gg in GamePlay.gpGroundGroups(army))
            {
                if (gg != null && gg.GetItems().GetLength(0) > 0)
                {
                    foreach (AiActor ggActor in gg.GetItems())
                    {
                        if (ggActor != null)
                            if ((ggActor as AiGroundActor) != null && (ggActor as AiGroundActor).Type() == type)
                                (ggActor as AiGroundActor).Destroy();
                                 
                     }
                }
            }
        }
    }

    /*------------------Remove Static stationary Ground method---------------*/
/*-----Below is to remove stationary objects listed in AiGroundActorType list----------*/

    public override void OnStationaryKilled(GroundStationary _stationary, AiDamageInitiator initiator, int eventArgInt)
    {
        base.OnStationaryKilled(_stationary, initiator, eventArgInt);

            if (GamePlay.gpGroundStationarys() != null)
        {
            foreach (GroundStationary gg in GamePlay.gpGroundStationarys())
            {
                if (gg != null && gg.GetItems().GetLength(0) > 0)
                {
                    foreach (AiActor ggActor in gg.GetItems())
                    {
                        if (ggActor != null)
                            if ((ggActor as OnstationaryKilled) != null && (ggActor as AiGroundActor).Type() == type)
                                (ggActor as _stationary.Destroy).Destroy();
                     }
                }
            }
        }
    }
thanks Kodiak. For the coed. I am having trouble making it work.
The end objective is that if the Radar is bombed and destroyed I want it to "despawn" The AiGroundActorType is "Radar", but in the _stationary there is no list for Radar.

(_stationary = AiGroundActorType.Radar);


Any clue on how I integrate the _Stationary Kill into the get rid of destroyed objects like the Radar?
__________________
__________________
Win7, 64bit Ultra
Asus P8P67Pro MB
Intel i7-2600K
Coursair 16GB (4x 4GB), DDR3-1600MHz
Gainward Nvidia 580GTX 3GB DDR5
850-Watt Modular Power Supply
WIN7 and COD on Gskill SSD 240GB
40" Panasonic LCD
TrackIR5 +
Thrustmaster Warthog stick, throttle & pedals

Last edited by hc_wolf; 07-26-2012 at 05:35 AM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:25 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.