Xonotic Forums
Can Xonotic be made portable? - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Configuration Tips (https://forums.xonotic.org/forumdisplay.php?fid=19)
+--- Thread: Can Xonotic be made portable? (/showthread.php?tid=4037)



Can Xonotic be made portable? - MrDetonia - 03-27-2013

Me and a group of friends often like to play Xonotic matches during lessons in College. We all have it runnin from our USB sticks no problem, however...

Any changes we make to settings are only saved to that machine, that account. Is there a way to get Xonotic to save settings (Player info, effects, keyboard layout) directly to the USB stick, and load from there as well?


RE: Can Xonotic be made portable? - Mr. Bougo - 03-27-2013

Sure! You simply need to start the executable with the -nohome flag. I'm not sure if this specific method can be done portably, but you can use shortcuts to pass arguments. A better way follows, with a batch file calling the .exe from the .exe's original directory, with an added -nohome.

You can use the server's server_windows.bat file as a base for this. Replace "set executable=xonotic.exe" by "set executable=bin\xonotic.exe", create a "bin" directory, put the .exe in there, and remove the server.cfg file. You can also remove the "if ... goto bad" and "if ... goto halfgood" lines as well as the ":halfgood" line an the "cd" line that follows. And customize the warning message too, in case it can't find the .exe. Then, customize the last line to call xonotic.exe with -nohome.

Result:

Code:
@echo off

setlocal
set executable=bin\xonotic.exe

%~d0
cd "%~p0"

if exist %executable% goto good
goto bad

:bad
echo xonotic.exe could not be found
pause
exit

:good
.\%executable% -nohome



RE: Can Xonotic be made portable? - MrDetonia - 03-28-2013

Okay, so remove server.cfg from the server folder itself?

I have the batch file working and running Xonotic now. Thanks.


RE: Can Xonotic be made portable? - Mr. Bougo - 03-28-2013

No no, don't touch server.cfg, it has nothing to do with this script above. I just based my batch script off server_windows.bat, that is all.


RE: Can Xonotic be made portable? - MrDetonia - 03-28-2013

Okay. Thanks for the help!


RE: Can Xonotic be made portable? - Lord Galimow - 07-20-2023

Please help. Now where i need to put the bin folder?