One click map testing within Spark

MendaspMendasp I touch maps in inappropriate placesValencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
edited August 2013 in Mapping
There are two tools in this thread now:
  • LaunchMap: For quick testing. It will copy your map in the correct folder, generate the overview for your map and launch NS2 with it.
  • ZipMap: For packaging your map for distribution. It will ask for the final map name so you can have your own version control different from the main publishing one. It will generate a zip file with your level and overviews on your desktop with the specified name. Any further custom content has to be included manually.


LAUNCHMAP
Download this file and unzip it anywhere you want. I have it in my maps folder.

These are the contents of the LaunchMap.bat file:

CODE
copy %1 ns2\maps /Y
Overview.exe %1 ns2
start NS2.exe map %2

As you can see it's not overly complicated.

Now, open Spark and go to Tools -> External Tools. Set a Title for your "Tool", I have it set to Test Map.
In Command, select your .bat file.
In Arguments, you need to put this (WITH quotes): "$(ItemPath)" "$(ItemFileName)"

It has to look like this.
image

As you can see, I have a separate one that's just Install Map, it's a second batch file without the last line, so it doesn't launch NS2 again in case I have it launched already...

ZIPMAP
I have another "tool", it's the ZipMap utility, which will make a compressed zip with your map file and the overview and set the name that you prefer. For example, you can be working on ns2_mymap_test_alpha_2012.level but want to release it as ns2_mymap (or the other way around). You can generate the zip with the map name that you want and all the files will have the correct names. The zip will automatically appear on your desktop.

This one is a little more complex as it involves 3 files, unzip all the files to a folder of your choosing, and then do the same as with the LaunchMap batch file, but in this case, you have to use ZipMap.bat.

Now for maximum awesome, you can go to Tools -> Settings and you can assign a keyboard shortcut to this new tool. So I usually press Ctrl+T when I want to test my map and I have it ready to go with a freshly generated overview :)

Hopefully this helps people :)
Post edited by Mendasp on
ApdordragonmithCarNagE1eliotmat2d0xGibsMaxzzzzzz
«13

Comments

  • SkieSkie Skulk Progenitor Join Date: 2003-10-18 Member: 21766Members, NS2 Playtester, Reinforced - Shadow Posts: 656
    Cool, thanks.
    Mendasp for Mayor of Imagespamville.
  • FunkyFungusFunkyFungus Join Date: 2003-09-09 Member: 20691Members Posts: 609
    edited July 2012
    Nice !!!




    Thanks :)


    Edit: can anyone web this ? ;)
    Post edited by Unknown User on
    -Remember, If The World Didn't Suck, We'd All Fall Off -

    l..l,

  • AngeluszAngelusz Harmonic entropist Join Date: 2003-07-10 Member: 18072Members, Forum Moderators, Constellation, NS2 Playtester Posts: 2,601 mod
    Cheers Mendasp, stickied for awesomeness! :)
  • AngeluszAngelusz Harmonic entropist Join Date: 2003-07-10 Member: 18072Members, Forum Moderators, Constellation, NS2 Playtester Posts: 2,601 mod
    Question! Where must the map file be saved for the editor to pick it up? I've got a custom filepath and it doesn't work.
  • IndustryIndustry Esteemed Gentleman Join Date: 2010-07-13 Member: 72344Members, Reinforced - Shadow, WC 2013 - Supporter Posts: 698
    QUOTE (Angelusz @ Jul 4 2012, 06:32 AM) »
    Question! Where must the map file be saved for the editor to pick it up? I've got a custom filepath and it doesn't work.


    It can be anywhere, the problem you are running in to is most likely that there are spaces in the name of one of the folders in the path where it is saved. (e.g. c:\Program Files\ <---- the batch won't like that space).
    THE IP ADDRESS IS COMING FROM INSIDE THE HOUSE.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    edited July 2012
    Yeah, I just took a look at the problem and it's simple to solve, you have to enclose the arguments in External Tools in quotes. I'm updating the first post to reflect this.
  • brechtosbrechtos Belgium Join Date: 2008-04-18 Member: 64100Members, Reinforced - Gold Posts: 63
    In order for it to launch the actual level you need to either leave the quotes in the arguments:

    CODE
    "$(ItemPath)" $(ItemFileName)


    or change the batch file so it isn't using quotes allready

    CODE
    copy %1 ns2\maps /Y
    Overview.exe %1 ns2
    start NS2.exe map %2


    Nice Batch Mendasp!;)
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    edited July 2012
    I'm not sure why it has quotes there, considering the copy I use which is slightly different doesn't use them... so I'm gonna opt for dropping the quotes in the bat. Thanks for letting me know :P

    QUOTE (brechtos @ Jul 5 2012, 11:50 AM) »
    Nice Batch Mendasp!;)

    That's a bit of an overstatement, considering what the batch file does, hah. The only notable thing was finding out the arguments thing for the editor, which I think was because it's in the help file, somewhere.
  • remiremi remedy [blu.knight] Join Date: 2003-11-18 Member: 23112Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester Posts: 2,689 admin
    You actually need the quotes in both places to ensure that it works even if the map's path includes spaces. (Otherwise it gets confused about what the second argument is)
    [ Rek | Reklys | remedy | remi.D | blu.knight | Psyke | Sky ]
    I have way too many names.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    edited July 2012
    QUOTE (Psyke @ Jul 10 2012, 04:58 AM) »
    You actually need the quotes in both places to ensure that it works even if the map's path includes spaces. (Otherwise it gets confused about what the second argument is)

    The bat file receives the arguments enclosed in quotes this way, so they're fine, no need to have double quotes (Editor quotes + bat quotes). The problem before is that if the argument had spaces, the bat file would interpet this as more than 2 arguments, as the arguments are separated by spaces.

    The way it's setup right now will execute:
    CODE
    start NS2.exe map "asd df"


    If you add quotes in the bat (so you have it both on the bat and in spark) you will get
    CODE
    start NS2.exe map ""asd df""


    Which Spark won't know what the hell is going, in fact it returns:
    CODE
    Error: Map 'maps/.level' doesn't exist


    You can see what it does if you open the Output Window in Spark (Window -> Output), and see how it's running. You will notice how it's already retaining the quotes passed from the arguments.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members Posts: 1,731
    Doesn't work for me, doesn't even copy the map.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    Could you give more details? Path where your map is stored? Output (Window->Output), how you set it up in the External Tools section.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members Posts: 1,731
    Ok, it works, now, there was a space into the path of my bat file.

    Funny how modern computer software can't even handle spaces properly :)
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    edited July 2012
    I have included InstallMap.bat to the LaunchMap zip file in the first post.

    I've also added a new tool to this list of "tools", it's the ZipMap utility, which will make a compressed zip with your map file and the overview and set the name that you prefer. For example, you can be working on ns2_mymap_test_alpha_2012.level but want to release it as ns2_mymap (or the other way around). You can generate the zip with the map name that you want and all the files will have the correct names. The zip will automatically appear on your desktop.

    This one is a little more complex as it involves 3 files, unzip all the files to a folder of your choosing, and then do the same as with the LaunchMap batch file, but in this case, you have to use ZipMap.bat.

    I'm editing the first post and including this information, maybe a new title for the thread is needed now? :P
  • MoochieMoochie Join Date: 2011-10-18 Member: 128058Members Posts: 23
    What do I need in my map for me to use this? Launch map and everything seems to work but when I get into the game my whole screen is black and just says the build version at the top left.
    [LGD] Moochie www.Legend-Clan.net
    www.twitch.tv/legendclan - Game Play, Live Mapping
  • AzaralAzaral Join Date: 2012-11-19 Member: 172408Members Posts: 208
    Link for download isn't working. What exactly do I have to have in my map in order to actually launch and run around in it?
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    edited January 2013
    Sorry, my site was down (DNS changed -- it needs some time before the change propagates), it should be working again shortly.

    The minimum requirements for a map to be working in Spark are:

    • Location entities enclosing your rooms
    • At least 2 tech point rooms (one for marines, one for aliens) -- these should also include power_point entities.
    • ns2_gamerules
    • pathing_settings
    • readyroom_start, if it's missing you'll spawn at map origin (0,0,0).
    • minimap_extents enclosing your entire map (otherwise commander mode/minimap won't work).


    You might also want to include at least 1 commander_camera so you can test the commander view...
    Rudy.cz
  • PandademicPandademic Join Date: 2013-02-26 Member: 183359Members Posts: 99 Fully active user
    Just tried this, it's absurdly helpful getting started. Thank you!
  • ApdorApdor Join Date: 2013-03-06 Member: 183735Members Posts: 11
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver Posts: 528 Fully active user
    What arguments can you get from the spark editor?
    I see lvlname, path, other things, too?
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    If you go to Tools -> External tools you can see them by clicking on the ">" button on arguments, it lists: item path, item directory, item file name and item extension.
  • DoomToasterDoomToaster Join Date: 2013-04-03 Member: 184619Members Posts: 3
    Hi, this is my first post but I need to know if I set everything up right. First let me say that when I try to test my map NS2 stops responding, I had a conclusion that it is probably from a lack of interwebs, but I'm not sure. My file path to the Launchmap.bat is thus:

    C:\progam files (x86)\steam\steaapps\common\natural selection 2\ns2\maps\map tools\launchmap.bat

    And the arguments is set up the way you said like so: "$(ItemPath)" "$(ItemFileName)"

    But alas it won't start I have even tried loading one of the maps the devs made, because their maps are made properly and even then NS2 stops responding. So I would appreciate any help that would help me resolve this issue. Thank you
  • PandademicPandademic Join Date: 2013-02-26 Member: 183359Members Posts: 99 Fully active user
    @doomtoaster Do you get errors in the console while the map attempts to load? When does it freeze? Can you load the map manually (enter console in game and type "map ns2_x), without using launchmap?
  • DoomToasterDoomToaster Join Date: 2013-04-03 Member: 184619Members Posts: 3
    Pandademic wrote: »
    @doomtoaster Do you get errors in the console while the map attempts to load? When does it freeze? Can you load the map manually (enter console in game and type "map ns2_x), without using launchmap?

    Sadly I don't know if there are errors NS2 just stops responding during the "starting local server" when the blue loading circle comes up. I would like to use the console to see if there are but I end up having to shut it down using task manager and yes I tried the console way of loading and it seems to work the console says it loaded the map but it never actually let's me play in the server (probably internets is needed) but when loading from the editor it crashes every time. So I was just wanting to know if I set it up correctly.

    (Also they should make an offline play available but that's just an opinion)
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer Posts: 4,177 Advanced user
    Yes, internet connection is required to test maps.
  • DoomToasterDoomToaster Join Date: 2013-04-03 Member: 184619Members Posts: 3
    Yeah I found out when I went to friends house and used his internet. It works now so at least I did set it up correctly.
  • 2d0x2d0x Join Date: 2013-03-16 Member: 184030Members, Reinforced - Supporter Posts: 104 Advanced user
    thanks for LaunchMap :)
    ps sorry for bad english

    imgdev.php?id=2d0x
  • diry1996diry1996 Join Date: 2013-07-04 Member: 185920Members Posts: 9
    I could use some help as well. I installed the launch map tool, but it only launches ns2. It only places me at the main menu screen.
  • diry1996diry1996 Join Date: 2013-07-04 Member: 185920Members Posts: 9
    The filename, directory name, or volume label syntax is incorrect.
    C:\Program Files (x86)\Steam\SteamApps\common\Natural Selection 2>copy "$C:\Users\Guest\Documents\""ns2_test.level" ns2\maps /Y
    $C:\Users\Guest\Documents\ns2_test.level
    0 file(s) copied.

    C:\Program Files (x86)\Steam\SteamApps\common\Natural Selection 2>Overview.exe "$C:\Users\Guest\Documents\""ns2_test.level" ns2
    Usage: overview.exe Outputs .tga and .hmp into (output dir)\maps\overviews
    C:\Program Files (x86)\Steam\SteamApps\common\Natural Selection 2>start NS2.exe map
    Output completed - Normal Termination

    Continued from previous post:

    above I have copied the output text as you can see I am getting a syntax error
  • QwiXXeRQwiXXeR Join Date: 2004-11-05 Member: 32640Members Posts: 141 Fully active user
    Looks like an issue with your Quotes. Mind giving us a screenshot of your external tools and a paste from whats in your bat file :)
    Sig image removed. Sig images must be no more than 400x75 pixels and no more than 22kb in size. No exceptions. -BobTheJanitor

    ^^ - Bob removed my siggy :(
«13
Sign In or Register to comment.