War2.ru Slogan
News: Don't forget to join Channel: Trivia for trivia!


Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.

I wrote a Warcraft II map viewer in JavaScript 214  6

Critter Posts: 2 Karma: +0/-0 *

typhoon

  • Critter
  • *
  • Posts: 2
    • View Profile
I wrote a Warcraft II map viewer in JavaScript
« on: April 04, 2019, 12:56:50 AM »
Tested in Firefox, Chrome, and Safari. It lets you open any of the maps included with Warcraft II BNE (including campaign maps) or load maps off your computer.

http://jcfields.gitlab.io/warcraft2-map-editor/

My intention is ultimately to turn it into a full map editor, but right now, it only opens maps. It can also save map images using "Save Map as Image" under the "Editor" tab. It'll probably be a while before I implement full editing functionality, but it's fun to work on a little here and there.

The source code is available for anyone who's curious. Hopefully someone else finds it interesting or useful.
Administrator Ogre Posts: 1283 Karma: +119/-9 *****

iL

  • Administrator
  • Ogre
  • *****
  • *
  • Posts: 1283
    • View Profile
*

iL

Re: I wrote a Warcraft II map viewer in JavaScript
« Reply #1 on: April 04, 2019, 04:05:20 AM »
Excellent job, typhoon, you are great developer!

Thinking about to replace map list like this: http://www.war2.ru//map-list/thumb.html to your project!

Is there a way to open the map by url? I mean, to use query string like site-name/warcraft2-map-editor/?map=GardenOfWar.pud or w/e?
To let people give links to some map directly somewhere on forum or anywhere else?
Ogre Posts: 1191 Karma: +76/-0 *******

Lambchops

  • Ogre
  • *******
  • *
  • Posts: 1191
    • View Profile
Re: I wrote a Warcraft II map viewer in JavaScript
« Reply #2 on: April 04, 2019, 05:23:59 AM »
Nice one jc. Looks great :)
Critter Posts: 2 Karma: +0/-0 *

typhoon

  • Critter
  • *
  • Posts: 2
    • View Profile
Re: I wrote a Warcraft II map viewer in JavaScript
« Reply #3 on: April 04, 2019, 07:01:17 AM »
Is there a way to open the map by url? I mean, to use query string like site-name/warcraft2-map-editor/?map=GardenOfWar.pud or w/e?
To let people give links to some map directly somewhere on forum or anywhere else?

That's a great idea. I implemented it as you suggested, following the same file paths as given in the file browser. Some examples:

classic/Plains of snow.pud
campaign/xhuman12.pud
ladder/Garden of war BNE.pud
classic/expansion/Friends.pud

(Edit: I also added a "Link to Map" action under the "Editor" menu to generate these URLs automagically.)
Nice one jc. Looks great :)

I appreciate it! It looks like there's a wealth of information here, so I intend to stick around and absorb some things. :)
Peon Posts: 35 Karma: +0/-0 **

WarKid

  • Peon
  • **
  • *
  • Posts: 35
    • View Profile
Re: I wrote a Warcraft II map viewer in JavaScript
« Reply #4 on: April 04, 2019, 07:28:49 AM »
Really good!! Keep it up with the good work! ^-^
Sappers Posts: 863 Karma: +46/-1 ******

Szwagier

  • Sappers
  • ******
  • Posts: 863
    • View Profile
Re: I wrote a Warcraft II map viewer in JavaScript
« Reply #5 on: April 04, 2019, 11:11:45 AM »
very nice, but I see bugs in player setup, I cant scroll to yellow, or pick human for red
Death Knight Posts: 3244 Karma: +78/-2 retired, be in music section *********

easycompany

  • Death Knight
  • *********
  • Posts: 3244
  • retired, be in music section
    • View Profile
Re: I wrote a Warcraft II map viewer in JavaScript
« Reply #6 on: April 04, 2019, 06:32:52 PM »
love the sprite sheet approach  :-* for tiles