Jump to content

Upgrading a23 skirmish maps to be compatible with a24


andy5995
 Share

Recommended Posts

When I reported on IRC that my skirmish maps weren't working, @Stan`gave me a link to this script

 

https://code.wildfiregames.com/P232

 

I've attached the python script it to this post.

python3 <scriptname> <version> <path>

The correct version to use is "7". For the path, I used "." (single dot) while in the directory containing my custom skirmish maps.

 

After that, you may have to edit your xml. I still get errors such as the following when opening most maps into Atlas

 

Quote

ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/gaia/flora_tree_cretan_date_palm_tall.xml"
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/gaia/flora_tree_cretan_date_palm_tall.xml"
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/gaia/flora_tree_cretan_date_palm_tall.xml"
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/gaia/flora_tree_cretan_date_palm_tall.xml"
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
ERROR: Failed to load entity template 'gaia/flora_tree_cretan_date_palm_tall'
GAME STARTED, ALL INIT COMPLETE

 

 

 

0ad-map-upgrade-20210222-01.py

Edited by andy5995
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

21 hours ago, andy5995 said:

Thanks. I also want to give it some thought and see if it could be done with something like

 





find . -name '*' -print -exec sed -i 's/gaia\/tree\/cretan_date_palm_tall/replacement-text/g' {} \;

 

to fix all the files at once. I'll take a closer look later.

You should have a look at the patches that broke your maps, they have sed scripts to fix things:

Furthermore, you need to replace {civ}_* with {civ}/* (for structures and units). https://code.wildfiregames.com/P225 was used for that, though that script does more than you need, so it's probably better to write a sed script for that (there are only 13 civs). [EDIT] Here you go:

Spoiler

find binaries/data/mods/public/maps/ \( -name '*.js' -o -name '*.json' -o -name '*.xml' \) -print0 | xargs -0 sed -i \
  -e 's,structures/athen_,structures/athen/,g' \
  -e 's,structures/brit_,structures/brit/,g' \
  -e 's,structures/cart_,structures/cart/,g' \
  -e 's,structures/gaul_,structures/gaul/,g' \
  -e 's,structures/iber_,structures/iber/,g' \
  -e 's,structures/kush_,structures/kush/,g' \
  -e 's,structures/mace_,structures/mace/,g' \
  -e 's,structures/maur_,structures/maur/,g' \
  -e 's,structures/pers_,structures/pers/,g' \
  -e 's,structures/ptol_,structures/ptol/,g' \
  -e 's,structures/rome_,structures/rome/,g' \
  -e 's,structures/sele_,structures/sele/,g' \
  -e 's,structures/spart_,structures/spart/,g' \
  -e 's,units/athen_,units/athen/,g' \
  -e 's,units/brit_,units/brit/,g' \
  -e 's,units/cart_,units/cart/,g' \
  -e 's,units/gaul_,units/gaul/,g' \
  -e 's,units/iber_,units/iber/,g' \
  -e 's,units/kush_,units/kush/,g' \
  -e 's,units/mace_,units/mace/,g' \
  -e 's,units/maur_,units/maur/,g' \
  -e 's,units/pers_,units/pers/,g' \
  -e 's,units/ptol_,units/ptol/,g' \
  -e 's,units/rome_,units/rome/,g' \
  -e 's,units/sele_,units/sele/,g' \
  -e 's,units/spart_,units/spart/,g'

 And insert any other civs your mod has.

[EDIT] There are probably some other things I forgot.

Edited by Nescio
forgot D2234, D3012, D3097
  • Thanks 1
Link to comment
Share on other sites

If people need a little more guidance on how to convert their maps from a23 to a24 on windows:

  1. click start, type "cmd"
  2. type "python3" inside the command prompt and hit enter, it will open the microsoft app store directing you to the python app. Download and install that.
  3. Go to the directory where your skirmish map is. Put the file @andy5995 provided in there. 
  4. Click the directory bar
    Spoiler

    image.thumb.png.97358bec47f3ccbb04f12d2b6c58f82c.png

  5. Type cmd and hit enter
    Spoiler

    481869321_Nieuwproject.thumb.png.48b3d38d5904a23188078b85205aaf57.png

  6. copy the following line and paste it inside the command prompt (including the dot at the end): python3 0ad-map-upgrade-20210222-01.py 7 .
  7. Done. Now you can open up your map again. 

 

 

Edited by Grapjas
  • Like 4
Link to comment
Share on other sites

19 hours ago, Nescio said:

You should have a look at the patches that broke your maps, they have sed scripts to fix things:

Furthermore, you need to replace {civ}_* with {civ}/* (for structures and units). https://code.wildfiregames.com/P225 was used for that, though that script does more than you need, so it's probably better to write a sed script for that (there are only 13 civs).

[EDIT] There are probably some other things I forgot.

I ran all of these scripts. So far the only things I've noticed are a missing bench

 

ERROR: Failed to load entity template 'other/bench'
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/other/bench.xml"

 

(which I couldn't figure out how to fix)

 

And the civs can't be changed from the game setup menu. When I uncheck the player name and civ from within Atlas, changes to the civ name are not saved.

Link to comment
Share on other sites

1 hour ago, andy5995 said:

And the civs can't be changed from the game setup menu. When I uncheck the player name and civ from within Atlas, changes to the civ name are not saved.

I noticed this too. I simply deleted them in the xml file and then you can change settings again @ game setup. Same story for teams, cant be changed either unless deleted in xml.

  "PlayerData": [
    {
    },
    {
    },
    {
    },
    {
    },
    {
    },
    {
    },
    {
    },
    {
    }
  ],

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, andy5995 said:

I ran all of these scripts. So far the only things I've noticed are a missing bench


ERROR: Failed to load entity template 'other/bench'
ERROR: CCacheLoader failed to find archived or source file for: "simulation/templates/other/bench.xml"

(which I couldn't figure out how to fix)

That was D3097. I've now updated the previous post.

1 hour ago, andy5995 said:

And the civs can't be changed from the game setup menu. When I uncheck the player name and civ from within Atlas, changes to the civ name are not saved.

I'm not sure what you mean.

  • Thanks 1
Link to comment
Share on other sites

27 minutes ago, Grapjas said:

If a civ has been set for a player inside Atlas you cannot change them ingame at the gamesetup. As if it were a scenario map even though it's a skirmish map. 

Not only that, but in Atlas you can uncheck the civs and save the map, but Atlas bugs and assigns default civs anyway. Quite annoying.

45 minutes ago, Grapjas said:

noticed this too. I simply deleted them in the xml file and then you can change settings again @ game setup. Same story for teams, cant be changed either unless deleted in xml

Yeah, I've had to do this as well.

  • Like 2
Link to comment
Share on other sites

40 minutes ago, wowgetoffyourcellphone said:

Not only that, but in Atlas you can uncheck the civs and save the map, but Atlas bugs and assigns default civs anyway. Quite annoying.

Yeah, I've had to do this as well.

 

I've noticed too that when editing the xml directly and removing the civ names, everything is fine. Then I open  it in Atlas, make no changes, and click save. The civ names return.

  • Like 2
Link to comment
Share on other sites

  • 1 month later...
16 hours ago, Lopess said:

How can I do this procedure in linux?

@LopessFirst use the python script as mentioned in the first post.

Then use the 7 scripts I've attached, that are based on the 7 patches mentioned by @Nescio

None of these 7 scripts require an argument. Just use

 

sh D????.sh

Each script will look in a "maps" directory relative to your current directory, and change all maps it finds. There will be no messages output by the scripts (unless there's an error).

 

 

D1009.sh D1010.sh D2234.sh D2254.sh D2774.sh D3012.sh D3097.sh

Edited by andy5995
  • Like 3
Link to comment
Share on other sites

  • 2 weeks later...

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.

 Share

×
×
  • Create New...