Yet Another Map Previewer

Designed a level that creates new, exciting, and challenging Armagetron game play? Or maybe just something funky. Put it right here.
Post Reply
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Yet Another Map Previewer

Post by wrtlprnft »

This time as a user JS for opera :)

This little script will try to detect if the page you're currently viewing is a map file, and if it is it will render it as SVG and display it. Screenshot

It might work in FF/greasemonkey, too, just too lazy to wait for firefox to start up and then search for that extension, restart FF again and all that… It shouldn't use anything opera specific, anyways.

To install (if you haven't used userJS before): Create a new directory somewhere and save the script in it. Then enter opera's preferences (alt-p) and go to Advanced→Content→JavaScript options. At the very bottom of that dialogue, select the directory the script is in. Enjoy :)

Maybe I'll extend it one day to parse v2 zones and shapes :)
There's no place like ::1
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Small change: Maps are now displayed with their y-coordinate flipped, so they look the same in arma, opera and nemo's map previever.
There's no place like ::1
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

A couple of changes:
  • It's compatible with greasemonkey now. If you have it installed it should prompt you if you follow this link
  • Spawns are now represented as lines with a marker at the end instead of a path representing an arrow. This enables svg2aamap to parse them.
  • If you click on the preview it will take you to a data: URI pointing to the rendered SVG. This means you can click on the image, then save the file, and you'll get an SVG file you can open in inkscape
Zones are exported as circles, so svg2aamap won't be able to convert them back yet :(
There's no place like ::1
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

http://wrtlprnft.ath.cx/zonesv2preview.png

Very crude previews for zonesv2 maps. It doesn't know about rotation or monitors or any of that fancy stuff yet, just circles, polygons, colors and the scale attribute, and even that is probably not complete. Still gives you a fairly good idea of a map :)
There's no place like ::1
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

http://wrtlprnft.ath.cx/hammertime1.png

Polygonal zones are now always closed and it respects the alpha component of colors. You can download the new script using the link in the first post.
There's no place like ::1
User avatar
dlh
Formerly That OS X Guy
Posts: 2035
Joined: Fri Jan 02, 2004 12:05 am
Contact:

Post by dlh »

I've modified it slightly to make a bookmarklet (bbcode couldn't handle it...) that works in Safari. To use it drag it to your toolbar, and open up a map file in Safari, and click the toolbar map-preview link.

wrtlprnft: Could you put this code in SVN? The core code is the same, except for the bookmarklet you don't add an event listener to the window. So the common code could be moved to it's own file, and the resulting products could just be generated.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

Done. Feel free to modify/beautify/unhackify (that's why i didn't commit it before)/bookmarketify it ;-)

EDIT: 0x500 posts!
EDIT²: this equals the number of pixel columns my screen has ;-)
There's no place like ::1
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

wrtlprnft wrote:EDIT: 0x500 posts!
EDIT²: this equals the number of pixel columns my screen has ;-)
Proof that I need a larger screen desperately! Mine ix 0x500 by 0x356 (converted from decimal in my head).

nemostultae = dlh? Initials? I noticed another name change lately, but that one only changed capitalization.
User avatar
wrtlprnft
Reverse Outside Corner Grinder
Posts: 1679
Joined: Wed Jan 04, 2006 4:42 am
Location: 0x08048000
Contact:

Post by wrtlprnft »

/me wonders if Jonathan's dec→hex conversion is accurate.

dlh has been nemo's IRC name for some time before the forums rename…
There's no place like ::1
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6712
Joined: Thu Dec 18, 2003 7:03 pm

Post by Tank Program »

Jonathan wrote:I noticed another name change lately, but that one only changed capitalization.
OR WAS IT?????
Image
User avatar
Z-Man
God & Project Admin
Posts: 11717
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Post by Z-Man »

It was a misunderstanding :/
epsy
Adjust Outside Corner Grinder
Posts: 2003
Joined: Tue Nov 07, 2006 6:02 pm
Location: paris
Contact:

Post by epsy »

Jonathan wrote:I noticed another name change lately, but that one only changed capitalization.
haha
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

wrtlprnft wrote:/me wonders if Jonathan's dec→hex conversion is accurate.
It is. I just happen to have a weird resolution. Aspect ratio is approximately 3/2, FYI.
Post Reply