Results 1 to 13 of 13

Thread: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

  1. #1
    Team Fusion Salmo's Avatar
    Join Date
    Nov 2011
    Posts
    2,332
    Post Thanks / Like
    Total Downloaded
    191.25 MB

    How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    The maddox.game.world.Strategy.DamagerList object is exposed when an aircraft is "dead" via the OnActorKilled method. Is there some way to expose the maddox.game.world.Strategy.DamagerList for an aircraft that has crash-landed ?

  2. Likes Tibsun liked this post
  3. #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: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Salmo, given you've had access to the source code for almost a year, aren't you the one to answer that??

    There's at least two ways I can think of though although I think there was a bug introduced into 4.5 regarding the Oncrashlanded event IIRC raised by someone else.

  4. Likes N/A liked this post
    Dislikes ATAG_((dB)), PanTast disliked this post
  5. #3
    Team Fusion Salmo's Avatar
    Join Date
    Nov 2011
    Posts
    2,332
    Post Thanks / Like
    Total Downloaded
    191.25 MB

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Thank you for your helpful response that assisted me to find a solution.
    Last edited by Salmo; Feb-18-2018 at 22:29.

  6. Likes ATAG_Highseas, SoW Reddog liked this post
  7. #4
    Ace
    Join Date
    May 2013
    Location
    Stamford, Lincs, UK
    Posts
    1,033
    Post Thanks / Like
    Blog Entries
    8
    Total Downloaded
    7.46 MB

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Quote Originally Posted by Salmo View Post
    Thank you for your helpful response that assisted me to find a solution.
    No problems Salmo. Any time.

    I'd hate for anyone to think I was unhelpful, that would be awkward and might lead to people calling me nasty names behind my back and I wouldn't want that, no siree..

    In that vein, the two options I was thinking of are:

    1) Kill the aircraft via the "normal" despawn methodology, thereby accessing it via the OnActorKilled event per your own post.

    2) Edit the strategy dll, change damagerlist from being private, or clone it, and do what you want with it based on the aircraft key. Or indeed, replicate it's methodology within the mission file with calls from the various OnDamaged Events.

    The key issue here is that OnAircraftCrashLanded does not appear to be working post the patches, as reported by others. Of course I don't know this for certain as I haven't really played with the scripting side of things since making SoW 4.5 compatible. Without the ability to fire an event when a crash landing occurs then you're jiggered I feel.

    I am surprised that with access to the SC within TF (not necessarily you personally, I don't know who has and hasn't got access and that wasn't what my original post meant) that you're asking this openly. Perhaps someone with access could point you in the right direction.
    Last edited by SoW Reddog; Feb-19-2018 at 14:16.

  8. #5
    Ace Cassius's Avatar
    Join Date
    Dec 2011
    Posts
    2,659
    Post Thanks / Like
    Total Downloaded
    424.49 MB

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    I am far from all this, but reading this from the outside it seems that access to the source code has only one person and he is very busy, as usual.

  9. #6
    Spindinio
    Guest

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Salmo, can I just ask if this thread is in aid of a solution to the bug raised by ACG on the 2 events no longer firing? Much appreciated if so because it is a showstopper for us, we can't run our campaigns without this hook.

  10. #7
    Spindinio
    Guest

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Here. This is a showstopper for ACG in Cliffs as a platform. https://tfbt.nuvturais.de/issues/1052

  11. #8
    Team Fusion ♣_Spiritus_♣'s Avatar
    Join Date
    Dec 2013
    Location
    The Demon-Haunted World: Science as a Candle in the Dark
    Posts
    5,600
    Post Thanks / Like
    Blog Entries
    2
    Total Downloaded
    0

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Yes I believe so Spin. I'm on my phone at the moment so can't check the bugtracker but if I remember right it's #1052 or something like that. We are trying to track the issue down.

    Edit: From your second post I see it is 1052.

  12. #9
    Team Fusion Salmo's Avatar
    Join Date
    Nov 2011
    Posts
    2,332
    Post Thanks / Like
    Total Downloaded
    191.25 MB

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Quote Originally Posted by Spindinio View Post
    Salmo, can I just ask if this thread is in aid of a solution to the bug raised by ACG on the 2 events no longer firing? Much appreciated if so because it is a showstopper for us, we can't run our campaigns without this hook.
    This thread is related to my own scripting for a new mission. Nothing to do with the 2 events not firing bug. TFS is aware that the bug is causing campaign failures on squadrons servers, & is actively working to try to find why these methods no longer fire events & fix the problem.

  13. Likes Cassius liked this post
  14. #10
    Spindinio
    Guest

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    OK great that is good to know.

  15. #11
    Novice Pilot
    Join Date
    Jul 2013
    Posts
    50
    Post Thanks / Like
    Blog Entries
    2
    Total Downloaded
    78.01 MB

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Its just a guess but I would just copy over logics from:

    Code:
    public virtual void LogServer_AircraftDead(int missionNumber, string shortName, AiAircraft aircraft)
            {
                ArrayList damageInitiators = this.GetDamageInitiators((AiActor)aircraft);
                Dictionary<DamagerScore, object> dictionary = new Dictionary<DamagerScore, object>();
                List<AiDamageInitiator> list = new List<AiDamageInitiator>();
                bool? nullable1 = new bool?();
                for (int index = 0; index < damageInitiators.Count; ++index)
                {
                    DamagerScore key = damageInitiators[index] as DamagerScore;
                    if (!dictionary.ContainsKey(key) && key.initiator.Actor != null)
                    {
                        bool? nullable2 = nullable1;
                        if ((!nullable2.GetValueOrDefault() ? 1 : (!nullable2.HasValue ? 1 : 0)) != 0 && key.initiator.Actor != aircraft)
                            nullable1 = new bool?(key.initiator.Actor.Army() != aircraft.Army());
                        dictionary.Add(key, (object)null);
                        list.Add(key.initiator);
                    }
                }
                if (aircraft.IsAirborne())
                {
                    if (!nullable1.HasValue)
                    {
                        switch (Strategy.LogServerRnd.nextInt(0, 2))
                        {
                            case 0:
                                this.GamePlay.gpLogServerBegin((Player[])null, "{0} crashed.");
                                break;
                            case 1:
                                this.GamePlay.gpLogServerBegin((Player[])null, "{0} is no more.");
                                break;
                            case 2:
                                this.GamePlay.gpLogServerBegin((Player[])null, "{0} collided with terrain.");
                                break;
                        }
                    }
                    else
                    {
                        bool? nullable2 = nullable1;
                        if ((nullable2.GetValueOrDefault() ? 0 : (nullable2.HasValue ? 1 : 0)) != 0)
                        {
                            switch (Strategy.LogServerRnd.nextInt(0, 2))
                            {
                                case 0:
                                    this.GamePlay.gpLogServerBegin((Player[])null, "{1} claimed a friendly kill: {0}.");
                                    break;
                                case 1:
                                    this.GamePlay.gpLogServerBegin((Player[])null, "Friendly fire! {1} destroyed {0}.");
                                    break;
                                case 2:
                                    this.GamePlay.gpLogServerBegin((Player[])null, "{1} destroyed a friendly {0}.");
                                    break;
                            }
                        }
                        else
                        {
                            bool? nullable3 = nullable1;
                            if ((!nullable3.GetValueOrDefault() ? 0 : (nullable3.HasValue ? 1 : 0)) != 0)
                            {
                                switch (Strategy.LogServerRnd.nextInt(0, 4))
                                {
                                    case 0:
                                        this.GamePlay.gpLogServerBegin((Player[])null, "{1} shot down {0}.");
                                        break;
                                    case 1:
                                        this.GamePlay.gpLogServerBegin((Player[])null, "{1} destroyed {0}.");
                                        break;
                                    case 2:
                                        this.GamePlay.gpLogServerBegin((Player[])null, "{1} claimed {0}.");
                                        break;
                                    case 3:
                                        this.GamePlay.gpLogServerBegin((Player[])null, "{0} was destroyed by {1}.");
                                        break;
                                    case 4:
                                        this.GamePlay.gpLogServerBegin((Player[])null, "{0} was shot down by {1}.");
                                        break;
                                }
                            }
                        }
                    }
                }
                else if (!nullable1.HasValue)
                {
                    if (Strategy.LogServerRnd.nextInt(0, 0) == 0)
                        this.GamePlay.gpLogServerBegin((Player[])null, "{0} crashed.");
                }
                else
                {
                    switch (Strategy.LogServerRnd.nextInt(0, 1))
                    {
                        case 0:
                            this.GamePlay.gpLogServerBegin((Player[])null, "{1} destroyed {0} on the ground.");
                            break;
                        case 1:
                            this.GamePlay.gpLogServerBegin((Player[])null, "{0} was blown up by {1} before he could take off.");
                            break;
                    }
                }
                this.LogServer_VictimArg(true, aircraft, aircraft.Player(aircraft.Carter()));
                if (nullable1.HasValue)
                    this.LogServer_InitiatorsArg(list);
                this.GamePlay.gpLogServerEnd();
            }
    under :

    Code:
    public virtual void LogServer_AircraftCrashLanded(int missionNumber, string shortName, AiAircraft aircraft)
            {
                Player player = aircraft.Player(aircraft.Carter());
                if (player == null)
                    return;
                this.GamePlay.gpLogServer((Player[])null, "{0} crash landed.", new object[1]
                {
            (object) player
                });
            }

    Following logic flow it should work....

  16. Likes MezzA liked this post
  17. #12
    Spindinio
    Guest

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    Thanks that's interesting. I'll point our guys at that.

    ~S~

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

    Re: How to get maddox.game.world.Strategy.DamagerList for crash-landed aircraft ?

    So Salmo, was my post any use? Enquiring minds and all that.

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
  •