Jump to content

A Question on Clod Full Mission Builder Advanced Functions


Recommended Posts

I/JG54_chuishan
Posted (edited)

I've just started to learn Clod's full mission builder, but since I'm familiar with the good old 1946 FMB, I can handle those basic staff, also I'm getting my hands on basic scripts.

I'm currently trying to make a co-op mission to play with my friends, and I want to achieve airfield destruction effect calculated in percentages like the one presented in TWC Campaign Server. However I have no idea how is that achieved... Wonder if anyone have any information on that? Any assistance will be appreciated! ?

 

Screenshots taken from Karaya's legendary escort mission video 'Brute Force'. (thanks for presenting this to us Karaya!)

 

596306792_QQ20200709162823.thumb.png.9fa457d11e1301e0789db62768608bfb.png

Edited by I/JG54_chuishan
  • Like 1
No.54_Reddog
Posted

I used to have some script snippets on ATAG, although have no idea if they're still there which showed how to do this.

I/JG54_chuishan
Posted
28 minutes ago, No.54_Reddog said:

I used to have some script snippets on ATAG, although have no idea if they're still there which showed how to do this.

 

What did you guys call this function back in the day then? May be with some key words I can try to search for those threads myself.? Thanks for helping.

I/JG54_chuishan
Posted
1 hour ago, ATAG_Flare said:

https://theairtacticalassaultgroup.com/forum/Downloads.php?do=download&downloadid=7

 

These are some old (2015, TF 4.3) multiplayer missions that will most likley have the airfield destruction code in them. I'm sure if you asked on the ATAG forums where most of the current mission builders hang out they might be able to help you even more. Perhaps the ACG forums would be a good spot too.

 

Thank you for helpful advice! ? I'll try those forums out. Actually I've found some interesting information on ATAG, TWC and ACG forums, but it's quite fragmented, so I have to put pieces together.

 

38 minutes ago, No.54_Reddog said:

Sadly I removed all the content on the atag forum when I was banned. The thread had been... https://theairtacticalassaultgroup.com/forum/showthread.php?t=8544

 

I'll see if I have the actual code somewhere on my harddrive

 

Thanks for helping, Reddog! ? If you can retrieve the code that would be excellent! 

  • Like 1
I/JG54_chuishan
Posted

Hi! Reddog, I think I've found it! It's on TWC Campaign Server Mission made public on Github. I found this in their .cs file with your credit on it. However simply copy-paste does not seems to work, if I need any alteration to make it work? The biggest issue for me is that I don't know how to set the airfield that has the destruction calculation. Where to enter airfield name etc. Is it possible for you to explain it a little bit? ?  @No.54_Reddog

handle airport bombing.txt

No.54_Reddog
Posted

I'll take a look and get back to you.

I/JG54_chuishan
Posted
45 minutes ago, No.54_Reddog said:

I'll take a look and get back to you.

 

Much appreciated! ?

  • 3 weeks later...
I/JG54_chuishan
Posted
On 7/11/2020 at 7:16 PM, No.54_Reddog said:

I'll take a look and get back to you.

 

Hi Reddog! Wonder if there's any finding in the code? ? If it's inconvenient for you to share the code mechanism with me you can go ahead and tell me, that's Ok and reasonable, since it's the fruit of your intelligent work after all:) My purpose of getting information of those advanced FMB functions and codes is to create an adequate playground for my Chinese friends, who know not very much Clod game mechanism, especially FMB and enjoy no advantage in online servers for we can only fly TWC or ATAG server with 200+ or even 300 ping. I think Chinese communities deserve their own low ping playground, and with equal advanced functions as in TWC/ATAG that can be explored.

No.54_Reddog
Posted

Sorry for the delay, that took a lot longer to dig out than I'd anticipated.

 

The code here is from a mission that I wrote for ATAG before I wrote SoW which used very different code and it's not something I'm willing to share as it a) won't work without our database and what not, and b) it's heavily embedded with the rest of the systems. That said, this *should* work, 

 

I've attached the original mission also, so you should be able to pull it apart and get what you want. Please don't just host this mission. :)

#region variables for Airfield Targets
    public Dictionary<AiAirport, double> AirfieldTargets = new Dictionary<AiAirport, double>(); //Dictionary to hold the AirfieldTargets and weight of Bombs needed to knock out.
    public Dictionary<AiAirport, string> AirfieldTargetsName = new Dictionary<AiAirport, string>(); //Dictionary to hold the AirfieldTargets and weight of Bombs needed to knock out.
    public Dictionary<AiAirport, double> AirfieldTargetsDamage = new Dictionary<AiAirport, double>(); //Dictionary to hold the AirfieldTargets and weight of Bombs taken.
    public Dictionary<AiAirport, bool> AirfieldTargetsState = new Dictionary<AiAirport, bool>(); //Dictionary to hold the AirfieldTargets and overall state True/False.

    public override void OnBombExplosion(string title, double mass, Point3d pos, AiDamageInitiator initiator, int eventArgInt)
    {

        base.OnBombExplosion(title, mass, pos, initiator, eventArgInt);

        foreach (AiAirport ap in AirfieldTargets.Keys)
        {
            if (AirfieldTargetsDamage[ap] >= AirfieldTargets[ap])
            {//damage greater than or equal to that required to knock out so no need to add or further process

            }
            else
            {
                //Damage not greater than or equal to so need check if bomb fell inside radius and if so increment up
                if (ap != null & ap.Pos().distance(ref pos) <= ap.FieldR())
                {
                    AirfieldTargetsDamage[ap] = AirfieldTargetsDamage[ap] + mass;
                    if (AirfieldTargetsDamage[ap] >= AirfieldTargets[ap])
                    {
                        if (DynTargetPoints.ContainsKey(AirfieldTargetsName[ap]))
                        {
                            if (Debug)
                            {
                                GamePlay.gpLogServer(null, AirfieldTargetsName[ap]+"Removed from target list", null);
                                GamePlay.gpLogServer(null, AirfieldTargetsName[ap] + " has been knocked out!!!", null);
                            }
                            DynTargetPoints.Remove(AirfieldTargetsName[ap]);
                        }
                        GamePlay.gpHUDLogCenter(AirfieldTargetsName[ap] + " has been knocked out!!!");
                        LoadAirfieldSpawns(); //loads airfield spawns and removes inactive airfields.
                        if (ObjectivesState.ContainsKey(AirfieldTargetsName[ap]))
                        {//airfield knocked out is an objective

                            ObjectivesState[AirfieldTargetsName[ap]] = true; //Sets objective to completed.

                            InitialBlueObjectiveCount = InitialBlueObjectiveCount + 1;
                            Timeout(10, () =>
                            {
                                GamePlay.gpLogServer(null, "Blue Objective Completed!!!", new object[] { });
                                GamePlay.gpHUDLogCenter("Blue Objective Completed!!!");
                                CheckObjectives();
                            });
                        }
                    }
                }
            }
        }
    }
    public void SetAirfieldTargets()
    {
        foreach (AiAirport ap in GamePlay.gpAirports())
                {
                    if (ap.Name().Contains("Biggin")) {
                        AirfieldTargets.Add(ap,10000);
                        AirfieldTargetsDamage.Add(ap,0);
                        AirfieldTargetsState.Add(ap, false);
                        AirfieldTargetsName.Add(ap, "RAF Biggin Hill (AO25)");
                    }
                    if (ap.Name().Contains("Kenley"))
                    {
                        AirfieldTargets.Add(ap, 10000);
                        AirfieldTargetsDamage.Add(ap, 0);
                        AirfieldTargetsState.Add(ap, false);
                        AirfieldTargetsName.Add(ap, "RAF Kenley (AN25)");
                    }
                    if (ap.Name().Contains("Manston"))
                    {
                        AirfieldTargets.Add(ap, 10000);
                        AirfieldTargetsDamage.Add(ap, 0);
                        AirfieldTargetsState.Add(ap, false);
                        AirfieldTargetsName.Add(ap, "RAF Manston (AX26)");
                    }
                    if (ap.Name().Contains("Hawkinge"))
                    {
                        AirfieldTargets.Add(ap, 10000);
                        AirfieldTargetsDamage.Add(ap, 0);
                        AirfieldTargetsState.Add(ap, false);
                        AirfieldTargetsName.Add(ap, "RAF Hawkinge (AW23)");
                    }
                    if (ap.Name().Contains("Hornchurch"))
                    {
                        AirfieldTargets.Add(ap, 10000);
                        AirfieldTargetsDamage.Add(ap, 0);
                        AirfieldTargetsState.Add(ap, false);
                        AirfieldTargetsName.Add(ap, "RAF Hornchurch (AQ27)");
                    }
                    if (ap.Name().Contains("Sounthend"))
                    {
                        AirfieldTargets.Add(ap, 10000);
                        AirfieldTargetsDamage.Add(ap, 0);
                        AirfieldTargetsState.Add(ap, false);
                        AirfieldTargetsName.Add(ap, "RAF Southend (AS28)");
                    }
                }    
    }
    public void LoadAirfieldSpawns ()
    {

        foreach (AiBirthPlace bp in GamePlay.gpBirthPlaces())

        {  
            bp.destroy();
        }
        GamePlay.gpPostMissionLoad("missions/London Raids/nondestroyable.mis");

       foreach (AiAirport ap in AirfieldTargets.Keys) {
        if(AirfieldTargetsDamage[ap] < AirfieldTargets[ap]) {
            //Airfield still active so load mission
            GamePlay.gpPostMissionLoad("missions/London Raids/"+AirfieldTargetsName[ap]+".mis");
        }
        }
    }

 

London Raids.zip

I/JG54_chuishan
Posted
On 8/1/2020 at 6:03 AM, No.54_Reddog said:

Sorry for the delay, that took a lot longer to dig out than I'd anticipated.

 

Thank you for your kind offer!!! ? I will try to figure out the mechanism and implement it into my own mission. I fully understand that this is your intelligent work and I promise not to misuse it.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...