View Single Post
  #6  
Old 07-26-2012, 07:24 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

The stationary object don't use an enumerator (AiGroundActorType), they return strings,
you can get
Title = Name of the static;
Category = vehicle, aircraft etc. can be empty. Radars are empty.
Type = Radar etc.
i've not tested all possible values at the moment. Integrate this into the OnStationaryKilled to get the values by yourself.
Code:
GamePlay.gpLogServer(null, "OnStationaryKilled: Title: {0}; Category: {1}; Type: {2}", new object[]{_stationary.Title, _stationary.Category, _stationary.Type});
Example to remove all radars around 1000m from position a stationary was killed
Code:
    public override void OnStationaryKilled(GroundStationary _stationary, AiDamageInitiator initiator, int eventArgInt)
    {
        base.OnStationaryKilled(_stationary, initiator, eventArgInt);


        GamePlay.gpLogServer(null, "OnStationaryKilled: Title: {0}; Category: {1}; Type: {2}", new object[]{_stationary.Title, _stationary.Category, _stationary.Type});

        if (GamePlay.gpGroundStationarys() != null)
        {
            foreach (GroundStationary gg in GamePlay.gpGroundStationarys(_stationary.pos.x, _stationary.pos.y, 1000.0))
            {
                if(_stationary.Type.Equals("Radar"))
                    gg.Destroy();
            }
        }
 
    }

Last edited by FG28_Kodiak; 07-26-2012 at 07:30 AM.
Reply With Quote