Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Create maps script

  1. #1
    Registered User
    Join Date
    Mar 2007
    Posts
    2

    Create maps script

    Here a quick script I wrote to combine the layers and convert black liines to gray. Just download all the maps you want from mapfiend and run this on your windows box and it will create a new folder where ever you run it from and place a combined layer map for each zone in that folder.

    Code:
    ' Combines layers and converts black lines to Grey
    
    Dim sZone
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    ForReading = 1
    
    'You can comment out the line below and then uncomment the next 
    'line and put a path in if you wish to set the path static.
    Path = InputBox("Enter the path to the maps directory.", "path to Maps", "")
    'Path = "C:\Documents and Settings\user\Desktop\test"
    
    Set Folder = FSO.GetFolder(Path)
    Set ColFiles = Folder.Files
    
    if fso.folderexists("New Maps") then
        wscript.echo "New Maps Folder already exist."
        WScript.quit
    End If
    
    Set NewFolder = fso.CreateFolder("New Maps")
    
    For Each myFile in ColFiles
        sExtension = mid(myFile, inStr(myFile, ".") + 1, 3)
        if sExtension = "txt" then
    
            strPath = myFile.Path
            Set Test = fso.GetFile(strPath)
    
            If Test.Size > 0 Then
                Set myFile = fso.OpenTextFile(strPath, ForReading)
                strContents = myFile.ReadAll
    
                if inStr(test.Name, "_") > 0 then
                    sZone = left(test.Name, inStr(test.Name, "_") - 1)
    
                    If fso.FileExists("New Maps\" & sZone & ".txt") Then
                        Set OutFile = fso.openTextFile("New Maps\" & sZone & ".txt", 8)
                    Else
                        Set OutFile = fso.CreateTextFile("New Maps\" & sZone & ".txt", 1)
                    End If
    
                    OutFile.Writeline(replace(strContents, "0, 0, 0", "128, 128, 128"))
                    OutFile.Close
                End If
            Else
    '            Wscript.Echo strPath & " is empty."
            End If
        End If
    Next
    
    WScript.quit
    purple: Added code tags for readability
    Last edited by purple; 03-27-2007 at 06:29 AM. Reason: Added code tags for readability

  2. #2
    Registered User
    Join Date
    Jul 2004
    Posts
    329

    Re: Create maps script

    Might be wrong here, but too bad you picked a programming language that most showeq people and showeq-map people won't be able to use.

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    118

    Re: Create maps script

    Wouldn't you just save it and then run wscript?


    To Run Scripts Using the Windows-Based Script Host (Wscript.exe)
    1. At a command prompt type wscript.exe, and then press ENTER.
    2. Set the script host properties you want, and then click OK.
    3. In Windows Explorer or My Computer, double-click the script file you want to run.
    NOTE: If you double-click a script file whose extension has not yet been associated with Wscript.exe, an Open With dialog box appears, prompting you for the program that should be used to open the file. After you choose Windows Based Script Host (wscript.exe), if you select the Always use this program to open these files check box, Wscript.exe is registered as the default program for all files having the same extension as the one you double-clicked.

    You can also set properties for an individual script by right-clicking a script file in My Computer or Windows Explorer, clicking Properties, and then clicking the Script tab.

    ?

  4. #4
    Registered User
    Join Date
    Mar 2007
    Posts
    2

    Re: Create maps script

    To run just save the code as a .vbs file (vbs files can be dangerous) and double click it. pretty much anyone that plays EQ runs it on a win2k or winXP box. WSH is installed by default on XP and I think it was on 2K also. I wrote it for windows because I download the maps to my gaming box to use in game and when the seq is not available to me. Converting them on the windows box and then scp'in them takes less effort than to download them twice. and it may be friendlier to our windows community( I work in linux all day everyday ). I'll try to do a quick bash script and post it when i get the time.

  5. #5

  6. #6
    Developer
    Join Date
    Jul 2004
    Posts
    920

    Re: Create maps script

    The first script you linked turns grey0 to black in the showeq maps available from mapfiend. Except mapfiend doesn't make available showeq maps any longer. So that's useless.

    Your second, third, and fourth links turn an EQ map into a showeq map. This is all well and good, but not at all what the script in this thread does.

    None of them do what the original post in this thread does, which is to take multiple EQ maps (for the 4 separate layers in the EQ map window) and combine them into one layer while changing black lines to be 128, 128, 128 (a darkish gray). This combined map is then suitable for running through the above linked awk scripts or just opening directly in showeq, which will convert EQ maps to showeq maps. The benefit of the awk scripts is batchability.

  7. #7
    Registered User
    Join Date
    Aug 2006
    Posts
    16

    Re: Create maps script

    Thanks for the script, bond007.

    Would I be correct that after running this the files just have to be copied to /usr/share/showeq/maps and renamed to *.map thus?
    Code:
     cd /usr/share/showeq/maps
     for x in `ls *.txt | cut -d '.' -f1`
      do
      mv $x.txt $x.map
      done
    Last edited by Chains20; 04-19-2007 at 01:50 PM.

  8. #8
    Registered User
    Join Date
    Dec 2001
    Posts
    118

    Re: Create maps script

    You don't have to rename it. You just move it to you map folder or point seq to where your maps are now.

    I would recommend optimizing the map after you combine them. SOE supplies base level maps for some zones and it is basically an exact clone of the layer 1 maps from Mapfiend. Map files are big enough as it is due to SOE's automap feature. No point in having a complete second map in there.

  9. #9
    Developer
    Join Date
    Nov 2007
    Posts
    539

    Re: Create maps script

    I took the vbs script a step further. I had problems with it not working right. So I made it combine the layers of SOE maps, and convert them to SEQ format.
    Just unzip it to a folder with the maps you are converting, and run it. Its a windows VBScript.

    Enjoy

    Razzle
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    Jun 2003
    Posts
    550

    Re: Create maps script

    Does that handle the black lines to white? I may take that as pseudo-code and write something in C for myself that's a little easier to use than the perl script I've been using to re-color (and using SEQ to convert the maps).

  11. #11
    Developer
    Join Date
    Nov 2007
    Posts
    539

    Re: Create maps script

    It handles black to white. I was just playing with wscript when I did it. I will convert it over to c if I get a chance.

    Razzle

  12. #12
    Did you SEQ today? BlueAdept's Avatar
    Join Date
    Dec 2001
    Posts
    2,008

    Re: Create maps script

    Holy old threads batman....

    This is probably the simplest script to convert the maps. It was done by ksmith

    Code:
    #!env perl -pi
    
    # Description: Converts black lines and points in EQ-style maps to black.
    # Usage: whitelines.pl file [file2 file3 ...]
    
    s/(,\s*0){3}(\s*)$/, 255, 255, 255$2/;
    Last edited by BlueAdept; 01-02-2008 at 11:11 AM.
    Filters for ShowEQ can now be found here. filters-5xx-06-20-05.tar.gz

    ShowEQ file section is here. https://sourceforge.net/project/show...roup_id=10131#

    Famous Quotes:

    Ratt: WTF you talkin' about BA? (Ok.. that sounds like a bad combo of Diffrent Strokes and A-Team)

    Razzle: I showeq my wife

  13. #13
    Registered User
    Join Date
    Jun 2003
    Posts
    550

    Re: Create maps script

    yeah, I use a variant of that for changing colors - but it would be nice to have a one-step conversion utility to go from EQ maps to SEQ maps. Right now, it's about a 3 or 4 step process.

  14. #14
    Did you SEQ today? BlueAdept's Avatar
    Join Date
    Dec 2001
    Posts
    2,008

    Re: Create maps script

    other than changing black to white, what else do you need it to do?

    For me it was a one step process. I just have all the 1's, then run the perl script on *.txt
    Filters for ShowEQ can now be found here. filters-5xx-06-20-05.tar.gz

    ShowEQ file section is here. https://sourceforge.net/project/show...roup_id=10131#

    Famous Quotes:

    Ratt: WTF you talkin' about BA? (Ok.. that sounds like a bad combo of Diffrent Strokes and A-Team)

    Razzle: I showeq my wife

  15. #15
    Registered User
    Join Date
    Jun 2003
    Posts
    550

    Re: Create maps script

    I had run it through SEQ to re-format the maps in that format in addition to color changing.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

You may post new threads
You may post replies
You may post attachments
You may edit your posts
HTML code is Off
vB code is On
Smilies are On
[IMG] code is On