Medal of Honor: Allied Assault

File information

Last updated

Original upload

Created by

Searingwolfe

Uploaded by

Searingwolfe

Virus scan

Some suspicious files

Tags for this mod

Documentation

Readme

View as plain text

<><><> Cyber Attack / Search & Destroy Mod V2.00 <><><>

The popular Cyber Attack and Search & Destroy game modes from Call of Duty: Modern Warfare 2 (2022) have been ported into MOHAA for 2023.
The gameplay, rules, and conditions to win/lose in this mod are almost identical to the originals.
Both game modes use "g_gametype 2" or team deathmatch, but killed players go to team-only spectator instead of respawning.
In Cyber Attack, dead players are frozen like in Freeze Tag and other teammates can revive them (there are no long-range melt lasers in Cyber Attack).
In Search & Destroy, dead players cannot be revived. Bombsites and an explosive are also on the map, allowing a team to blow up the other team's bombsite to win the round.
Teams in both game modes have a specified amount of rounds to win (5 by default) before the map ends or until the map time limit runs out. Specific rules below.

<><><> <><><>

<><><> How To Install / Uninstall <><><>

If packed in a .zip, unpack the .pk3 file. Copy the .pk3 file and paste it in the "Medal of Honor/main" folder (same folder as Pak0.pk3, Pak1.pk3, Pak2.pk3).

Uninstall by deleting the .pk3 mod file from the "main" folder.

<><><> <><><>

<><><> Essential CVARS for UBER MODS Servers <><><>

This new CVAR allows for switching between the current 3 uber game modes (besides FFA or TDM) before loading a new map.
Place one of these lines into your server.cfg file, or add one of these lines to an .scr map script (before level waittill prespawn):

seta g_ubergametype "" // none or "0", default to g_gametype 1 or g_gametype 2.
seta g_ubergametype "bb" // UBER BASEBUILDER game mode
seta g_ubergametype "cyb" // CYBER ATTACK game mode
seta g_ubergametype "snd" // SEARCH & DESTROY game mode
seta g_ubergametype "ft" // FREEZE TAG game mode

To switch to any of the "obj/" maps from an FFA or TDM game mode map (such as "dm/"), type the following into the console:

g_gametype 4; map obj/obj_team1
g_gametype 4; map obj/obj_team2
g_gametype 4; map obj/obj_team3
g_gametype 4; map obj/obj_team4

<><><> <><><>

<><><> Features & Gameplay <><><>

- When the map loads, the first round begins after a few seconds (8 by default). Until the round begins, the bomb cannot be picked up, and all players can respawn after dying.
Once started, the bomb and bombsites become triggerable. Any players that die will go to team-only spectating mode (not actually in spectator), and a frozen body will appear where players died if playing Cyber Attack.
These frozen players can only be melted by their teammates, similar to Freeze Tag.
When revived, the melted player is respawned and teleported back to where they were frozen, only after all other players have moved far enough away from your frozen body (prevents players getting stuck inside each other).

- While in team-spectating mode and waiting to get melted in Cyber Attack, or waiting for the next round in Search & Destroy, the spectating player can cycle between any living teammates or frozen dead bodies, with FIRE key (cycle forward) or USE key (cycle backward).
If the enemy team wins while your teammates are spectating, all team-spectators will begin spectating the enemy team until the next round begins (usually 3 seconds total).
If somehow all players are dead (round was a draw), then team-spectators will all teleport to and be trapped within their frozen body's beams until the next round begins.

- If a team wins but there are no players on the other team, scorepoints will not be added. A bomb (thread) and at least two bombsites (waitthreads) are added in the main map script.
If a bomb-carrying player dies, the bomb drops to the ground. If a bomb-carrying player leaves or changes teams or goes to spectator, the bomb respawns back to the origin it was last picked up at.

- Cyber Attack: This game mode is best played on DM maps, since bombsites switch team defenders every 3 rounds. Each team has a bombsite to defend at all times, ideally placed near opposite corners of the map in DM maps or near team spawnpoints in OBJ maps.
The Allies bombsite is blue-lit and the Axis bombsite is red-lit. The radiobomb is ideally spawned near the middle of the map. Both teams must find the purple-lit bomb and plant it on the opposite team's bombsite. The bomb takes 1.5 seconds to plant/defuse.
If defused by the enemy team, the defusing player receives the radiobomb, ready to be planted on the enemy team's bombsite. To win, players must kill all enemies or plant and destroy the enemy's bombsite.
Every 3 rounds, the bombsites "change sides": all Allies bombsites become Axis, and all Axis bombsites become Allies.

- Search & Destroy: This game mode is best played on OBJ maps, so the bomb can always spawn near the planting team's spawnpoints.
Depending on "level.changesides" (0 or default = Allies plant first, 1 = Axis plant first), one team has two bombsites to find and defend, while the other planting team must find and destroy a bombsite.
These bombsites are ideally placed near the center of the map where both teams clash in gun battles the most, but kept far enough away from each other so the defending team cannot defend both bombsites with one player simultaneously.
The bomb is ideally spawned near the planting team's spawnpoints, whose origin changes when the planting team changes. The bomb cannot be picked up by players on the defending team. The bomb takes 4.5 seconds to plant/defuse.
If defused by the enemy team, the defusing team wins immediately. To win, players must kill all enemies, plant and destroy the enemy's bombsite, or defuse the enemy's bomb.
Every 3 rounds, the bombsites "change sides": the planting team becomes defenders, the defending team becomes planters, and all bombsites change teams accordingly.

- Freeze Tag: This game mode is an almost identical replica of Mefy's Freeze Tag. Unlike Cyber Attack where melted players respawn back to their dead bodies, Freeze Tag simply respawns the melted players.
There are no bombs or bombsites in Freeze Tag, so any "bombsite" or "bomb" threads are ignored by the script (still requires running the main script, or running "......scr::main" to run this game mode).
After the round begins, the 1st team to kill all enemy players wins the round.

<><><> <><><>

<><><> Main Map Script Parameters <><><>

- bombsite: Make sure these are waitthreads, so the bombsite's targetname can increment after a previous bombsite has finished spawning. Parameters: origin, angle, team.
The "team" parameter only applies to Cyber Attack, since "level.changesides" will determine the team for both bombsites in Search & Destroy.
Both teams in Cyber Attack can have more than 1 bombsite if desired, but make sure they have at least 1 bombsite. Search & Destroy can also have 1, 2, or more bombsites since team parameter is ignored.
Run "exec global/cyberattack_searchdestroy.scr" after level waittill spawn and after all cyberattack_searchdestroy.scr threads run. Example below:

- waitthread global/cyberattack_searchdestroy.scr::bombsite ( -1210 485 168 ) -90 axis // team parameters can be removed for search & destroy.
- waitthread global/cyberattack_searchdestroy.scr::bombsite ( 1297 2461 672 ) 90 allies

- bomb: Parameters: Allies origin, Allies origin, Axis origin, Axis angle, central origin, central angle. Both Allies and Axis origins/angles are for Search & Destroy only.
The central origin/angle is for Cyber Attack only. The bomb color is always blue when Allies are planting, and red when Axis are planting in Search & Destroy. Only spawn in one bomb per map. Examples below:

- thread global/cyberattack_searchdestroy.scr::bomb ( -153 1445 96 ) 180 ( -153 1445 96 ) 180 ( -153 1445 96 ) -90 // cyb & snd
- thread global/cyberattack_searchdestroy.scr::bomb ( 0 0 0 ) 0 ( 0 0 0 ) 0 ( -153 1445 96 ) -90 // cyber attack only
- thread global/cyberattack_searchdestroy.scr::bomb ( -153 1445 96 ) 180 ( -153 1445 96 ) 180 ( 0 0 0 ) 0 // search & destroy only only

- level.round_starttime: 8 seconds default. This variable determimes the time in seconds until the round begins, disabling respawning and forcing dead players to spectate their teammates until the next round begins.
Waiting a few seconds for a new round to begin serves as a temporary spawn protection.

- level.rounds_towin: 5 rounds to win default. This determines how many rounds a team must obtain before winning and ending the map, allowing a winning game to be as close as 5 to 4 points by default.

- level.changesides: 0, Allies plant first default. This can only be 0 or 1, where 1 = Axis plant first (for Search & Destroy).
If playing Cyber Attack, setting level.changesides = 1 will flip the bombsite's defending teams to the opposite teams initially.
Every 3 total rounds, level.changesides toggles from 1 to 0 or from 0 to 1.

- level.keepsamesides: 0, no nothing default. If set to 1, level.changesides will never increment, mainly for OBJ & singleplayer maps (bomb & bombsites will not change teams every 3 rounds).

- level.spectators_jointeams: 0, do nothing default. If set to 1, all actual spectators will be forced to auto-join teams and be given a machine gun, pistol, and grenades when the round begins.
If those players are still AFK, they'll eventually get killed and placed into team-spectating mode until the next round begins.

- level.bombcamera: 0, do nothing default. If set to 1, when a bombsite is about to explode, all players' cameras are moved to the bombsite to view the explosion, before returning all cameras back to their respective players' heads after a few seconds.
While viewing the explosion, players cannot see or kill each other.

- level.cameradistance: 200 default. This determines the distance between a bombsite and all players' cameras when the bombsite blows up.
Some bombsites are indoors. If the camera is inside the wall or the bombsite is invisible during explosion, this variable should be lowered.

- level.melttime: 3 seconds default. This determines the time in seconds for a player to melt/revive a teammate.
Note: there's always roughly a half-second extra time required for all players to move away from the melted/revived teammate, before he respawns.

- level.meltrespawn: 0, respawn melted/revived players back to their frozen bodies default. If set to 1, then all players that get melted/revived will not tele back to their dead bodies (regular respawn instead).
This = 1 by default for Freeze Tag only, unless specified as level.meltrespawn = 0.

- level.meltlaser: 0, laser beam is invisible default (Freeze Tag only). If set to 1, all players' melting laser beams (when holding USE key) are visibie.

- Run "exec global/cyberattack_searchdestroy.scr" after level waittill spawn and after all cyberattack_searchdestroy.scr threads run.

<><><> <><><>

<><><> New CVARS for Reborn Servers <><><>

// maxentities = 869 in code, but players may crash joining Reborn servers (singleplayer maps) if current entities = 725+, or 140+ remaining entities.
exec cvars/playercount.scr // "players" cvar. "players 1" = print to console the # of players in-game (type these into the server's console window).
// "players 2" = print to console the # of players in-game & their usernames.
// "players 3" = see which players in $player array are NULL.
exec cvars/entitycount.scr // "entities" cvar. "entities 1" = wait 4 seconds to print # of entities & remaining entities until maxentities (1024) is reached.
// "entities 2" = print all entities & their targetnames (or NULL) from 1 to maxentities.
// "entities 3" = print all entities & their targetnames, but print slower.
// "entities 4" = print only non-NULL entities ($player entities do not print for "entities" 4, 5, 6, 7).
// "entities 5" = print only non-NULL entities that have targetnames.
// "entities 6" = print only non-NULL entities that do not have targetnames (targetnames = "").
// "entities 7" = print only non-NULL entities, and print their classnames.
exec cvars/track.scr // "track" cvar. "track 1" = iprint each players' coords & angle to their own screens.
// "track 2" = iprint and print to console each players' coords & angles once every 3 seconds.
// "track 0" = turn off tracking.
exec cvars/check.scr // "check_[trigger]" cvar. "check_giantbomb 1" "check_giantbomb 2" "check_lightbomb 1" "check_lightbomb 2" (giantbomb, lightbomb, health, grenade, rocket, snowball)
// "1" = teleports all spectators to each of the ("giantbomb", "health", "rocket", etc) trigger's randomized origins every 3 seconds.
// "2" = spawn in a dummy model at each of the trigger's origins (only works once).
// "0" = stop teleporting, delete the dummy models.
// "check 0" = make all "check_[trigger]" cvars "0".
//
exec cvars/find.scr // "find [targetname without $]" cvar. "find truckclip", "find endtrigger", "find aispawn", or multiple ents with the same targetname: "find barrel[1]", "find barrel[2]",
// to teleport all players on the map to the entity's coords (also printing: coords, angles, entnum, and target).
exec cvars/findent.scr // "findent [entnum]" cvar. "findent 65", "findent 450", or any entnum >= "sv_maxclients" cvar to teleport all players on the map to the entity's coords (also printing: coords, angles,
// classname, model, targetname, target, health).
//
exec cvars/findclass.scr // "findclass [classname, case-specific]" cvar. "findclass ScriptModel", "findclass CrateObject", "findclass TurretGun", "findclass Trigger", or any other classname to print all entnums and
// their targetnames in the map with that classname.
//
exec cvars/findmodel.scr // "findmodel [models/...tik]" cvar. "findmodel models/static/indycrate.tik", "findmodel static/indycrate.tik", or any other model to print all entnums and
// their targetnames in the map with that model name.
//
exec cvars/drawpath.scr // "drawpath [1st ent's targetname without $ in a path]" cvar. "drawpath bomberpath", "drawpath spotpath1_1", "drawpath latertruckpath", or multiple paths with the same targetname: "drawpath
// exploderchunk[1]", "drawpath exploderchunk[12]", to spawn nodes & lasers and draw them to each .target, until there's no more .targets or until the .target reaches an already-drawn node.
//
exec cvars/cybsnd.scr // "cybsnd_score 1" cvar, to print the current Cyber Attack, Search & Destroy, or Freeze Tag score (rounds Allies won, Axis won).
// "cybsnd_info 1" cvar, to print round start time, rounds to win, change sides (0 or 1 for switching bombsites), melt time, melt respawn (0 or 1 for spawning at frozen body or regular
// spawn), spectators auto-join teams (once round begins), bomb camera (1 or 0, when bomb explodes), bomb camera distance.
// "cybsnd_debug 1" cvar, to print once per second the Allies/Axis team count (living players) and Allies/Axis team total.
//
exec cvars/ubergametype.scr // "g_ubergametype" cvar. "g_ubergametype bb" = Base-Builder gametype.
// "g_ubergametype cyb" = Cyber Attack gametype.
// "g_ubergametype snd" = Search & Destroy gametype.
// "g_ubergametype 0" or "" = none, regular TDM or FFA (based on g_gametype).
// "g_ubermods" cvar. "g_ubermods 2" = default, all UBER mods enabled.
// "g_ubermods 1" = No crates or teles, fewer triggers for multiplayer maps. Crates & teles, but no extra mods for singleplayer maps.
// "g_ubermods 0" = all UBER mods disabled.
// "g_throwingknives" cvar. "g_throwingknives 1" = all players spawn with 1 throwing knife (hold USE + FIRE to throw), and 4 extra knives spawn around the map.
// "g_throwingknives 0" = no throwing knives.
//
exec cvars/adminstuff.scr // "hacker_kill" cvar. "hacker_kill 27" = continuously kill $player[27]
// "hacker_kill Searingwolfe" = continuously kill the player with the name "Searingwolfe"
// "hacker_unbindall [27 or Searingwolfe]" = continuously unbind all their keys
// "hacker_disconnect [27 or Searingwolfe]" = continuously disconnect [kick] them from the server
// "hacker_quit [27 or Searingwolfe]" = continuously quit their game
// "votekick [27 or Searingwolfe]" = all players vote to kick: Hold USE Key + Lean Left = VOTE NO (default), Hold USE Key + Lean Right = VOTE YES.
//
// for "players same name" fix: add admin's IPs at top of "adminstuff.scr", to give admins name-changing priority.

<><><> <><><>

<><><> Known Bugs <><><>

- After a team wins, if a winning team player kills himself with the "kill" console command just before the new round begins, the player will automatically kill himself again 3-5 seconds after respawning in the new round. This may due to the death animation not finishing before the script respawns the player, thus the "kill" command is still spamming somewhere until the game allows "kill" to kill the player again ("kill" doesn't work for a few seconds after respawning). If level.round_starttime is not at least 6 seconds long, this self-inflicted event could cause a player to die after a round begins, forcing him to wait until the next round. Another way to prevent this is by disabling the "kill" command for players altogether with: $player stufftext ("alias kill iprint Cannot_kill_yourself_this_way"). Currently, I do not know how to re-enable the "kill" command (alias kill kill did not work), and any players who have their "kill" command disabled will have to close and reopen the game to re-enable it.

<><><> <><><>

<><><> Extra Global Scripts <><><>

- get_player_weaponclass.scr: This script serves as a local.player.getcurrentdmweapontype or a local.player.dmweaponclass module for developers to return a player's current DM weapon class/type after the map has loaded. - This script runs while all players are alive, keeping memory of their current DM weapon classes (sniper, rifle, smg, mg, heavy, or shotgun). Once melted, the player is given back weapons according to their last DM weapon class; melted players would respawn empty-handed without the script. The level.mef_weaponclasses in Example (a) must be initialized after "level waittill spawn" (already added in cyberattack_searchdestroy.scr). Any time the player is holding a pistol, grenade, holstering weapon, or holds nothing, the current DM weapon class is NIL. If using this script inside of a $player.size for-loop, make sure to keep running the "main" thread until $player[local.i].mef_weaponclass is no longer NIL. Once not NIL, make another player variable = 1 (such as $player[local.i].weapcheck = 1) to stop checking the player's weaponclass. This prevents mef_weaponclass from becoming NIL when the player dies. For Freeze Tag or Cyber Attack in particular, melting a player does not give their weapons back. Thus, mef_weaponclass is needed to keep memory of the dead player's previous DM weapon class. Once melted/respawned, make $player[local.i].weapcheck = 0 and begin checking with "$player[local.i].mef_weaponclass = waitthread global/get_player_weaponclass.scr::main $player[local.i]" again. The "give_weapons" thread replaces the "primarydmweapon" command to remove the "your weapon will change when you respawn" message, running when the player is melted.
- Parameters (a): none
- Example (a): level.mef_weaponclasses = waitthread global/get_player_weaponclass.scr::setup_weapon_classes
- Parameters (b): player number
- Example (b): $player[local.i].mef_weaponclass = waitthread global/get_player_weaponclass.scr::main $player[local.i]
- Parameters (c): player number before "thread".
- Example (c): $player[local.i] thread global/get_player_weaponclass.scr::give_weapons local.mef_weaponclass

- global/math.scr: This script holds the tried-and-tested sine and cosine math functions for spawning objects at any distance away from a desired object, for any desired yaw-angle ( pitch, yaw, roll ). For example, let's say you have a bangalore on a wall facing at a 55 degree yaw-angle. You want an explosion emitter about 100 units directly away from the bangalore, but you're not sure on the exact x and y coordinates to place this emitter since the bangalore is not facing 90, 180, 270, 360 degrees. Since 100 units is the hypotenuse distance away from the bangalore, plugging in the sine and cosine of the 55 degree angle multiplied by the 100 units distance gives the emitter-origin's x and y coordinates that must be added to the bangalore's origin. See the math.scr script file for more code examples and details.
// local.bangalore.origin = ( 100 200 -50 )
// local.bangalore.angles = ( 0 55 0 )
// local.sin = (waitthread global/math.scr::sine 55) * 100 // y-axis
// local.cos = (waitthread global/math.scr::cosine 55) * 100 // x-axis
// local.explosion.origin = local.bangalore.origin + ( local.cos local.sin 0 )

- messagetrig_print.scr: This script was an attempt to recreate the white message text that appears in the center of a player's screen whenever they trigger a trigger (modified from the "global/message_print.scr" script). However, the only way to print the text is with "huddraw", which causes all players on the map to see the same text. A potential "ihuddraw" fix can make this script viable again. This script is now used to print center-screen white message text to all players simultaneously, indicating whether the Axis or Allies have won the round, planted the bomb, or defused the bomb.
- Parameters: message in quotations, display time.
- Example (a): local.player thread global/messagetrig_print.scr::message "*** Allies win this round! ***" 0.8 // does not print to only one player unless "ihuddraw" is used.
- Example (b): thread global/messagetrig_print.scr::message "*** Axis win this round! ***" 0.8

- global/dog.scr: This mod is now fully compatible with Cyber Attack / Search & Destroy. The original "global/dog.scr" script was revamped to fix dog animations for all player movements. Only 1 per map, mainly on ground-level. When triggered, the player loses all guns and becomes a living moveable dog. Crounch to lay down the dog. Walk while standing (not crouching) to move silently. Hold USE + Left/Right-click to bark, and Left/Right-click to bite. Looking downwards bites a player's legs, and looking upwards bites a player's face. Biting a player causes 9999 damage, an instant death. Biting teammates does nothing. Jumping while holding USE key will gives the dog a shorter jump animation, while jumping regularly gives the dog a higher jump animation; both jumps are the same physical height. If the dog is doing a running animation (player is standing and running) for 5 seconds or more, then the dog will do a "dog_leash_stop" animation (dog's front legs jump up briefly) after it stops running. The dog trigger reacts with pain animations each time it gets shot at. If the dog trigger is shot at too many times ("bulletsanger" times) within 4 seconds, the trigger's light will turn red for "angertime" seconds, killing any players that get too close to the dog. When killed, the player becomes human again. Dogs can pick up radiobombs/explosives for Cyber Attack / Search & Destroy.
- Parameters: origin, angles, bulletsanger, angertime.
- Example: exec global/dog.scr ( 4444 1488 -338 ) ( 0 90 0 ) 15 20

<><><> <><><>

<><><> Searingwolfe <><><>