Jade_Monkey Posted December 8, 2016 Posted December 8, 2016 (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 osfor 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 December 8, 2016 by Jade_Monkey 3
Habu Posted December 10, 2016 Posted December 10, 2016 (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 December 10, 2016 by Habu
Jade_Monkey Posted December 10, 2016 Author Posted December 10, 2016 (edited) You need to have python installed: https://www.python.org/downloads/release/python-345/ That would be the most basic type (command line). If you want to use a more visual IDE, I recommend Rodeo from YHat: https://www.yhat.com/products/rodeo You still need to install Python if you want to use Rodeo. Edited December 10, 2016 by Jade_Monkey
Habu Posted December 10, 2016 Posted December 10, 2016 Ok, i found two other ways which can do the job on a folder with several missions inside. I tested with the actual beta, and i can run the mission modified. We can use Sublimtext or Notepad++ Here are the option to set for Sublimetext :https://www.sublimetext.com/Here are the option to set for Notepd++ (version portable disponible)https://notepad-plus-plus.org/download/v7.2.2.html
Gambit21 Posted December 11, 2016 Posted December 11, 2016 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?
Jade_Monkey Posted December 11, 2016 Author Posted December 11, 2016 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.
89- Posted December 26, 2016 Posted December 26, 2016 Many thanks Jade Monkey! Worked like a treat All Veteranen66 plane missions work now.
katdog5 Posted July 20, 2017 Posted July 20, 2017 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 July 20, 2017 Author Posted July 20, 2017 This is a relatively old thread, so maybe some of the updates after this was posted changed other things?
Habu Posted July 20, 2017 Posted July 20, 2017 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.
katdog5 Posted July 22, 2017 Posted July 22, 2017 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 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now