home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Double-click to open map in windows!

by demosthenes on 04/21/2007 07:10, 7 messages, last message: 04/23/2007 09:00, 1095 views, last view: 04/24/2024 20:11

Tonight I decided that I wanted to be able to double-click on a sauerbraten anywhere and have my system launch into Sauer on that map. To do this, I made a batch file that copies the map, along with any other files with the same name (so it grabs jpg and cfg, too! and copy them to a folder inside the package tree, so that we can actually open them. The batch file then launches Sauer with the -l parameter pointing to the map.

//Begin batch file text:
xcopy "%~dpn1.*" "E:\Program Files\Sauerbraten\packages\launch\" /C /Y
E:
cd E:\Program Files\Sauerbraten
sauerbraten.bat -llaunch\%~n1
//End batch file text

It's four lines, and I hope it doesn't break too badly. Then I just associated the filetype (using the always-open-with part of the unknown file open dialog) with the batch file, and now when I double-click on a map, it copies to the launch folder and starts that map.

It also automatically replaces any copies of the map already in the folder and suppresses any errors, so if you got a new version of the map, you'd just have to double-click it again and the launch folder would stay updated.

I guess you'd just move the files to base later. I used a separate directory to prevent automatically overwriting your "real" copy of the map.

What do you all think?

   Board Index   

#1: ..

by Der/Nalia on 04/21/2007 17:26

hahaha.. Mac OS X already does this... wii

reply to this message

#2: ..

by w4 on 04/21/2007 21:15

Yea why is the windows version like 100 times harder to do things with. I cant even open the .cfg file without them being in all symbols. Text edit is so much better.

reply to this message

#3: Re: ..

by |1PF|ConorKirk on 04/21/2007 21:51, refers to #2

Open the CFG with WordPad, then the symbols are fixed.

reply to this message

#4: Re: ..

by HydraPheetz on 04/22/2007 01:33, refers to #2

Some of them will use UNIX-style newlines (\n) as opposed to whatever way Windows uses newlines (\r\n)

reply to this message

#5: ..

by Quin on 04/22/2007 02:19

Use a new-line neutral editor. I use editpad lite, mostly because it is lightweight, has tabs, and does this.

reply to this message

#6: tw4tw4t

by Eris on 04/23/2007 07:09

TED notepad is also very good

reply to this message

#7: Notepad :D

by tentus_ on 04/23/2007 09:00

I use notepad for everything... love being able to cram so much text on my screen. If it initially doesn't recognize the characters made by other editors, jump over to wordpad for a single CTRL+S, and that'll put things back to the universal set, and notepad is bliss from there. Depending on your document size, it takes up less memory than CTRL+ALT+DEL does :)

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53863226 visitors requested 71638334 pages
page created in 0.017 seconds using 10 queries
hosted by Boost Digital