quakejs icon indicating copy to clipboard operation
quakejs copied to clipboard

Save/load config in localstorage

Open thecyberd3m0n opened this issue 7 years ago • 9 comments

I think it's important to remember player's config changes in browser. It's highly annoying when I must redefine controls, player name and graphics each game...

thecyberd3m0n avatar Aug 10 '17 10:08 thecyberd3m0n

I see in logs it has "virtual filesystem" undernear. How we can access it outside ioq3?

thecyberd3m0n avatar Aug 10 '17 20:08 thecyberd3m0n

The project mounts an IDBFS instance at startup (which ideally should persist config changes): https://github.com/inolen/ioq3/blob/master/code/sys/sys_browser.js#L295

inolen avatar Aug 10 '17 20:08 inolen

I used build from quakejs site with own server. Each player was connected as UnnamedPlayer, because there was no way to store his configuration. Build from github just didn't work. I'll do some additional analysis later, and give you some logs. Anyway, how can we access the filesystem deployed by that virtual machine outside of it? Is there any public API? I think that would be useful for adding features to Quake ;)

thecyberd3m0n avatar Aug 11 '17 07:08 thecyberd3m0n

Is there any update on this? I have boiled down my client settings to a bunch of commands but I can't even copy / paste those into the browser for some reason, making it annoying. It would be awesome if I could just copy the 10 lines directly into the quake console and hit enter, but that's not possible.

jsphweid avatar Dec 01 '18 02:12 jsphweid

You can edit .pk3 and add your config there and then run \exec <your_config>. That's one thing. I am working on saving feature... but this may take time, IDBFS is new to me.

ENT108 avatar Apr 22 '20 15:04 ENT108

Has anyone found a way around this? I host a server to play with coworkers and their number 1 gripe is that they lose their keybindings every time. Has anyone even made some partial progress that others can build upon?

Andacious avatar May 21 '21 15:05 Andacious

Nope. As a workaround, I put player's customized configs to the server. So anyone can load own config upon join. The downside is maintanance of the configs.

ENT108 avatar May 21 '21 19:05 ENT108

if anyone bumps on this issue, by default q3 execs a file call default.cfg, and you can both save the config to a file (in the local storage) and execute it later. In practice:

  • join a game,
  • make your configuration,
  • bring up the console with the ² keys (below escape)
  • save your config by typing \writeconfig default and enter (you can start typing wr then hit tab to autocomplete and automatically add the \
  • refresh to check it worked

you can also have alternate config, e.g., \writeconfig abby then on refresh, \exec abby

twitwi avatar Jan 31 '22 23:01 twitwi

A trick to inject an existing config (i.e. to create a file in the virtual filesystem, to be able to copy paste the content).

Open the browser console and type for instance:

FS.writeFile('base/baseq3/abby.cfg', `
bind k "kill"
name AbBy
`)

twitwi avatar Feb 03 '22 23:02 twitwi