ec- / Quake3e

Improved Quake III Arena engine
GNU General Public License v2.0
1.22k stars 153 forks source link

Clarification needed: Why fs_homepath is write protected? #251

Closed xplshn closed 1 year ago

xplshn commented 1 year ago

What does that error mean? I wanted to change the folder to which the user config is saved in my Flatpak of OpenArena, and it resulted in this error when I changed the CVAR fs_homepath.

ec- commented 1 year ago

Set it from command line by adding +set fs_homepath <path> as it is not allowed to change such parameters at runtime

xplshn commented 1 year ago

I did just that, the error that kept coming was "fs_homepath is write protected."

xplshn commented 1 year ago

We currently use this patch in our engine:

diff --git a/code/unix/unix_shared.c b/code/unix/unix_shared.c
index 8a988ba0..8b491239 100644
--- a/code/unix/unix_shared.c
+++ b/code/unix/unix_shared.c
@@ -414,7 +414,7 @@ const char *Sys_DefaultHomePath( void )
 #ifdef MACOS_X
        Q_strcat( homePath, sizeof(homePath), "/Library/Application Support/Quake3" );
 #else
-       Q_strcat( homePath, sizeof( homePath ), "/.q3a" );
+       Q_strcat( homePath, sizeof( homePath ), "/.openarena" );
 #endif
        if ( mkdir( homePath, 0750 ) ) 
        {

But we need to be able to point the homepath to another folder in order to run some mods and different games. Could it be because of the patch? I'm not familiar with how the Quake3 engine handles things internally.

The-Gig commented 1 year ago

I'm sorry I can't help with your patch, but I guess if it changes homepath stuff it may be involved... For how the engine "normally" works, you can specify the homepath (settings and autodownloads folder) from OS command line (not from the game "console"!) when launching the game, an example in Windows would be something like quake3e.exe +set fs_homepath "c:\myfolder\myhomepath" You can automate it by using a customized shortcut or batch file in Windows, or a shell script in Linux, to avoid typing it every time. In the original game and in quake3e, by default homepath is the same as basepath (the directory where the executable is), while in other versions of the engine (ioquake3, openarena, etc) homepath has been moved to an user-specific folder by default (IIRC, to tell them to use the same as basepath you can type like _+set fshomepath ./ there)

See also https://github.com/ec-/Quake3e/issues/167

ensiform commented 1 year ago

Are you using +set fs_homepath "blah" only on the command line? Because this is the only place it can be set as it is before the filesystem is loaded.

If the message is still appearing either you're missing +set or somehow it's not being processed during startup args like a normal process or you entered it in game console which is too late.

FYI your patch also skipped macos openarena folder.

xplshn commented 1 year ago

Yes, only in the starting script for my flatpak have I added the CVAR, using +set.