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

Functions

 game_log (home)
 main ()

Variables

 ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
str WEAPON = 'kar98k_mp'
int MIN_DISTANCE = 24
str GAMETYPE

Detailed Description

Players bump into each other, a knife hits, and explosions reach a player.

    python3 scripts/contact_test.py /path/to/CoD2 --protocol {115|118} [--binary PATH] [--listen]

Like scripts/hit_location_test.py, whose minimal client it uses, it writes a dm
gametype that spawns a target and, in front of it, a player that a minimal
client drives. The test picks each phase with rcon (contact_phase), which the
mod polls:

- walk: the second player walks straight at the target for a few seconds; the
  two must collide, so the distance between them never falls under a body's
  width. Player against player clipping goes through the world's sectors.
- trigger: it walks at the target again, through a trigger_radius on its
  way, which must fire; the trigger finds the player through the world's
  sectors.
- melee: it stands next to the target and presses the melee button; the target
  must take MOD_MELEE hits.
- grenade: it stands farther, aims down and throws a frag grenade, whose
  splash must hit the target; the grenade flies and bounces on the world's
  collision.
- kill: with its health down, an explosion kills the target, whose body the
  mod clones, and which spawns again two seconds later.
- radius: the mod calls radiusDamage next to the target, spawned again,
  which must take a MOD_EXPLOSIVE hit; the explosion finds it through the
  world's sectors too.

The target is another minimal client on the dedicated server, or with --listen
the client that hosts the game (with a CD key in ~/.cod2/preferences; skipped
without one). Exits with 0 when every phase holds and nothing crashed.

Function Documentation

◆ game_log()

contact_test.game_log ( home)

◆ main()

contact_test.main ( )

Variable Documentation

◆ GAMETYPE

str contact_test.GAMETYPE

◆ MIN_DISTANCE

int contact_test.MIN_DISTANCE = 24

◆ ROOT

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

◆ WEAPON

str contact_test.WEAPON = 'kar98k_mp'