Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

retta283

Suspended
Original poster
Jun 8, 2018
3,179
3,480
Been looking at some of my old early Intel games and trying different mods for them, and I've found one that goes back to an old curiosity of mine I never pursued. I found a bot mod for Call of Duty 2 to play multiplayer offline, it's kind of crappy code and instruction wise but it does work. Mods for this game don't require anything Windows-native, it's all in the engine so they should work in OS X version no problem - COD4 mods work in Mac.

However, in the case of COD2, there was no mod selector menu so everything was done by changing the target box for your game shortcut to tell the game to launch the mod. On Windows, this would look something like this: "C:\Program Files (x86)\Activision\Call of Duty 2\CoD2MP_s.exe" +set fs_game mbotsoundfinal +exec mbotsoundfinal.cfg I am trying to find a way to tell the game this info, since I know of no equal to the Windows shortcut target on Mac. I had wanted to try this before but never got anywhere. If anyone knows how to do a similar function I'd greatly appreciate it.
 
Sorry if I'm totally off the mark, but what about launching the game executable from Terminal, passing it the options - and if this works, putting that line into a shell script and creating an alias for that?

Like this (in Terminal - replace app name and executable accordingly - I have no idea what it's called for CoD2)

/path/to/CoD2.app/Contents/MacOS/CoD2_executable +set fs_game mbotsoundfinal +exec mbotsoundfinal.cfg

If this works, create a text file that has the following in it:

#!/bin/sh /path/to/CoD2.app/Contents/MacOS/CoD2_executable +set fs_game mbotsoundfinal +exec mbotsoundfinal.cfg

save it somewhere with an .sh extension (for example, CoD2.sh) and make it executable by running chmod +x /path/to/CoD2.sh in Terminal. Double-clicking the script should then launch Terminal to execute CoD2. If that works, put an alias to the script somewhere.
 
  • Like
Reactions: retta283
Sorry if I'm totally off the mark, but what about launching the game executable from Terminal, passing it the options - and if this works, putting that line into a shell script and creating an alias for that?

Like this (in Terminal - replace app name and executable accordingly - I have no idea what it's called for CoD2)

/path/to/CoD2.app/Contents/MacOS/CoD2_executable +set fs_game mbotsoundfinal +exec mbotsoundfinal.cfg

If this works, create a text file that has the following in it:

#!/bin/sh /path/to/CoD2.app/Contents/MacOS/CoD2_executable +set fs_game mbotsoundfinal +exec mbotsoundfinal.cfg

save it somewhere with an .sh extension (for example, CoD2.sh) and make it executable by running chmod +x /path/to/CoD2.sh in Terminal. Double-clicking the script should then launch Terminal to execute CoD2. If that works, put an alias to the script somewhere.
The first part works perfectly, game loads up the mod without issue, although for some reason much of the text is in Hungarian, it does not affect the game though as the mode selection is clear enough.
Screen shot 2021-09-21 at 2.49.56 PM.png
However, the process for creating a .sh launcher does not seem to work. I entered the text in a TextEdit document saved as rtf, then renamed to .sh but this still opens it in TextEdit, attempting to launch it via Terminal gives Cocoa errors. Tried in Terminal export to .txt, then rename, but this fails. Attempted to run it in Apple Script but this says "Expected end of line, etc. but found “/”.". Not sure if I have to somehow save it as .sh first or this just does not work. This is under Snow Leopard I am trying.

This is definitely good progress though, thanks for the advice on this.
 
I entered the text in a TextEdit document saved as rtf, then renamed to .sh

It positively needs to be a plain text file without any formatting. Make sure TextEdit is configured for plain text.

#!/bin/sh needs to be the first line.
The command to launch CoD2 needs to be the second line.
To illustrate, this is what a script to launch good ol' TextEdit looks like:

Bildschirmfoto 2021-09-21 um 22.07.28.png


If you can’t change the script's extension to .sh in Finder then do it in Terminal.

mv /path/to/script.txt /path/to/script.sh

Then make it executable: chmod +x /path/to/script.sh
 
Last edited:
  • Like
Reactions: retta283
It positively needs to be a plain text file without any formatting. Make sure TextEdit is configured for plain text.

#!/bin/sh needs to be the first line.
The command to launch CoD2 needs to be the second line.
To illustrate, this is what a script to launch good ol' TextEdit looks like:

View attachment 1838993

If you can’t change the script's extension to .sh in Finder then do it in Terminal.

mv /path/to/script.txt /path/to/script.sh

Then make it executable: chmod +x /path/to/script.sh
Excellent, setting it to plain text made it work. I'll have to try similar methods with some other game mods that used this method, I imagine many of them that were flagged as Windows-only would in fact work if people knew about this. Played a nice snipers match on El-Alamein desert with the bots, this game seems to run excellent on any Intel Mac that has better than Intel graphics. Thanks for the help.
 
  • Like
Reactions: Amethyst1
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.