PDA

View Full Version : Script to "Fix" Mapfiend Maps



I<3EQ
03-02-2006, 03:42 PM
I use the default black background for the SEQ map window and most of the new Mapfiend maps use black lines. This makes me grumpy so I wrote the following little script:



#!/bin/bash
perl -pi -e "s/, 0, 0, 0/, 255, 255, 255/g;" *
perl -pi -e "s/, 0, 0, 0/, 255, 255, 255/g;" *


Just put it that in a file in your maps folder, make it executable (chmod u+x it), and run it with no arguments. It'll make the maps a bit more SEQ-friendly and hopefully not screw up anything else (labels, etc.)

And yeah, I know the regular expressions suck and that I could write it so that it only has to do one pass. The script works, though, and I hate writing those things so I'm content with how it is.

ksmith
03-02-2006, 04:31 PM
#!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/;

I<3EQ
03-02-2006, 04:42 PM
Show off. :p

uRit1u2CBBA=
03-03-2006, 07:48 AM
I did color conversion script from the point of view that the map has already been converted into SEQ format. I call it recolor.sh


perl -pe 's/#000000/grey100/g' $1

used like:
./recolor.sh hateplaneb.map

and yes, regular expressions suck :) I never understood them, even in college when I was supposed to.

purple
03-03-2006, 08:49 AM
grey100 looks better to me at least. That's what I use too.

OgerSEQ
03-03-2006, 02:55 PM
#!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/;


Black to black? :D

Cryonic
03-03-2006, 10:03 PM
Black to White

ksmith
03-06-2006, 02:33 AM
Black to black? :D

Never trust documentation!

ksmith
03-06-2006, 02:38 AM
I did color conversion script from the point of view that the map has already been converted into SEQ format. I call it recolor.sh


perl -pe 's/#000000/grey100/g' $1

used like:
./recolor.sh hateplaneb.map

and yes, regular expressions suck :) I never understood them, even in college when I was supposed to.

Aww, give regular expressions a chance. They're amazingly useful/powerful.

It's nice to see that hateplaneb.map still gets some love, even if it's just in examples.

uRit1u2CBBA=
03-18-2006, 10:00 AM
I thought someone would appreciate me using that as an example. It's one of the best drawn maps in the game, and by far the largest of all the map files :) And also seems to be the hardest to get a hold of when someone reformats and goes "oh shit, I don't have that map anymore" :)

Cryonic
03-24-2006, 12:10 AM
This is a test... just ignore it

Fatal
03-24-2006, 06:52 PM
The hateplaneb map is the only one actually generated from the zone file. it is also the reason the scripts were written to optimize maps. If I recall correctly,the original version of that map was like 11 megs.