Results 1 to 5 of 5

Thread: OnBuildingKilled

  1. #1
    Ace No.401_Wolverine's Avatar
    Join Date
    Jan 2012
    Posts
    767
    Post Thanks / Like
    Total Downloaded
    974.2 KB

    OnBuildingKilled

    So, I'll put this out there. If anyone has the solution, please let me know:

    This code:

    Code:
    public override void OnBuildingKilled(string title, Point3d pos, AiDamageInitiator initiator, int eventArgInt)
        {
            base.OnBuildingKilled(title, pos, initiator, eventArgInt);
    
            string BuildingName = title;
            string BuildingArmy = "";
            string PlayerArmy = "";
            string sectorTitle = "";
            string sectorName = GamePlay.gpSectorName(pos.x, pos.y);
    
            if (GamePlay.gpFrontArmy(pos.x, pos.y) == 1)
            {
                BuildingArmy = "England";
            }
            else if (GamePlay.gpFrontArmy(pos.x, pos.y) == 2)
            {
                BuildingArmy = "France";
            }
            else
            {
                BuildingArmy = "Neutral";
            }
    
            if (initiator.Player.Army() == 1)
            {
                PlayerArmy = "RAF";
            }
            else if (initiator.Player.Army() == 2)
            {
                PlayerArmy = "Luftwaffe";
            }
            else
            {
                PlayerArmy = "Unknown";
            }
    
            GamePlay.gpLogServer(null, "BUILDING:" + BuildingName + " in " + BuildingArmy + " was destroyed in sector " + sectorName + " by " + initiator.Player.Name() + " from the " + PlayerArmy + ".", new object[] { });
        }
    ...is designed to put up a little message when anyone destroys a building on the map. Any building at all. Not just buildings placed in the FMB, but buildings on the base maps as well.

    When added to a Single Player map, it works perfectly.

    When added to a Multi Player map, it works...only for the person hosting the server.

    When added to a dedicated server, it doesn't work for anyone.

    Ideas? It might be that I'm missing something that I'm just not aware of.

  2. #2
    Ace
    Join Date
    May 2013
    Location
    Stamford, Lincs, UK
    Posts
    1,033
    Post Thanks / Like
    Blog Entries
    8
    Total Downloaded
    7.46 MB

    Re: OnBuildingKilled

    All I can tell you is that I have a debug log from SoW missions, and in there I output when OnBuildingKilled is called. And it regularly gets debugged. However, I don't think it works for buildings added to the mission reliably. We did some testing and some worked, and others, not so much which is why I had to rewrite a load of our objective code to ignore buildings.

  3. #3
    Ace No.401_Wolverine's Avatar
    Join Date
    Jan 2012
    Posts
    767
    Post Thanks / Like
    Total Downloaded
    974.2 KB

    Re: OnBuildingKilled

    Raising this question from the dead to see if any of the new blood has any answer. This is something of a holy grail for me.

  4. #4
    Ace Mysticpuma's Avatar
    Join Date
    Dec 2012
    Location
    Worcestershire, UK
    Posts
    5,132
    Post Thanks / Like
    Blog Entries
    1
    Total Downloaded
    2.38 GB

    Re: OnBuildingKilled

    I have asked our guys to look into this. No promises, I have asked though. Cheers, MP
    "The needs of the Flight Sim Community outweigh the needs of the one or the few"

  5. #5
    Ace No.401_Wolverine's Avatar
    Join Date
    Jan 2012
    Posts
    767
    Post Thanks / Like
    Total Downloaded
    974.2 KB

    Re: OnBuildingKilled

    Thanks MP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •