Forged Alliance Forever Forged Alliance Forever Forums 2013-09-09T21:47:32+02:00 /feed.php?f=53&t=5109 2013-09-09T21:47:32+02:00 2013-09-09T21:47:32+02:00 /viewtopic.php?t=5109&p=53540#p53540 <![CDATA[Re: Need help for browsing and sorting out maps]]>

I have written a small Python script which i want to share here:
Code:
#! /usr/bin/env python
import sys, os, re
# From https://github.com/SirAnthony/slpp
import slpp

result = {}
for dirpath, dirnames, filenames in os.walk('.'):
  for filename in filenames:
    if 'scenario.lua' in filename:
      with open (os.path.join(dirpath, filename), "r") as myfile:
        filecontent = myfile.read()
        data = slpp.slpp.decode('{' + filecontent + '}')
        name = ''
        try:
          name = data['ScenarioInfo']['name']
          result[name] = dirpath
        except:
          print('Error:' + dirpath)

for name in sorted(result.iterkeys()):
  print(name + ' -> ' + result[name])


It is not perfect (it bugs on some maps that have a scenario.lua that isn't 100% lua conforming), but it is sufficient for what i am looking for.
When run from the maps folder it produces output in the form map name -> path
100_Acre_Wood -> .\100_Acre_Wood
2V2 Sand Box -> .\2v2 sand box.v0001
2v2 S_D -> .\PREMIERE MAP.v0001
2vs2 my game -> .\bob ile.v0001
[...]

Maybe it will be helpful for others too. Credits welcome! :mrgreen:

Statistics: Posted by Scrontch — 09 Sep 2013, 21:47


]]>
2013-09-09T20:54:23+02:00 2013-09-09T20:54:23+02:00 /viewtopic.php?t=5109&p=53531#p53531 <![CDATA[Re: Need help for browsing and sorting out maps]]>
Deep_ wrote:
If you open the folder of a map you will find the scenario.lua.
Open it with the notepad and you will see the name of the map immedientely


Thats taking alot of time.Too much time.

Statistics: Posted by Prince__ — 09 Sep 2013, 20:54


]]>
2013-09-09T20:18:47+02:00 2013-09-09T20:18:47+02:00 /viewtopic.php?t=5109&p=53528#p53528 <![CDATA[Re: Need help for browsing and sorting out maps]]> Open it with the notepad and you will see the name of the map immedientely

Statistics: Posted by Deep_ — 09 Sep 2013, 20:18


]]>
2013-09-08T14:50:37+02:00 2013-09-08T14:50:37+02:00 /viewtopic.php?t=5109&p=53384#p53384 <![CDATA[Re: Need help for browsing and sorting out maps]]>
But to answere your questions..,I might have an idea:
Download the unofficial map editor from hazard. If you wanna open a map it's shown with the mapname (directory path I guess) and has a picture of the map.
DL link: http://www.hazardx.com/details.php?file=76

Statistics: Posted by Prince__ — 08 Sep 2013, 14:50


]]>
2013-09-08T11:14:41+02:00 2013-09-08T11:14:41+02:00 /viewtopic.php?t=5109&p=53374#p53374 <![CDATA[Need help for browsing and sorting out maps]]> here's my problem: I have about 680 additonal third party maps installed in my maps directory. The most of it are utter crap. I want to sort them out. Problem is that the names of the map as shown in the game do not always correspond to the name of the map folder. So when i browse the maps visually from within the game, i don't always find the folder that i want to delete.

Is there any way to link the two. Ideally i would like to have a script that i run on the maps folder and gives me a list of pairs ingame-name -vs- folder-name.

Or even better, is there a way to visually browse the maps in the order of the folders, outside of the game?

Thanks,
scrontch

Statistics: Posted by Scrontch — 08 Sep 2013, 11:14


]]>