Jump to content

Small .batch file, script or editor macro required for marking (renaming) block types in template missions.


Recommended Posts

Posted (edited)

...ADDED LATER: 1 mistake found in my steps / see below

Hi, 

I would like try to optimize some huge mission templates that contain huge numbers of not named blocks (all blocks have the same default name:

Name = "Block";

 

For my planned optimization it is required that the blocks can be searched / found inside the Mission Editor.

For this the to be searched blocks have to be renamed in the mission text file.

And due to the fact, that some files contain ca. 60000 blocks this has to be done automaticly.

 

Steps to be executed for the example to name all blocks of one type:

example name all Model = "graphics\buildings\bench2.mgm"; blocks

1.) open mission text file (this could be done manually if the script / macro runs inside of a text editor)

2.) jump to the end of the file (this could be done manually if the script / macro runs inside of a text editor)

3.) search "upwards" for the block definition "graphics\buildings\bench2.mgm";

4.) from the "found line" replace "upwards" Name = "Block"; by e.g.:  Name = "SELECT";

 

5.) from the line where the text was replaced repeat steps 1.)-4.) unless all blocks of the type "bench2" are renamed

 

Example how it  looks when done manually in Notepad++:

1.), 2.),3.)

image.thumb.png.4cb71e887c4f8283507772169fdc2ef5.png

4.)

image.thumb.png.b5a8379b791c7fa739cf1e19096f0a4a.png

.added later: wrong is: after replacing one name the replace command searches automaticly the next Name = "block" which is wrong??

5.) Repeat 1.)-4.)

 

image.thumb.png.34eae7324cd27f6365efa6cb19ca340e.png

 

Note: I have already recorded a Macro in Notepad++, but this stops after the

Name = "Block";

is found.

And it seems to me that in Notebook++ it is not possible to view / and change the command line of a macro?

(I am not a programmer)

 

Many Thanks in advance!

image.png

Edited by kraut1

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