Jump to content
Age of History Games
pastelynn

A python script that create province files from mapAoC2_v2.txt in map editor

Recommended Posts

I just lazy to change name of PROV file so I create this file to save my time.

thing that it this is just create province files for who missed the PROV file and who want to save time (like me).

How to use:

  1. this is an python script so you must have python installed.
  2. place my 0123.py file at same folder as mapAoC2_v2.txt or \editor_data\Provinces (I named this way because province files name is 0, 1, 2, 3...).
  3. run it and type file name (without .txt) if file name is mapAoC2_v2.txt just type enter.
  4. enjoy!

Download:

Mega: https://mega.nz/#!eVYnRCqJ!n8JHcOzv7WFU_hYcKkxHJMrfb_0PkaMsQjIVbEGLOxw

or below this post

If you have download problem you can just create python script by using code below:

filename=str(input('filename (without .txt): '))
if filename:
    filename = filename + '.txt'
else:
    filename = 'mapAoC2_v2.txt'
f= open(filename,'r')
num_lines = sum(1 for line in open(filename))
line = 0
print(0/2)
while line < num_lines:
    fo = open(str(int(line/2)),'w+')
    lin1 = f.readline()
    if line == num_lines-2:
        lin2 = f.readline()+'\n'
    else:
        lin2 = f.readline()
    fo.write(lin1[:-1]+';'+lin2[:-1])
    fo.close
    line = line + 2
    print(str(int(line/2)),'done')
f.close

Isn't you post this before?:

Yes it is, but I noticed that my file have a problem (last province, last point, last digit just disappear) so I fixed it.

I'm bad at coding but I think this would help some people (like me). also sorry for my grammar, i'm not a native English speaker.

0123.py

Share this post


Link to post
Share on other sites
11 hours ago, Tincho987 said:

Do you have a virus?

It just a python script. if you don't trust me just copy the code and create a new .py file in your computer. if you think python is a virus, python has millions of user, if it has a virus someone would notice and report but this didn't happen. so I'm sure this didn't have any virus

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


  • Similar Content

    • By Hons
      AOH2 Province Updater
      I made this program because i had to make it lol and i made it in JavaScript.
      This program updates provinces you have made with the Map Editor data, why should you/when to use this program? This program is used when you accidentally made a mistake while making your map and then not being able to overwrite or update the exported provinces with the Map Editor.
      The way it works is by taking the Map Editor data / mapAoC2_v2.txt and exporting it to generate provinces.
      The Instructions of how to use it is in the program.
      GitHub Download/Releases : https://github.com/honsda/AOH2-ProvinceUpdater/releases
      Report bugs here : https://github.com/honsda/AOH2-ProvinceUpdater/issues
      Running the program in Windows
      1. Download the Zip file from releases in GitHub. or download from here (v1.0.3) 
      AOH2-ProvinceUpdater-v1.0.3.rar
      2. Extract the Zip file.
      3. Run it and do what it says.
      Also i only made an executable version of the program for Windows, you'll have to download the repository and run it by yourself.
      Running the program for Non-Windows users
      1. Download NodeJS for your OS.
      2. Download the repository in GitHub. (Press "Code" and click "Download ZIP")
      3. Extract the Zip file.
      4. Open cmd prompt and redirect to the extracted folder using `cd <your-path-here>`.
      5. Type `npm install` and wait for it to finish.
      6. Run the program by typing `node update.js` on the cmd prompt.
       
    • By LasanhaVonW
      I created a tool that allows you to basically delete a province from a map, just put the IDs for the provinces in the "provinces.txt" file, and run the exe, and you'll get basically empty files with the province IDs you wrote as the name inside the "provincefiles" folder. it's mostly just a tool for lazy people like me that don't want to copy and rename files for an eternity when making simple edits like deleting a continent.

      the program and provinces txt file have a tutorial inside them.
       
      Happy map editing. I guess.
      Province Deleter for AoC2.zip
    • By Timm638
      I've made a tool, which converts a .png into a bunch of provinces, allowing someone to create a custom map more easily.
      Link to download : https://github.com/Timm638/aoc2_converter/raw/master/AoC2_Conv_0.1.jar
      Link to short guide: https://github.com/Timm638/aoc2_converter
      If you need help ask here or come over to the discord.
  • Popular Now

  • Our picks

  • Tell a friend

    Love Age of History Games? Tell a friend!

  • Posts

×
×
  • Create New...