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

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2012, 04:33 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

Add all Values in the damagerlist together, then you have the 100%. Then divide
part damagerscore / 100% Value = Percent
Reply With Quote
  #2  
Old 10-11-2012, 04:57 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Quote:
Originally Posted by FG28_Kodiak View Post
Add all Values in the damagerlist together, then you have the 100%. Then divide
part damagerscore / 100% Value = Percent
Thanks Kodiak. I must be doing something wrong then. I have the following code which return values like "DamagerScore Total: 47.7" or "DamagerScore Total: 76.39999" or "DamagerScore Total: 53.3".Ideas?

Code removed by author
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE

Last edited by salmo; 10-18-2012 at 09:08 AM.
Reply With Quote
  #3  
Old 10-11-2012, 05:24 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

No nothing wrong, after this you have the 100% Value.

Example
4 damagersscores (12, 1, 16, 5)
12 + 1 + 16 + 5 = 34

to get the percentual part of a single damager
12/34 = 0,353 (35,3%)
1/34 = 0,029 (2,9%)
16/34 = 0,471 (47,1%)
5/34 = 0,147 (14,7%)
controll:
0,353 + 0,029 + 0,471 + 0,147 = 1

So Damager 1 has made 35,3% of the damage, Damager 3 has done the most with 47,1%.
Reply With Quote
  #4  
Old 10-11-2012, 05:34 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

Agh! Got it now So does the raw sum total damages give any indication of relative "strength" between actors then. ie.

Actor 1 dies .... total damages = 10
Actor 2 dies .... total dmaages = 100

Actor1 is 1/10 as strong as actor 2?
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE
Reply With Quote
  #5  
Old 10-11-2012, 05:50 AM
FG28_Kodiak FG28_Kodiak is offline
Approved Member
 
Join Date: Dec 2009
Location: Swabia->Bavaria->Germany
Posts: 884
Default

no it's depend on the damager hits

from Battle Script / strategy.dll AddScoreToInitiator(AiActor actor, AiDamageInitiator initiator, double score):
Code:
        public int AddScoreToInitiator(AiActor actor, AiDamageInitiator initiator, double score)
        {
            DamagerScore item = new DamagerScore(initiator, score, base.Time.current());
            int index = this.damList.victim.IndexOf(actor);
            if (index >= 0)
            {
                List<DamagerScore> list = this.damList.damagers[index];
                int num2 = list.IndexOf(item);
                if (num2 >= 0)
                {
                    DamagerScore local1 = list[num2];
                    local1.score += score;
                    list[num2].time = base.Time.current();
                    return index;
                }
                list.Insert(0, item);
                return index;
            }
            this.damList.victim.Insert(0, actor);
            List<DamagerScore> list2 = new List<DamagerScore> {
                item
            };
            this.damList.damagers.Insert(0, list2);
            return 0;
        }




        public override void OnActorDamaged(int missionNumber, string shortName, AiActor actor, AiDamageInitiator initiator, NamedDamageTypes damageType)
        {
            switch (damageType)
            {
                case NamedDamageTypes.ChunkSmallDamage:
                case NamedDamageTypes.PartSmallDamage:
                case NamedDamageTypes.WeaponSmallDamage:
                case NamedDamageTypes.EngineSmallDamage:
                case NamedDamageTypes.LifeKeeperPartSmallDamage:
                    this.AddScoreToInitiator(actor, initiator, 0.1);
                    break;

                case NamedDamageTypes.ChunkLargeDamage:
                case NamedDamageTypes.PartLargeDamage:
                case NamedDamageTypes.WeaponLargeDamage:
                case NamedDamageTypes.EngineLargeDamage:
                case NamedDamageTypes.LifeKeeperPartLargeDamage:
                    this.AddScoreToInitiator(actor, initiator, 0.2);
                    break;
            }
            foreach (AMission mission in base.missions)
            {
                if (mission.IsMissionListener(missionNumber))
                {
                    mission.OnActorDamaged(missionNumber, shortName, actor, initiator, damageType);
                }
            }
        }


        public override void OnActorDead(int missionNumber, string shortName, AiActor actor, AiDamageInitiator initiator)
        {
            if ((base.GamePlay.gpPlayer().Place() == actor) && base.GamePlay.gpIsServerSingle())
            {
                base.GamePlay.gpHUDLogCenter("Press Esc to end mission.");
            }
            if (actor is AiPerson)
            {
                initiator = null;
            }
            int index = -1;
            if (initiator != null)
            {
                index = this.AddScoreToInitiator(actor, initiator, 0.5);
            }
            else
            {
                index = this.damList.victim.IndexOf(actor);
            }
            List<DamagerScore> damages = null;
            if (index >= 0)
            {
                damages = this.damList.damagers[index];
            }
            else
            {
                damages = new List<DamagerScore>();
            }
            foreach (AMission mission in base.missions)
            {
                if (mission.IsMissionListener(missionNumber))
                {
                    mission.OnActorDead(missionNumber, shortName, actor, damages);
                }
            }
            this.LogServer_ActorDead(missionNumber, shortName, actor, initiator);
        }

        public override void OnAircraftDamaged(int missionNumber, string shortName, AiAircraft aircraft, AiDamageInitiator initiator, NamedDamageTypes damageType)
        {
            base.OnAircraftDamaged(missionNumber, shortName, aircraft, initiator, damageType);
            this.AddScoreToInitiator(aircraft, initiator, 0.1);
        }


        public override void OnAircraftLimbDamaged(int missionNumber, string shortName, AiAircraft aircraft, AiLimbDamage limbDamage)
        {
            base.OnAircraftLimbDamaged(missionNumber, shortName, aircraft, limbDamage);
            this.AddScoreToInitiator(aircraft, limbDamage.Initiator, 0.2);
        }


        public override void OnPersonHealth(AiPerson person, AiDamageInitiator initiator, float deltaHealth)
        {
            this.AddScoreToInitiator(person, initiator, ((double) deltaHealth) / 255.0);
            base.OnPersonHealth(person, initiator, deltaHealth);
        }

Last edited by FG28_Kodiak; 10-11-2012 at 06:03 AM.
Reply With Quote
  #6  
Old 10-11-2012, 06:08 AM
salmo salmo is offline
Approved Member
 
Join Date: Mar 2011
Posts: 632
Default

OK. Thanks, Got the points allocation to work now. Much appreciated.
__________________
When one engine fails on a two engine bomber, you will always have enough power left to get to the scene of the crash.

Get the latest COD Team Fusion patch info HERE
Reply With Quote
Reply

Thread Tools
Display Modes

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 12:12 PM.


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