Create an account


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 236
» Latest member: vahoxCinny
» Forum threads: 427
» Forum posts: 1,648

Full Statistics

Online Users
There are currently 5 online users.
» 0 Member(s) | 2 Guest(s)
Bing, Google, Yandex

 
  WWII bomber & fighter pilot story
Posted by: Flug - 02-27-2020, 09:52 PM - Forum: 'The Usual Place' - No Replies

2nd Lt. Brown was alone in his cockpit, the three unharmed men tending to the others. Brown’s B-17 had been attacked by 15 German planes and left for dead, and Brown himself had been knocked out in the assault, regaining consciousness in just enough time to pull the plane out of a near-fatal nose dive.

None of that was as shocking as the German pilot now suddenly to his right.

Brown thought he was hallucinating. He did that thing you see people do in movies: He closed his eyes and shook his head no. He looked, again, out the co-pilot’s window. Again, the lone German was still there, and now it was worse. He’d flown over to Brown’s left and was frantic: pointing, mouthing things that Brown couldn’t begin to comprehend, making these wild gestures, exaggerating his expressions like a cartoon character.

Brown, already in shock, was freshly shot through with fear. What was this guy up to?

He craned his neck and yelled back for his top gunner, screamed at him to get up in his turret and shoot this guy out of the sky. Before Brown’s gunner could squeeze off his first round, the German did something even weirder: He looked Brown in the eye and gave him a salute. Then he peeled away.

What just happened? That question would haunt Brown for more than 40 years, long after he married and left the service and resettled in Miami, long after he had expected the nightmares about the German to stop and just learned to live with them.



Rest of the story at: https://nypost.com/2012/12/09/amazing-ta...lying-ace/

Print this item

  Tracking File Glitch!
Posted by: Dave - 02-26-2020, 08:42 PM - Forum: The Wrecking Ball Theatre - Replies (3)

I have been complaining about this for years!

Ships are not where they are supposed to be in track files!
There location can be off by up to a mile!

Case in point:

I dropped 2-40lbers on the LAST TANKER,
watched it blow up from my rear gunner position,
but the track file shows me dropping into the wide open Thames,
& then the last tanker blows up in the distance...

How can we get this fixed!
(ship attack videos are impossible...)

(Oh, & for SpookSmile


P.S.
IF ANYONE KNOWS HOW TO REWIND A TRACK FILE,
pls tell me...

Print this item

Big Grin campaign questions
Posted by: Birdtail - 02-24-2020, 03:48 PM - Forum: Requests and Bug Reports - Replies (3)

I have bombed Dunkerque radar #2 twice in a row...I was getting damage info after drop but it did not show up in airfield/radar damage report. Is this radar active or out of commission?

I thought that once you set and activate kbien at a set altitude they would maintain that alt to target. Yesterday Lust, Noken and I got jumped just outside of LeCrotoy, we dropped to low level and I saw some Blennies dropping and doing there air show rolls.....don't know if they where mine or not....I believe some of them dropped on target but not sure. All three of us dropped low level and got hits.  We were getting the 1000% plus damage info but this time the target was destroyed.
I will try this dropping down just before target and low level all the way on some airfields and see if I get more bombs on target.....as it is now 5 to 6 Blennies gets you about 30% with a 10 to 12 hour repair time and 5 to 7 fields and area primary targets this is going to be slow going to turn a map.....what I have got to lose.....my life.....happens high or low on a regular basis...... Big Grin

Print this item

  I swatted a hornets nest!
Posted by: Dave - 02-24-2020, 02:51 AM - Forum: The Wrecking Ball Theatre - Replies (4)

I was testing out the TWC Tactical radar plotting website when I saw 10 unidentified blues
at 24K heading SW towards Eastchurch. It was a quiet day, so I spawned a Hurri @ Eastchurch
to investigate, thinking if they were bombers, I could rack up some easy kills for a Spittie.
(actually, I thought they might be Stukas!)

Turned out they were AI 109's in VIC formations.

Fatal only knows how these things are programmed, but they seemed to just be orbiting
Eastchurch. Since I wasted all that time climbing I figured a couple of potshots wouldn't
hurt & I would run for the deck...

Turns out one of the 109's had the same idea, so I followed him down thinking I could 
wound one more on my way. Well, you know what happened next, & if not,
here's a recap video for you:

https://www.youtube.com/watch?v=sp_9l07jUEo

I respawned again at Eastchurch, & was surprised at the sound of Flak.
It seems there was one AI Spit at 2K, & all these 109's were now after it!

I warmed up quick & rose to assist. Of course I was no match for ten mad
hornets, & only vented one before getting my radiator shot up.
Since it was Campaign Server, & I was 1K over the field, I thought the
best option would be to save the plane & tried to land.

Interestingly, all these AI's locked onto me, & started diving on me
two at a time! You can see two colliding, & another two near miss!
I wonder if we can use this behavior to our advantage?

Track files attached if interested.



Attached Files
.trk   022220aClimb to 109s.trk (Size: 12.71 MB / Downloads: 0)
.trk   022220bdefnd eastChurch.trk (Size: 12.16 MB / Downloads: 0)
Print this item

  hello boys
Posted by: ACE - 02-23-2020, 08:16 PM - Forum: Recruitment - Replies (3)

I also have returned to the fold <S>

Print this item

  Can't get location/handle for smoke or fire in IL2 CloD FMB scripting
Posted by: Flug - 02-23-2020, 07:16 PM - Forum: Full Mission Builder - No Replies

So here is an issue I came across in scripting Cliffs of Dover FMB missions.

Generally you can get a list of all ground stationaries using a few simple functions CloD makes available to script writers.

HOWEVER - those lists of ground stationaries do not include a few important items! 

In particular, they don't seem to include smoke or fire objects.

So I can understand how this likely happened--smoke & fire are simply a different type of object than most others.  For example, if you bomb a location you might kill any nearby static object, but you probably wouldn't kill nearby smoke or fire.  

Anyway, this is an issue because for most ground stationary objects, you can place them and then later remove them. 

But with smoke & fire, you can place them--but you can't EVER remove them unless you completely restart the mission.

Anyone who knows a solution to this, I would really appreciate hearing it!

Sample .cs file that lists all ground stationaries of the mission and any submission loaded. If you create a .mis file with various groundstationaries including some smoke and fire, you'll see that everything is listed EXCEPT the smoke and fire:

Code:
using System;
using System.Collections.Generic;
using maddox.GP;
using maddox.game;
using maddox.game.world;



public class Mission : AMission
{

    Dictionary<GroundStationary, int> Stationaries = new Dictionary<GroundStationary, int>();

    public override void OnBattleStarted()
    {
        base.OnBattleStarted();

        MissionNumberListener = -1;
    }


    public override void OnMissionLoaded(int missionNumber)
    {
        base.OnMissionLoaded(missionNumber);

        foreach (GroundStationary stationary in GamePlay.gpGroundStationarys())
        {
            if (!Stationaries.ContainsKey(stationary))
            {
                Stationaries[stationary] = missionNumber;
                Console.WriteLine("Stat: {0} {1} {2} {3}", missionNumber, stationary.Name, stationary.Category, stationary.Title);
            }
        }
    }
}

Example of how to get groundstationaries within a distance of a given point--except not that it will NOT list any smoke or fire groundstationaries!
Code:
GroundStationary[] gs = GamePlay.gpGroundStationarys(250000, 252000, 1000); //Find all groundstationaries within 1000 meters of map coordinate (250000,252000)

Example of how to create and place smoke or fire mid-mission via script:

Code:
public static void loadSmokeOrFire(maddox.game.IGamePlay GamePlay, AMission mission, double x, double y, double z, string type = "BuildingFireBig", double duration_s = 300)
    {
        /* Sample: Static556 Smoke.Environment.Smoke1 nn 63718.50 187780.80 110.00 /height 16.24
         possible types: Smoke1 Smoke2 BuildingFireSmall BuildingFireBig BigSitySmoke_0 BigSitySmoke_1

        */

        ISectionFile f = GamePlay.gpCreateSectionFile();
        string sect = "Stationary";
        string key = "Static1";
        string value = "Smoke.Environment." + type + " nn " + x.ToString("0.00") + " " + y.ToString("0.00") + " " + (duration_s / 60).ToString("0.0") + " /height " + z.ToString("0.00");
        f.add(sect, key, value);

        GamePlay.gpPostMissionLoad(f);

    }

The smoke & fire types listed there are exactly the ones that cannot be found via the groundstationarys() method--as far as I know.

Example of how to create a SectionFile via script, put a static object (groundstationary) in it, and then load it in:

Code:
public static void loadStatic(maddox.game.IGamePlay GamePlay, AMission mission, double x, double y, double z, string type = "Stationary.Opel_Blitz_cargo", double heading = 0, string side = "nn")
    {
        /*  side = nn , gb, or de
         * Examples: https://theairtacticalassaultgroup.com/forum/showthread.php?t=8493          
         */


        ISectionFile f = GamePlay.gpCreateSectionFile();
        string sect = "Stationary";
        string key = "Static1";
        string value = type + " " + side + " " + x.ToString("0.00") + " " + y.ToString("0.00") + " " + heading.ToString("0.0") + " /height " + z.ToString("0.00");
        //Console.WriteLine("Load Static: " + value);
        f.add(sect, key, value);

        GamePlay.gpPostMissionLoad(f);

    }

Examples of what static objects look like in a .mis file--you can load any of these types or dozens of others (discover them using FMB and then looking at the resulting .mis file) using the above routine:

Code:
Static4 Stationary.Environment.Table_empty_UK-GER_1 nn 14334.77 15015.75 661.10
                Static2 Stationary.Scammell_Pioneer_R100 gb 14357.38 15036.04 661.10
                Static7 Stationary.Airfield.Sign_Table_UK1 nn 14295.63 15054.30 661.10
                Static5 Stationary.Environment.Table_w_chess_UK-GER_1 nn 14308.39 15048.51 661.10
                Static6 Stationary.Environment.Table_w_dinner_UK-GER_1 nn 14306.36 15060.39 661.10
                Static3 Stationary.BMW_R71_w_MG_34 de 14325.78 15042.71 661.10  //motorcycle
                Static1 Stationary.Opel_Blitz_cargo de 14321.43 15065.61 661.10
                Static0 Stationary.Horch_830_B1 de 14350.42 15056.62 661.10  
                Static65 Stationary.Humans.Kdo_Hi_Ger35_passenger_4 de 14345.22 15051.82 661.10 2
                Static120 Stationary.Humans.Soldier_Krupp_L2H43_Driver_1 de 14342.67 15055.75 661.10 3
                Static48 Stationary.Humans.Soldier_MG_TA_Passenger_1 de 14341.79 15056.98 661.10 4      
                Static66 Stationary.Humans.Ladder_passenger_ger_1 de 14344.66 15053.11 661.10 5
                Static50 Stationary.Humans.150_cm_Flakscheinwerfer_gunner1 de 14343.99 15055.41 661.10 6
                Static123 Stationary.Humans.Soldier_Krupp_L2H43_pak_Driver_1 de 14344.14 15054.25 661.10 7
                Static119 Stationary.Humans.Soldier_Sdkfz105_Gunner de 14346.02 15052.77 661.10 8
                Static71 Stationary.Humans.Portable_Siren_ger_passenger de 14347.25 15052.80 661.10 9

Print this item

  Creating Birthplaces (spawnpoints) in CloD scripting via code, and various solutions
Posted by: Flug - 02-23-2020, 06:48 PM - Forum: Full Mission Builder - No Replies

In IL2 Cliffs of Dover FMB scripting, it is possible to create a spawnpoint on the fly and load it mid-mission.

A spawn point is thing that makes and airport "active" - ie, so that you can come in at that airport.  You can also create airspawns.  And, you can delete spawnpoints (Birthplaces) making a previously active airport inactive.

However, in making new Birthplaces there are a few nasty tricks and pitfalls.  The ones i know about:

  • First: Apparently, you can't use decimal points in specifying the location.

    So for example #1 is OK but #2 is NOT OK:

    #1:
    Code:
      Amien_rest_39 2 321978 101321 0 1 1 1 . . .

    #2:
    Code:
      Amien_rest_39 2 321978.2 101321.7 0 1 1 1 . . .

    This is odd because decimal points are allowed in specifying every other position in CloD .mis files. But not here!

  • Second: There are pretty tight restrictions on the type of name you can use. Safest is to use a fairly short name, no spaces (use the underline character instead) and no characters other than letters & numbers.  Second safest, you can try included spaces and special characters like , () [] etc, but keep the length of the name to 25 characters.  You will see that if you include spaces in the name, CloD will automatically enclose that name in quotation marks in the .mis file it creates.


Example function usage:

Code:
                ISectionFile f = GamePlay.gpCreateSectionFile();                                string bname = "My_Favorite_Birthplace"; //apparently birthplace names can't be too long? And you might need to be careful of spaces and special characters?               
                f = CreateBirthPlace(f, bname,125000, 257000, 1000, 1); //create the ISectionFile with the birthplace info and located at x,y (125000,257000) and altitude 1000 meters.  To create a spawnpoint at an airport, specify a location within the airport boundaries (not sure exactly how close it must be?) and altitude 0.               
                GamePlay.gpPostMissionLoad(f);           
                    
                f.save(@"MYFAVORITEDIRECTORYPATH/" + bname + ".mis"); //save the resulting file to disk--very helpful for troubleshooting

Utility function to create the needed sectionfile and pass it back to you:

Code:
//Based on code by Kodiak, our hero
    //http://forum.1cpublishing.eu/showpost.php?p=438212&postcount=40
    //
    public static ISectionFile CreateBirthPlace(ISectionFile f, string name,double x, double y, double z, int army, int maxplanes = 1, bool setonpark = true, bool isparachute = true, string _country = "", string _hierarchy = "", string _regiment = "")
    {

        //ISectionFile f = GamePlay.gpCreateSectionFile();
        string sect;
        string key;
        string value;

        sect = "BirthPlace";

        key = "BirthPlace" + clc_random.Next(1000, 9999).ToString("F0");

        if (name != null & name.Length > 0) key = name.Trim();

        int setOnPark = 0;

        if (setonpark)
            setOnPark = 1;

        int isParachute = 0;

        if (isparachute)
            isParachute = 1;


        string country = ".";

        if (_country != null && _country.Length > 0)
            country = _country;


        string hierarchy = ".";

        if (_hierarchy != null && _hierarchy.Length > 0)
            hierarchy = _hierarchy;

        string regiment = ".";

        if (_regiment != null && _regiment.Length > 0)
            regiment = _regiment;


        //And so apparently the x,y,z coordinates here cannot have any decimal points.
        //Despite the fact the they are OK in EVERY other similar place.  Arrggghhh.
        value = army.ToString(CultureInfo.InvariantCulture) + " " + x.ToString("F0") + " "
            + y.ToString("F0") + " " + z.ToString("F0") + " "
            + maxplanes.ToString("F0") + " " + setOnPark.ToString("F0") + " "
            + isParachute.ToString("F0") + " " + country + " " + hierarchy + " " + regiment;

        Console.WriteLine("Creating Birthplace: " + value);

        f.add(sect, key, value);

        sect = "BirthPlace0";
        Dictionary<string, bool> planeSet = FullAircraftList[army];
        if (planeSet.Count > 0)
            foreach (string plane in planeSet.Keys)
            {
                if (!planeSet[plane]) continue;
                key = plane;
                value = "";
                f.add(sect, key, value);
            }

        return f;
    }

That could be improved by enforcing the restrictions on the name of the birthplace, as described above. 

Also--I'm not sure what happens if you enter a BirthPlace name that duplicates an existing Birthplace (or existing AiAirport name already existing in CloD).  Generally that causes problems but I'm not sure if it would replace the previous BirthPlace with that name, or just give an error, or just silently reject the new BirthPlace.

But in general, avoid duplicating already-existing names.

Example of how to step through all existing Birthplaces in a mission:

Code:
foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces())
            {
                if (bp != null & bp.Pos().distance(ref pos) <= ap.FieldR())
                {
                    if (bp.Name() != null && !(bp.Name().ToUpper().Contains("BIRTHPLACE"))) apName = bp.Name();  //This is just an example of something you could do with each birthplace - in this case, figure out if it is close to something
                    break;
                }
            }

Example of how to destroy/remove a Birthplace associated with an airport:

Code:
AiAirport ap = $$$$something$$$$$ //you have to get the airport you want to work with here, somehow.
        //disable any birthplace associated with/near this airport - thus, no spawning here
        foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces())
        {
            Point3d bp_pos = bp.Pos();
            if (ap.Pos().distance(ref bp_pos) <= ap.FieldR()) bp.destroy();//Removes the spawnpoint associated with that airport (ie, if located within the field radius of the airport)
        }

Example of how to step through every airport in the game--in this case to find the nearest airport to a certain point:

Code:
//nearest airport to a point
    //army=0 is neutral, meaning found airports of any army
    //otherwise, find only airports matching that army
    public static AiAirport nearestAirport(this IGamePlay GamePlay, Point3d location, int army = 0)
    {
        AiAirport NearestAirfield = null;
        AiAirport[] airports = GamePlay.gpAirports();
        Point3d StartPos = location;

        if (airports != null)
        {
            foreach (AiAirport airport in airports)
            {
                AiActor a = airport as AiActor;
                if (army != 0 && GamePlay.gpFrontArmy(a.Pos().x, a.Pos().y) != army) continue;
                if (NearestAirfield != null)
                {
                    if (NearestAirfield.Pos().distanceSquared(ref StartPos) > airport.Pos().distanceSquared(ref StartPos))
                        NearestAirfield = airport;
                }
                else NearestAirfield = airport;
            }
        }
        return NearestAirfield;
    }

Print this item

  Can't get a list of ALL ground actors in CloD/FMB scripting, and workaround
Posted by: Flug - 02-23-2020, 06:20 PM - Forum: Full Mission Builder - No Replies

I'm going to post a few random tips, problems, and solutions relating to scripting in IL2 Cliffs of Dover (CloD), and Full Mission Builder (FMB), here as they come up, in hopes they might be useful to someone else.

The issue here is that in CloD there are ways via scripting to get lists of all possible ground actors (things like ships, artillery, cars--the things on the ground that move and shoot etc, not just sit there and look pretty).  But, in fact they do not return a list of ALL possible ground actors, which is a problem.

I think the reason is probably that ground actors are supposed to be gathered together into groundgroups, which have a "Chief" which gives them instructions about what to do, where to drive, etc.

But it is possible & in fact easy to just place ground actors WITHOUT creating the associated Chief and then those don't show up when you get the supposedly full listing of ground actors.

So one solution would be to always create the associated Chief--even for a single actor or things like artillery there are advantages to that.

Here is the other solution.

Typical usage:

Code:
//This gets all static ACTORs such as (?) ships, artillery. (?).  There is no way to get this full list from CloD that I know of.
                 if (!diveTarget)
                    {
                        try
                        {
                        Console.WriteLine("MBT: Trying to find a ground actor");
                        if (allStaticActors != null)
                            {
                                List<AiActor> closeStaticActors = new List<AiActor>(coverCalcs.gpGetAllGroundActorsNear(allStaticActors, pos, maxMove_m).ToList()); //1000?
                                                                                                                                                                    //Finding actors we're going to range wider 1500. meters IN reality maybe we could look up the objective radius.  But actors nearby will be flak, etc etc etc.  All helpful.
                                coverCalcs.Shuffle(closeStaticActors);
                                foreach (AiActor act in closeStaticActors)
                                {
                                    if (act.IsAlive())
                                    {
                                        string groundType = "";
                                        if (act as AiGroundActor != null) groundType = (act as AiGroundActor).Type().ToString();
                                        newTarget = act;
                                        Console.WriteLine("MBT: FOUND a ground actor" + newTarget.Name() + " " + groundType);
                                        diveTarget = true;
                                        break;
                                    }

                                    if (diveTarget) break;
                                }
                            }

                        }
                        catch (Exception ex) { Console.WriteLine("Bomb select #1 ERROR: " + ex.ToString()); }
                    }

Another couple of typical/useful functions:
       
Code:
if (msg.StartsWith("<lactors") && (admin_privilege_level(player) > 1))
        {
            Console.WriteLine("Actor list - starting...");
            Point3d p = new Point3d(284703, 125257, 0);
            double r = 9000;

            string[] words = msg_orig.Split(' ');

            //Calcs.listStatics(GamePlay, new List<string>() { "smoke", "fire", "crater", "jerry" });
            List<AiActor> closeStaticActors = new List<AiActor>(coverCalcs.gpGetAllGroundActorsNear(allStaticActors, p,r).ToList()); //1000?
                                                                                                                                     //Finding actors we're going to range wider 1500. meters IN reality maybe we could look up the objective radius.  But actors nearby will be flak, etc etc etc.  All helpful.           
            foreach (AiActor act in closeStaticActors) Console.WriteLine("Actor: {0} {1}", act.Name(), (act as AiCart).InternalTypeName());

        }
else if (msg.StartsWith("<glist"))
        {
            AiActor[] aia = coverCalcs.gpGetGroundActors(this, 1);
            //exit;
            coverCalcs.listAllGroundActors(GamePlay);
            foreach (AiActor a in allStaticActors) Console.WriteLine(a.Name());

        }


Utility functions:

Code:
public static AiActor[] gpGetGroundActors(CoverMission msn, int army)
    {   // Purpose: Returns an array of all the AiActors in the game.
        // Use: GamePlay.gpGetActors();
        List<AiActor> result = new List<AiActor>();
        //List<int> armies = new List<int>(msn.GamePlay.gpArmies());
        List<int> armies = new List<int>() { 1, 2 };
        for (int i = 0; i < armies.Count; i++)
        {
            if (i != army) continue;
            // ground actors
            AiGroundGroup[] agg = msn.GamePlay.gpGroundGroups(armies[i]);
            if (agg == null)
            {
                //Console.WriteLine("# it's nulL!");
                return null;
            }
            //Console.WriteLine("#" + agg.ToString());// + " " + agg.Length.ToString());
            //return null;
            if (agg == null) return null;
            List<AiGroundGroup> gg = new List<AiGroundGroup>(msn.GamePlay.gpGroundGroups(armies[i]));
            for (int j = 0; j < gg.Count; j++)
            {
                List<AiActor> act = new List<AiActor>(gg[j].GetItems());
                for (int k = 0; k < act.Count; k++)
                {
                    result.Add(act[k] as AiActor);
                    //Console.WriteLine("Actor: " + (act[k] as AiActor).Name());
                }
            }
            /*
            // air actors
            List<AiAirGroup> airgroups = new List<AiAirGroup>(IG.gpAirGroups(armies[i]));
            for (int j = 0; j < airgroups.Count; j++)
            {
                List<AiActor> act = new List<AiActor>(airgroups[j].GetItems());
                for (int k = 0; k < act.Count; k++) result.Add(act[k] as AiActor);
            }
            */
        }
        return result.ToArray();
    }
    public static void listAllGroundActors(IGamePlay gp, int missionNumber = -1)
    {
        //TODO: Make it list only the actors in that mission by prefixing "XX:" if missionNumber is included.
        gp.gpLogServer(null, "Listing all ground actors:", new object[] { });

        int group_count = 0;
        if (gp.gpArmies() != null && gp.gpArmies().Length > 0)
        {
            foreach (int army in gp.gpArmies())
            {
                //List a/c in player army if "inOwnArmy" == true; otherwise lists a/c in all armies EXCEPT the player's own army
                if (gp.gpGroundGroups(army) != null && gp.gpGroundGroups(army).Length > 0)
                {
                    foreach (AiGroundGroup group in gp.gpGroundGroups(army))
                    {
                        group_count++;
                        if (group.GetItems() != null && group.GetItems().Length > 0)
                        {
                            //poscount = group.NOfAirc;
                            foreach (AiActor actor in group.GetItems())
                            {
                                if (actor != null)
                                {
                                    gp.gpLogServer(null, actor.Name(), new object[] { });
                                    AiGroundGroup actorSubGroup = actor as AiGroundGroup;
                                    if (actorSubGroup != null && (actorSubGroup).GetItems() != null && actorSubGroup.GetItems().Length > 0)
                                    {
                                        foreach (AiActor a in actorSubGroup.GetItems())
                                        {
                                            gp.gpLogServer(null, a.Name(), new object[] { });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

    }

public static AiActor[] gpGetAllGroundActorsNear(AiActor[] aia, Point3d pos, double radius)
    {
        List<AiActor> result = new List<AiActor>();
        foreach (AiActor a in aia)
        {
            if (coverCalcs.CalculatePointDistance(a.Pos(), pos) < radius) result.Add(a);
        }
        return result.ToArray();
    }

The recursive function that keeps the allStaticActors array continually updated:

Code:
        AiActor[] allStaticActors = null;
        Dictionary<string, IMissionObjective> SMissionObjectivesList = new Dictionary<string, IMissionObjective>();

        private void renewAllStaticActors_recurs()
        {
            Timeout(3 * 60, () => renewAllStaticActors_recurs());
            allStaticActors = coverCalcs.gpGetAllGroundActors(this, stb_lastMissionLoaded);
            SMissionObjectivesList = TWCMainMission.SMissionObjectivesList();
        }

The function that kicks off the recursive function and loads the initially appearing groundactors:
Code:
int stb_lastMissionLoaded = -1;

        public override void OnMissionLoaded(int missionNumber)
        {
            base.OnMissionLoaded(missionNumber);

            try
            {

                  stb_lastMissionLoaded = missionNumber;


                if (missionNumber == MissionNumber)
                {
 
                    Timeout(20, () => renewAllStaticActors_recurs());

                }
            }
            catch (Exception ex) { Console.WriteLine("Cover OnMissionLoaded(): " + ex.ToString()); }
        }

You could just run the recursive function once every time onMissionLoaded is called, capturing the new actors from each mission as it is loaded (instead of running it recursively every X minutes).  But our missions tend to have many small submissions loaded later on so just running it every X minutes seemed just as good a solution.

Print this item

Video Amateur hour
Posted by: Target - 02-22-2020, 09:15 PM - Forum: The Wrecking Ball Theatre - Replies (4)

Print this item

  Flying Circus - OurDay
Posted by: Sp00k - 02-22-2020, 07:38 PM - Forum: The Wrecking Ball Theatre - No Replies



Target and I in the Flanders in Flame Flugpark server.   The day had its ups and downs but laughs all the way.

Looks best in Youtube full screen in 2160p 4K resolution.

Print this item

 
Latest Threads
Upcoming Additions
Last Post: SWAT
01-27-2025, 08:05 PM
Grandson of Khan Campaign...
Last Post: TWC_Padre
01-08-2025, 08:25 AM
Bluntman Application
Last Post: TM-Bluntman
11-11-2024, 07:21 PM
BACK TO DESERT WARFARE
Last Post: TWC_Padre
07-24-2024, 04:40 PM
New Years 2024!
Last Post: TM-Bluntman
01-01-2024, 06:23 PM
Can’t log in to TWC Gengh...
Last Post: Volant_Eagle
10-27-2023, 11:23 PM
Astralczar Application
Last Post: Fatal_Error
04-15-2023, 11:24 PM
Dec 2022: New Campaign Se...
Last Post: Flug
01-14-2023, 06:40 AM
Tactical situation radar ...
Last Post: Flug
01-09-2023, 02:01 AM
Hi All
Last Post: Mr_ZapMan
12-29-2022, 10:52 AM