Results 1 to 11 of 11

Thread: Need Help - counting kills for each pilot on server

  1. #1
    Novice Pilot
    Join Date
    Feb 2013
    Posts
    50
    Post Thanks / Like
    Total Downloaded
    0

    Need Help - counting kills for each pilot on server

    Hello gents!

    i've pretty much finished a mission that i will launch the 30 of may. the only thing that is not working that would be nice to have working for this mission is giving kills to pilots. the mission can easely keep track of kills for the entire team, but everyone likes to check out how many did they got at the end of the mission.

    this is what i have for that particular scenario

    public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
    {
    base.OnActorDead(missionNumber, shortName, actor, damages);
    if (actor is AiAircraft)

    {
    foreach (DamagerScore ds in damages)

    if (ds.initiator != null)
    {

    if (ds.initiator.Actor != null)
    {

    foreach (pilotstat pd in pilotlist) // pilotstat is a list, snafu created and i stole it ,
    {

    string message = "ds: " + ds.initiator.Actor + "\t" + pd.Pilot + "";
    writelog(message); // this is just a log creator, wich writes down each ds.initator.actor followed by the pilot who its comparing to.

    if (pd.Pilot == ds.initiator.Actor)
    {
    pd.Kills++; // this part of the code is not reached
    GamePlay.gpHUDLogCenter("ola!");
    }
    }
    }
    }
    }
    the log result of the following is

    [2013_05_19_20_29_50] ds: bHrtSeS5ue7OJcbn.QNZcpr86RVM 2E76W4XSdm.CuIiei6YyY9lagOd3Tq
    [2013_05_19_20_29_50] ds: bHrtSeS5ue7OJcbn.QNZcpr86RVM 2E76W4XSdm.CuIiei6YyY9lagOd3Tq
    meaning there are 2 Ds.initators, both "bHrtSeS5ue7OJcbn.QNZcpr86RVM", none is actually me, who is given the name "2E76W4XSdm.CuIiei6YyY9lagOd3Tq"
    Ive noticed that every time i run this test, even when the kill is AI, the DS initiator is always "bHrtSeS5ue7OJcbn.QNZcpr86RVM". I suspect this DS.initiator is the ground, since all planes eventually crash.

    so, any tips how to get this working?

    cheers

  2. #2
    Banned
    Join Date
    Dec 2011
    Posts
    850
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    Wild Willie's ClodCommander should do this for you, runs on the server and uses a database.

    http://forum.1cpublishing.eu/showthread.php?t=30853

    Never set it up myself though so I can't tell you how it works

  3. #3
    Novice Pilot
    Join Date
    Feb 2013
    Posts
    50
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    thats not what im looking for osprey, i want the script to the math on the inside without adding another program into it.

    Tough this CLOD commander thingy might come in handy if i ever decide to set a server myself.

  4. #4
    Novice Pilot
    Join Date
    Dec 2012
    Location
    spain
    Posts
    97
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    I use cod comander on my server, but whit last TFpach no work.

  5. #5
    Novice Pilot
    Join Date
    Feb 2013
    Posts
    50
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    well solved it!

    where i had

    if (pd.Pilot == ds.initiator.Actor)

    now i have

    if (pd.Pilot == ds.initiator.Player)

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

    Re: Need Help - counting kills for each pilot on server

    Quote Originally Posted by E69_pupo View Post
    Hello gents!

    i've pretty much finished a mission that i will launch the 30 of may. the only thing that is not working that would be nice to have working for this mission is giving kills to pilots. the mission can easely keep track of kills for the entire team, but everyone likes to check out how many did they got at the end of the mission.

    this is what i have for that particular scenario



    the log result of the following is



    meaning there are 2 Ds.initators, both "bHrtSeS5ue7OJcbn.QNZcpr86RVM", none is actually me, who is given the name "2E76W4XSdm.CuIiei6YyY9lagOd3Tq"
    Ive noticed that every time i run this test, even when the kill is AI, the DS initiator is always "bHrtSeS5ue7OJcbn.QNZcpr86RVM". I suspect this DS.initiator is the ground, since all planes eventually crash.

    so, any tips how to get this working?

    cheers
    Not sure exactly what pilotlist is holding, but it looks like you might have missed placing a { after the foreach (DamagerScore ds in damages) line. You could try the revised code below & see if it works.

    Code:
        public override void OnActorDead(int missionNumber, string shortName, AiActor actor, List<DamagerScore> damages)
        {
            base.OnActorDead(missionNumber, shortName, actor, damages);
    
            if (actor is AiAircraft)
            {
                foreach (DamagerScore ds in damages)
                {
                    if (ds.initiator != null && ds.initiator.Actor != null)
                    {
                        foreach (pilotstat pd in pilotlist) // pilotstat is a list, snafu created and i stole it ,
                        {
                            string message = "ds: " + ds.initiator.Actor + "\t" + pd.Pilot + "";
                            writelog(message); // this is just a log creator, wich writes down each ds.initator.actor followed by the pilot who its comparing to.
    
                            if (pd.Pilot == ds.initiator.Actor)
                            {
                                pd.Kills++; // this part of the code is not reached
                                GamePlay.gpHUDLogCenter("ola!");
                            }
                        }
                    }
                }
            }
        }
    Last edited by Salmo; May-20-2013 at 18:23.

  7. #7
    Novice Pilot
    Join Date
    Feb 2013
    Posts
    50
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    thanks Salmo. it was not a sintax error i nth ecode, i simply screwed the copy paste, since the actual code has about 100+ lines for actoractordead.

    the problem was i was going trough the initiator.actor, and not initiator.player. hope this is usefull for those who come searching for the same issue

  8. #8
    Banned
    Join Date
    Dec 2011
    Posts
    850
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    Quote Originally Posted by SG1_sandokito View Post
    I use cod comander on my server, but whit last TFpach no work.

    It does work, read this:

    http://forum.1cpublishing.eu/showthread.php?t=28017

  9. #9
    Novice Pilot
    Join Date
    Dec 2012
    Location
    spain
    Posts
    97
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    THX for link osprey, But no solvend the cuestion to my.

    I not a programer and they not say how to solved the problem

  10. #10
    Banned
    Join Date
    Dec 2011
    Posts
    850
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    I don't think it's a programming thing, I think it's because the updated TF patch changes the working directory to "<path>\<foldername> - mod" so Clod commander can't find it anymore. It's a configuration problem. I don't know for sure, I've never set it up myself.

  11. #11
    Student Pilot
    Join Date
    Jul 2011
    Posts
    7
    Post Thanks / Like
    Total Downloaded
    0

    Re: Need Help - counting kills for each pilot on server

    Clodcommander needs to be rebuilt to make it work with latest tf mod, there is an issuse with folder name which contain "-". if any of You need a copy of it let me onow, I will send updated version to You, just send me pm.

    5./JG27 Vogler

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
  •