Once there you'll have to make a new file called autoexec.cfg, the best way is to make a new notepad document, open it, then save it as 'autoexec.cfg' with the file type selection box on 'All files (.)' Then open this blank document in notepad, then that's it, you have a blank autoexec.cfg file.
Click here to return to the 'A shell script to improve Quake3 performance' hint |
oh man, the thing that really peaked my interest here is the possiblilty of launching a q3 mod through the script!
hes hints 'BTW, The shell script is also customizable so that you can go straight into your mods! I don't recall how that is done though.'
anyone know about this? i would love to be able to do it!!!!!!!!
thanks!
tell application 'Terminal' do script with command '/Applications/Games/Quake3/Quake3.app/Contents /MacOS/Quake3' +set fs_game q3ut2' end tellobviously, if you want to launch into a different mod, change 'q3ut2' to the acronym for your mod. i dunno where to find a web list of mod acronyms offhand. but it *might* just be the name of the mod's directory. or you can look at the acronyms used by only mortal -- the best osx q3a server browser to date. http://homepage.mac.com/only_mortal/ finally, here's an example of launching a command line dedicated server:
tell application 'Terminal' do script with command '/Applications/Games/Quake3/Q3DedicatedServer -RetailInstallationPath /Applications/Games/Quake3 +cvar_restart +set com_hunkmegs 30 +set net_port 29099 +set vm_game 2 +set dedicated 2 +set g_gametype 3 +set gamename Q3UT2 +set fs_game q3ut2 +map ut_sliema +exec utserver.cfg' end tellthis is an example that works -- but may not be the best for your setup. research the variables for your own needs. good luck. N.B.: all code broken for ubb purposes. everything between the 'tell' and 'end' lines should be one contiguous line. brett.
that these examples are for applescripts -- i'm trying to merge the principles of the shell script here with my applescript. perhaps hes nikke will beat me to it.
brett.
tell application 'Terminal' do script with command '/Applications/Games/Quake3/Quake3.app/Contents /MacOS/Quake3' +set fs_game q3ut2' do shell script 'ps -ax | grep Quake3 | grep -v grep' do shell script 'renice -20 -p `ps -ax | grep Quake3 | grep -v grep | cut -c1-5`' password 'youradminpassword' with administrator privileges end tell(the lines 'tell' 'do' & 'end' are single lines, all others have been broken.) to get this script to work, just plug in your adminpassword, your path to q3a, & set your desired mod acronym. save as run-only to protect your password from prying eyes. this may not be the cleanest script, but it works. please suggest improvements. brett.
Here's a better way to do the key line of the shell script:
sudo renice -19 -p `ps -ax | grep Quake3 | awk '{print $1}'
Using grep twice is a crime. Using cut to display only one field of a line is a minor offense.
BTW, I have a command (pid) which is basically ps -auxc | grep $1 | awk as above - great for backquoting into kills and such.
In fact I just realized I should just do sudo renice -19 `pid Quake3`.
Oh, and setting a process to -20 is a REALLY bad idea - it means the entire system is locked up while the front app runs. Yes, you say, but that's what we want, just like on OS 9. Wrong - this is Unix. Background stuff happens that NEEDS to happen by itself. Interfering with that is asking for trouble. Just go with -19.
thanks alot for the grep tip. i incorporated it. also, i used 'property' lines so people can insert their own preferences easily -- path, mod, pwd, cfg & renice value. again, the script is on my homepage:
http://homepage.mac.com/bhduxbury/.cv/bhduxbury/Public/q3ut2-binhex.hqx
brett.
Yes, and remember that AWK is just a glorified version of grep, so we can save a process by using pattern matching in AWK:
sudo renice -19 -p `ps -ax | awk '/Quake3/ {print $1}' `
These unix-oneliners give Applescript just the power it used to lack in Mac OS 9; thanks for brett_ et al. for showing me the way to go!
BTW, for more on 'using grep twice is a crime' see, e.g., http://www.ling.helsinki.fi/~reriksso/unix/award.html
iv
This not only sped Quake up, but it also solved my intermittent lock-up (the dreaded 'Awaiting Snapshot...'-hang)!!!
And I only used a modest -15 ...