OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
install_bots Namespace Reference

Functions

 read_game_script (game_dir, name)
 main ()

Variables

 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 BOT_DIR = os.path.join(ROOT, 'mods', 'bots', 'maps', 'mp', 'bots')
str CALLBACKS = 'maps/mp/gametypes/_callbacksetup.gsc'
str MARKER = '[[level.callbackStartGameType]]();'
str HOOK = 'thread maps\\mp\\bots\\_bots::init();'

Detailed Description

Installs the simple bots of mods/bots as a server-side mod folder.

    python3 scripts/install_bots.py /path/to/CoD2 [--dest FOLDER] [--name cod2rev_bots]

It writes two loose script files into FOLDER/<name>:
  maps/mp/bots/*.gsc                     the bots, copied from this repository
  maps/mp/gametypes/_callbacksetup.gsc   the game's own file with one line added

The second file is built from your own game files (read from the .iwd archives
in /path/to/CoD2/main), because the game scripts cannot be redistributed here.
FOLDER defaults to the game folder. Start the server with:

    +set fs_game <name> +set bots_count 6

Function Documentation

◆ main()

install_bots.main ( )

◆ read_game_script()

install_bots.read_game_script ( game_dir,
name )

Variable Documentation

◆ BOT_DIR

install_bots.BOT_DIR = os.path.join(ROOT, 'mods', 'bots', 'maps', 'mp', 'bots')

◆ CALLBACKS

str install_bots.CALLBACKS = 'maps/mp/gametypes/_callbacksetup.gsc'

◆ HOOK

str install_bots.HOOK = 'thread maps\\mp\\bots\\_bots::init();'

◆ MARKER

str install_bots.MARKER = '[[level.callbackStartGameType]]();'

◆ ROOT

install_bots.ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))