Jump to content

Complex trigger - Upcoming changes


Recommended Posts

Posted (edited)

Hi everyone,

 

With today's announcement about complex triggers changing the CheckEntities to CheckPlanes I panicked a bit because I use complex triggers frequently and the task would be unbearable.

Since I recently started learning Python, I decided it would be a good opportunity to apply my newly acquired skills.

This script goes through all the ".Mission" files in your missions folder (and subfolders) and substitutes the CheckEntities for CheckPlanes.

 

I dont think a lot of you would have Python installed on your PCs but for those who do, feel free to use it (and improve it). Im pretty sure it works with both 2.7 and 3.5 versions of Python.

 

The changes haven't taken place yet, so wait until the new patch before using this.

 

Also make sure you set the right directory and use double backsalshes for the path.

 

 

 

import os

for dname, dirs, files in os.walk('C:\\Steam\\steamapps\\common\\IL-2 Sturmovik Battle of Stalingrad\\data\\Missions\\'):       #    Make sure to put double backslashes
    for fname in files:
        if '.Mission' in fname:             # filter the files you want to use either by name or type
            fpath = os.path.join(dname, fname)
            with open(fpath) as f:
                s = f.read()
                s = s.replace('CheckEntities ','CheckPlanes')    #Original, replacement
            with open(fpath, "w") as f:
                f.write(s)

 

Cheers,

 

JM

Edited by Jade_Monkey
  • Upvote 3
Posted (edited)

Jade Monkey,

 

May you provide me a link on what i have to donwload, and your programm. I can run test, and i can say you if it's work or no. ;)

 

 

We can do the changment using the windows blocnote.

Edited by Habu
Posted

Hi everyone,

 

With today's announcement about complex triggers changing the CheckEntities to CheckPlanes I panicked a bit because I use complex triggers frequently and the task would be unbearable.

 

Can you please elaborate on this so that I can understand your workflow and how this would make this more difficult?

Posted

They announced that the complex trigger will have a change, where the current "CheckEntities" will be named "CheckPlanes" in the upcoming patch. This change hasn't taken place yet.

 

Most of my SP missions have complex triggers, so for them to work after the upcoming patch, I have to manually change the text in the mission file from CheckEntities to CheckPlanes.

 

I created a script to find and replace all the terms in the missions folder and subfolders, which I wrote in Python.

 

You can do it in other ways such as the one explained by Habu above.

  • 3 weeks later...
Posted

Many thanks Jade Monkey! Worked like a treat :) All Veteranen66 plane missions work now.

  • 6 months later...
Posted

They announced that the complex trigger will have a change, where the current "CheckEntities" will be named "CheckPlanes" in the upcoming patch. This change hasn't taken place yet.

 

Most of my SP missions have complex triggers, so for them to work after the upcoming patch, I have to manually change the text in the mission file from CheckEntities to CheckPlanes.

 

I created a script to find and replace all the terms in the missions folder and subfolders, which I wrote in Python.

 

You can do it in other ways such as the one explained by Habu above.

 

I gave this a shot, (thanks for replace method) but your missions just say Mission Description is Loading. I probably mucked something up.

Jade_Monkey
Posted

This is a relatively old thread, so maybe some of the updates after this was posted changed other things?

Posted

I gave this a shot, (thanks for replace method) but your missions just say Mission Description is Loading. I probably mucked something up.

If you used the method which said to change the valor of the complex trigger in the mission file, and deleting the msnbin file, it's normal that the mision take more time to load in the editor.

Posted

and deleting the msnbin file

 

 

ahhhhhhhhh. who said anything about a msbin file haha. thanks

 

also thanks jade monkey for the missions

 

works of course now

  • Upvote 1

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...