Jump to content
Age of History
Smeysya

Python script for uniting PROV files to TXT

Recommended Posts

If you have province files (not processed by the game, but with just coordinates), then this script will help you if you need to edit the map.

You can run script by yourself just copy it and download python

Quote


mapaoc=open("mapAoC2_v2.txt","a")

totalnum=input("Write province amount:")
startnum=0

while startnum!=totalnum:
    provnum=(str(startnum)+".")
    sorter=open(provnum,"r+")
    for i in sorter:
        mapaoc.write(i.replace(";","\n")+"\n")
        startnum+=1

изображение_2024-07-09_052952279.png

Share this post


Link to post
Share on other sites

1 hour ago, ViktorH1488 said:

I don't understand how it works, explain it better.

Its just takes provinces and make mapAoC2 file for MapEditor where you can add or edit this provinces, its helpful if you lost original txt file and have only these PROV files. 

To use script: 1. Installing Python. 2. Creating .py file and copy paste quoted script. 3. Run it in same folder with PROV files and it will create usable TXT.

Share this post


Link to post
Share on other sites

11 hours ago, Smeysya said:

Ele apenas pega as províncias e cria um arquivo mapAoC2 para o MapEditor, onde você pode adicionar ou editar essas províncias. É útil se você perdeu o arquivo txt original e tem apenas esses arquivos PROV. 

Para usar o script: 1. Instalando o Python. 2. Criando o arquivo .py e copiando e colando o script citado. 3. Executando-o na mesma pasta com os arquivos PROV, ele criará um TXT utilizável.

I did it and it didn't work

Share this post


Link to post
Share on other sites

2 hours ago, ViktorH1488 said:

I did it and it didn't work

bruuuh, i tested it on my 0-554 provinces and it worked well. Unlucky

I also tested script with starting names of provinces bigger than 0 (the name of the province file began with 101 and 201) and yes, then an empty file is created, but I was making a script for my tasks, so I did not try to make it more universal.

Edited by Smeysya

Share this post


Link to post
Share on other sites

Guest
3 hours ago, Łukasz Jakowski said:

## To export provinces from AoH2 to file Open the AoH2 game. Go to Editor -> Map Editor- > Map -> Edit Connections And Provinces -> and click 'Q'. File will be created in map folder.

no way i didnt knew that.

now i can surely modify community-made maps with pleasure.


👀

Share this post


Link to post
Share on other sites

19 hours ago, Łukasz Jakowski said:


 

THANKS!

15 hours ago, bun_dha4 said:

no way i didnt knew that.

now i can surely modify community-made maps with pleasure.


👀

Real bro.

Share this post


Link to post
Share on other sites

Hey,

This script converts provinces into a mapAoC2 file compatible with MapEditor, which is useful if you've lost the original txt file and only have the PROV files.

To use the script: 1. Install Python. 2. Create a .py file and paste the provided script. 3. Run the script in the same folder as your PROV files to generate a usable TXT file for editing or adding provinces in MapEditor.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Age of History Games