A ( Truly )Standalone BYOND Project
I went back down memory lane to look at some methods for turning py2exe executables into completely standalone .exe files. I took a look at this page and realized that, with a bit of tweaking, I could use the NSIS script on that page to do what I want! I followed up on the thought, and put it to use and managed to make a completely standalone exe for my game!
The steps to turn your game into a standalone exe file:
1. Create a New Folder any where. ( I usually put it on my desktop for quick access )
2. Create a New Folder in the Folder we created in step 1
3. Paste all the BYOND binary files ( found in the [BYOND Installation Directory]\bin folder ) into the New Folder we created in Step 2. After that, paste your game's .dmb and .rsc files into this folder too.
4. Open notepad, and paste the following line in:
"%cd%\dreamseeker" "%cd%\[NAME OF YOUR GAME'S DMB].dmb" |
Be sure to replace [NAME OF YOUR GAME'S DMB] before saving this file. After that, go to File -> Save As -> Name the file 'game.bat' ( We will need this name later on ) and save it in the folder we created in Step 1.
5. Download NSIS.
6. Open notepad, and paste in the following script:
; dataDirectory is the path of the directry where ; the BYOND Binary files and your game's resources ; and dmb file will be stored in. The folder made in Step 2. !define dataDirectory 'tt' ; This is the name of the .bat file which runs your game. ; You will not need to change this if you followed step 2 !define exe 'game.bat' ; Comment out the "SetCompress Off" line and uncomment ; the next line to enable compression. Startup times ; will be a little slower but the executable will be ; quite a bit smaller SetCompress Off ;SetCompressor lzma ; It doesn't matter what you name this variable. Name 'MyGame' ; This is the name of the final exe file that ; will execute your game. OutFile 'TreasureTurner.exe' ; This variable will make sure that NSIS ; will not show itself when your game's .exe is run SilentInstall silent ; This is the icon of your game's .exe ; The icon must be in the same directory as this script. ; Uncomment in order to specify an icon for your .exe ;Icon 'icon.ico' ; You don't need to touch this part. Section InitPluginsDir SetOutPath '$PLUGINSDIR' File '${dataDirectory}\*.*' nsexec::exec '${exe}' SectionEnd |
Read through the script, and make changes as needed.
Save this file as 'setup.nsi' in the folder we created in Step 1.
7. Right click on setup.nsi and select 'Compile NSIS script'. This should Compile the script successfully, and make a new .exe file in the same directory as your script.
And there you have it, you have your BYOND Game, packaged neat and tidy in an easy to use executable file!
There are some questions that might arise for you after reading this post. I'll answer some of the likely ones below. Post your other questions in the comments of this post.
Q: How will players log in to a game without their BYOND Key?
A: BYOND will allow them to log in using their guest key with no extra work on their end.
Q: Ok, but that still won't help when I want to update their scores/give them medals on my hub!
A: This is one of the flaws in the plan that can be easily covered up. Simply ask players to enter a 'Screen Name' at the beginning of your game and use that screen name for scores/medals.
Q: How would I go about saving/loading save files this way? Wouldn't they be deleted since they're in a temp directory?
A: This is one of the big flaws in the plan. I don't have any workarounds for this, but you could always distribute your game in a .zip file and tell the user to execute your .bat in order to run the game. This way, savefiles will stay intact.
Q: Do we have to include ALL of the BYOND bin files? Even Dream Maker?
A: Of course you don't, but I'm not eactly sure which bin files are ok to delete and which aren't so I just let them all stay there. Safe to say though that deleting dream maker won't do any harm.
Posted by Metamorphman on Thursday, September 03, 2009 07:32AM
- 10 comments
(link)
/
Keywords:
development
(Edited on Thursday, September 03, 2009 11:57AM)








#7 Metamorphman:
Stephie wrote:
> HI META! I am on your page stealing your cookies!!
D:
Wednesday, September 30, 2009 09:08AM
#6 Stephie:
HI META! I am on your page stealing your cookies!!
Wednesday, September 30, 2009 09:04AM
#5 Pmitch:
Hey Meta, IM me on MSN asap please.
Pmitch2@hotmail.com
Sunday, September 20, 2009 05:33PM
#4 Yash 69:
Metamorphman wrote:
> Too bad. I drank it all. :P
omg i wanted a drop atleast
Wednesday, July 29, 2009 12:14PM
#3 Metamorphman:
Too bad. I drank it all. :P
Tuesday, July 28, 2009 10:00PM
#2 Yash 69:
Metamorphman wrote:
> Yo ho ho and a bottle of rum
Can't wait to open it for some Fun!
Tuesday, July 28, 2009 09:59PM
#1 Metamorphman:
Yo ho ho and a bottle of rum
Thursday, July 23, 2009 12:55PM