DocsGlossaryGlossaries

Megalith glossary

Words a mode author meets in the Megalith docs, A to Z, each with a link to where it is explained.

A

Ability keys

Four keys every player has for game modes, Ability 1 to Ability 4, bound under Game Mode Abilities in Settings. A script hears them in on button press as button.ability_1 to button.ability_4; in a mode that doesn't listen they do nothing.

See Ability keys.

alias

Gives a variable slot, a constant or a script_option[n] a name, such as alias points = player.number[0], used as current_player.points. allocate temporary number or allocate global.number takes a free slot for you. An alias lasts to the end of its block.

See The language.

Arithmetic

Sums written between values, such as current_player.biped.get_speed() * 3 / 4 + 1: * and / before + and -, with parentheses, wherever a number goes. Numbers stay whole; mathematics such as min, max, clamp, sqrt, sin and atan2 carries fractions as thousandths.

See Arithmetic and mathematics.

B

Biped

A character's body. current_player.biped is the player's body, or no_object while they're dead; set_biped moves a living player into another body, and a class names its body in biped.

See Players in other bodies.

Body list

The 38 body names a mode can create or give players: every Halo 3 character, Flood forms included, each with the campaign map it comes from and its model variants. The host needs that campaign map; spartan, elite and forge_monitor need nothing extra.

See Every body.

break, continue

In a for each loop: leave the loop, or go on with its next player, team or object.

See Branches and leaving early.

Bundled modes

The eight modes that come with the game: Gun Game, Growth, One in the Chamber, Zone Control, Flood Infection, UNSC vs Covenant vs Flood, UNSC vs Covenant: Reach and Conquest. They sit in the Project Reclaimer folder of Game Modes; the game puts back one that's missing and never overwrites one you changed.

See The modes.

%b (button names)

In a widget's text, a button such as button.fire, which each player reads as their own key or controller button for it: “Hold Left mouse” for one, “Hold RT” for another.

See Each player's own keys.

C

Class

A role players choose before each life, declared under [logic.deployment] with its body, look, weapons, grenades, traits, cost and max_active limit. A mode has 2 to 128 classes, at most 48 a team, and needs "rounds.teams" = 1 and a free class without a limit on each team.

See Classes and class pickers.

Class abilities

What a script makes of ability keys, equipment, objects, traits and timers, such as active camouflage on a key or cover an Engineer deploys. There are no new animations, models or HUD icons.

See Buttons, equipment and class abilities.

Class picker

Where players choose a class: the built-in class cards, the deployment map in a mode with deploy points, or a picker the script draws itself with widgets when script_menu = true, deploying the clicked class with deploy_class.

See Your own class picker.

Co-op spawning

Reach's way of spawning a dead player beside a living teammate of their fireteam who is out of combat, set with set_co_op_spawning on a team or a player. While they wait they watch that teammate or their spawn location and step through the choices with the D-pad's up and down. Invasion spawns this way.

See Reach's calls.

Condition call

A call that tests something and goes in an if: is_zero, is_not_respawning, has_any_players, has_alliance_status, shape_contains, is_of_type, has_forge_label, is_button_held, is_driver, is_airborne, is_crouched, is_grounded, has_crosshair_point and the others the docs mark (condition).

See Values and conditions.

Conquest

The bundled mode bf-conquest.rmeg: two teams of five classes, in squads, fight over Halo 3's territories for tickets and choose where to deploy on the deployment map. It plays Territories; megalo-conquest.rmeg is a smaller example without classes or squads.

See Conquest.

Created object

An object the script makes with place_at_me. The round's end removes it, except bodies players are in; delete the ones you're done with: a script keeps at most 2,048 at once.

See Creating objects.

current_player, current_object, current_team

The player, object or team a loop is visiting or an event is about. A loop gives the previous one back when it ends.

See The language.

D

Damage category

The kind of a hit, written damage.NAME: none, falling, bullet, grenade, high_explosive, sniper, melee, flame, mounted_weapon, vehicle, plasma, needle and shotgun. set_damage_from lets a category reach an object or not, and on object damaged gives it as damage_category.

See Damage.

declare

Gives a variable a starting value, such as declare player.number[0] = 3; without one, numbers and timers start at 0 and references at no_object, no_player or no_team. declare team_count sets how many teams the mode has.

See The language.

Declared object

A zone or object type named in the header under [logic.objects.NAME], up to 64: a weapon, a body, a stock object, a tag path or a placement of the saved map. A zone is there from the round's start; the others are types place_at_me takes by name.

See Declared objects and zones.

Deploy point

An object a team's players may deploy beside, set with object.set_deploy_point(team), or (team, squad) for one squad; no_team takes it away. Up to 64 at once, and a body counts only while its player lives.

See Squads and the deployment map.

Deployment map

What the dead see in a mode with classes and deploy points: a panel of classes and places beside the battle seen from high above. Players choose while the respawn countdown runs and deploy as it ends, at HQ, the team's own spawn points, if their place is gone; split screen keeps the class cards.

See Squads and the deployment map.

Deployment points

The points players spend on classes, 0 to 100,000; a class's cost is what it takes. get_deployment_points() and set_deployment_points(n) read and change them.

See Classes and class pickers.

E

enum

A set of named whole-number constants. Entries count up from the last value, starting at 0.

See The language.

Equipment

Halo 3's equipment, such as bubble_shield, regenerator or trip_mine. place_at_me deploys it as if thrown, and give_equipment(name) hands it to a living player's body to use with Use equipment.

See Equipment, guns and vehicles by name.

Event

A handler that runs when something happens: on init, on widget click, on button press, on object damaged, on object death, players joining, spawning, leaving and changing teams, vehicles entered and left, objectives picked up, dropped, reset and scored, and more. Each event has one handler, at the top level of the file (on object damaged may have more, for one label or one category); everything outside the events runs every tick.

See Events and timers.

F

Faction

A side in UNSC vs Covenant vs Flood and UNSC vs Covenant: Reach. The lobby's teams are the factions, and each has limited reinforcements.

See UNSC vs Covenant vs Flood.

for each

Loops over every player (for each player, or randomly for a shuffled order), every team, every object, or the objects with a label (for each object with label "gift"). Each visit sets current_player, current_team or current_object; dead players are visited too.

See Values and conditions.

Fine units

A header's [logic] setting, fine_units = true, that counts positions, distances, speeds and facings in thousandths of a Forge unit and of a degree, for modes that move bodies themselves.

See Fine units.

Forge label

A group name saved on a Forge object under Megalith scripting in its Properties, up to 32 bytes, with capitals counting. Scripts find labeled objects with for each object with label and test one with has_forge_label, so one script works on any map whose objects carry the label.

See Forge objects by label.

Forge unit

The distance unit of Forge, 10 feet. Positions, distances and offsets in a script are in tenths of a Forge unit; move_to, a position in the header and zone sizes are in whole Forge units. In fine units they're all thousandths.

See Units.

function

A named block of script that may take up to 16 values, each written TYPE NAME, such as function award(number amount, player who). It works on the caller's current player, team and object too and returns nothing; return leaves it early. Declare it before using it.

See Functions.

G

Game Modes folder

The folder in your player folder where modes live; in Host Game, Game Type, Open Folder opens it. A mode in it, or in a folder inside it, is on the Megalith card after Refresh.

See Install a mode.

Game option

A setting of Game Options, set in the header's [options] by its name, such as "rounds.teams" = 1. The quickest way to find a name is to change the setting, choose Save as Variant and read the saved .json file.

See Game options by name.

Game type

The multiplayer game type a mode plays, named by mode in the header, such as Slayer, KingOfTheHill or Territories; Slayer without one. Its objectives, scoring and round rules keep running alongside the script, and Forge and the campaign can't be scripted.

See Game types.

Global variable

A variable slot that belongs to the round: 64 numbers, 32 objects, 16 players, 16 teams and 16 timers, such as global.number[0]. Every round starts fresh.

See The language.

H

Health and shields

On a body, max_health and max_shields set the maximums in percent of the character's own, 1 to 1000, and health and shields set what's left. On a player's body they stay for every life from then on.

See Health, shields and seats.

HUD widget

One of a mode's 32 text lines, script_widget[0] to script_widget[31], each with an optional bar. Every player has their own copy, so text, bars and visibility can differ from player to player; widgets start hidden, and a placed widget sits anywhere on the script screen.

See HUD widgets.

I

if, elseif, else, altif, alt

if … then … elseif … then … else … end tests comparisons and condition calls, joined with not, and and or, and runs the first branch whose condition holds. or binds first. Megalo's altif and alt also work, but check the earlier conditions again rather than remembering which branch ran; an if takes one kind or the other.

See Branches and leaving early.

J

JSON game type

A mode saved as a .json file: Game Options → Save as Variant writes one with the script and options together, and mode-compile makes one from a source. It holds the source text too, and older modes written in JSON keep working.

See Older JSON modes.

L

Loadout

What a class carries: primary and secondary weapons by name or tag path, dual_wield, and grenades, 0 to 4 each of frag, plasma, spike and firebomb. A script can also arm a player with set_weapon.

See Classes and class pickers.

Loadout camera

A Reach game variant's wait at each round's start, game.loadout_cam_time seconds (10 unless the variant says otherwise), in which nobody gets a body and each player sees the map's Initial Loadout Camera. The script and its timers run meanwhile.

See How Reach's game variants play.

local

A variable of a block's own, such as local number total or local object nearest = current_object, gone with the block and empty each time it's entered. Locals are temporaries.

See Variables.

Looks

A look a mode puts over the one a player picked, with set_model, set_armor, set_armor_color and set_visor_color; what it leaves out stays the player's. reset_look() gives back the player's own, and a look lasts until the round ends.

See Looks.

M

Megalith

Project Reclaimer's game mode language, grown from Megalo so far that it has a name of its own (before 0.10.12 it was called Megalo). It reads every Megalo source as written, adds arithmetic, more events, else, break and return, functions with values and local variables, and every bundled mode is written in it. Only the host runs a script; players see what it does through the game.

See What Megalith is.

Megalith card

The card after the game types in the game type picker, listing every Megalith mode with the game type it plays. A mode also shows among the variants of its game type.

See Play one.

Megalith console

The chat line's /megalith command (/megalo still works), which runs a line of Megalith in the running game, or reloads or restarts the mode's script without loading the map again. Off by default: turn on Megalith console in Host Settings and host on this PC alone, with Network set to Local. It never works in a game other players can join.

See The Megalith console.

Megalo

The scripting language of Halo: Reach's game types, in the text form ReachVariantTool writes. Megalith grew from it and reads every Megalo source as written, Reach's own game variants included.

See What Megalith is.

megalo-check

A command of the game that reads a script alone, checks its types and lists what it needs, such as timer.set_rate. It doesn't read the header or check that Halo 3 can do all of it: mode-check does.

See Check a mode.

Mode header

The block comment from a line --[=[ mode to ]=] that holds a mode's settings as TOML: its name, mode, author, rules, options, world settings and [logic] tables. A source without one plays as Slayer, named after its file.

See The mode header.

Movement shares

What set_movement(share, percent) changes about how a player's bodies move on foot, in percent of the body's own: run_speed, crouch_speed, acceleration, air_acceleration, deceleration and air_deceleration.

See Movement and aim.

mode-check

A command of the game that checks a .rmeg, .rvt or .json mode the way the game does when it lists one: the header, the script, and that the game plays everything it asks for. It names a mistake by line and column.

See Check a mode.

mode-compile

A command that checks a mode and writes the JSON game type it plays to --output NEW.json. It is never needed to play a mode and never overwrites a file.

See Check a mode.

Model variant

One of a body's looks, such as heavy for a Grunt or captain for an ODST, named in the last argument of place_at_me or in a class's model_variant; none gives the default look. A variant the body doesn't have stops the script.

See Choosing a look.

N

neutral_team

The fixed team beside the playable ones. for each team visits it, but it isn't a team to join and has no name to set.

See The language.

no_object, no_player, no_team

Empty references. A saved reference becomes one when its player leaves or its object is deleted, and a call on one does nothing and gives 0 or nothing back.

See The language.

O

Object types

What is_of_type tests and place_at_me makes: object kinds such as vehicle, kinds of vehicle such as aircraft, stock objects, weapons, bodies, objective items (flag, bomb, oddball) and tag paths.

See Object types and tag paths.

Object variable

A variable slot that belongs to an object: 32 numbers, 8 objects, 8 players, 4 teams and 8 timers, such as current_object.number[0].

See The language.

on button press

The event that runs when a player presses a button, with current_player the player who pressed and pressed_button the button, such as button.ability_1 or button.jump. Holding a key doesn't repeat it.

See Buttons in the script.

on init

The event that runs once as each round starts, such as to set a timer counting.

See Events and timers.

on object damaged

The event that runs for every hit on every object, with current_object the object hit, current_player who's responsible and damage_category the kind of hit, beside the attacker's body or vehicle and the damage as it came and as the rules left it. It runs often, so keep its handler short.

See Events and timers.

on object death

The event that runs when a player's body dies, with current_player that player, killed_object the body, killer_player and killer_object. A revive keeps the body from here.

See Events and timers.

on widget click

The event that runs when a player clicks a placed, clickable widget in their script menu, with current_player the player and clicked_widget the widget's number.

See Script menus and clicks.

one_team_ends_scripted_games

A dedicated server's Experimental setting, off by default: a scripted game ends, as Halo 3's own game types do, once only one team has been left for 5 seconds, unless the mode ends the round first. A game that began with one team never ends this way.

See Teams and the game.

Option

A setting hosts can change, declared in [logic.options] as { value, min, max } and shown under Custom Mode Options in the game type's rules. The script reads it as script_option[n], counting the options in alphabetical order; a mode declares up to 32 and reads the first 16.

See Options, traits and zones.

Other games' characters

Characters of Halo: Reach, Halo: Combat Evolved and Halo 2, such as reach_spartan, halo1_chief or halo2_elite, which a mode names like any body when that game is installed. The host's Other games' characters setting, on by default, allows them, and players who join need that game.

See Other games' bodies.

P

place_at_me

place_at_me(type, label, flags, x, y, z, variant) creates an object at this one and returns it. The offsets are tenths of a Forge unit along the object's heading, and the last value is a body's model variant or none.

See Creating objects.

Player variable

A variable slot that belongs to a player: 32 numbers, 8 objects, 8 players, 8 teams and 8 timers, such as current_player.number[0]. It stays through respawns and is cleared when the player leaves, so it suits cooldowns, deployed objects and a chosen class.

See The language.

pregame and local

Reach's events, read in any source. pregame runs before init as a round starts, and local runs each tick once for each player, with hud_player that player and the widgets it changes theirs alone.

See Reach's calls, and what doesn't play.

R

Raycast

game.raycast(x1, y1, z1, x2, y2, z2): a line between two points that the host follows through the level and its objects. From the next tick on, game.raycast_hit() says whether it met something, and where and what.

See Teams and the game.

Reach content on Halo 3 maps

On Halo 3 and ODST maps, a mode that names Reach objects such as unsc_data_core gets them brought from Reach before the map loads, with the loadout weapons Halo 3 lacks and missing announcer lines. The host needs Reach installed and Other games' characters on, and the map still needs the labels the mode expects.

See Reach's objectives and announcer on Halo 3 maps.

Reach game variant

One of Halo: Reach's own game variants, from MCC, the Workshop or ReachVariantTool. It runs through the same interpreter as a .rmeg, but plays by Reach's rules where they differ from Megalith's: its script reads the options the host set, its timers count as Reach's, and a division by zero gives 0.

See How Reach's game variants play.

Reference

A variable that holds an object, a player or a team. It stays on what it points at: when the player leaves or the object is deleted it becomes no_object or no_player, never something else. References take only =.

See The language.

Refresh

The game type picker's button that reads the Game Modes folder again. After every change to a file, choose Refresh and select the mode again: the lobby keeps the copy it loaded, and a running round keeps the script it started with.

See Make your first change.

Reinforcements

A faction's lives in UNSC vs Covenant vs Flood and its Reach version, 150 by default. Each death costs one, a faction with none deploys nobody, and the faction with the most when the battle ends wins.

See UNSC vs Covenant vs Flood.

Respawn object

The object a dead player spawns beside, set with set_primary_respawn_object(object): a teammate's body, a beacon, a vehicle or a fallen body. no_object spawns them where Halo 3 does.

See Spawning and reviving.

return

Leaves the function or event being run; in the script's body, the rest of this tick's run.

See Branches and leaving early.

Revive

Bringing a fallen player back where they fell: keep their body from on object death and respawn them beside it at once. Conquest's and Combined Arms' Medics revive by holding Ability 3 over the body.

See Spawning and reviving.

.rmeg

The file extension of a Project Reclaimer Megalith mode: one text file holding the mode header and the script. ReachVariantTool's .rvt files read the same; a file ending in .rmeg.txt isn't listed.

See What Megalith is.

S

Script menu

A player's menu over the game, opened with current_player.set_ui_menu(true): their cursor appears and their game input stops; on a controller the D-pad walks the clickable widgets and A clicks. Clicking a placed widget marked with set_clickable runs on widget click, and only the script closes the menu.

See Script menus and clicks.

Script screen

The 1280 by 720 area, 0, 0 at the top left, on which placed widgets sit. Each player's view shows it scaled to fit and centered, so a layout keeps its proportions on every display.

See Per-player text and placement.

Script stops

What happens when an event fails, such as a division by zero (outside a Reach game variant), a value out of range or too many steps: its changes to the script's state are thrown away and the script stops for the rest of the game. The game goes on without it, and the host's log says why, by line and column.

See Limits.

scripted_round_end

A [logic] setting of the header: with true, the game type's score, time and objective limits no longer end a round, and the script ends it with game.end_round() or team.end_round().

See The mode header.

Spawn beacon

An object a squad or team spawns beside. In Conquest it's a Recon's deployed radar jammer, their squad's until the enemy destroys it; Combined Arms uses objects labeled spawn_beacon.

See Conquest.

Spawn sequence

A number from −128 to 127 saved on a Forge object beside its label, read by scripts as spawn_sequence to tell labeled objects apart. Objects without one, and objects the script creates, read 0.

See Forge objects by label.

Squad

A group of players in a team, 1 to 16, set with set_squad(n) and read with get_squad(); 0 is none. The deployment map shows a player their squad in green, and a squad can have deploy points of its own.

See Squads and the deployment map.

Step limit

The most steps one event may take: 65,536 in a game of up to 16 players, and more in bigger games. It keeps any script from running forever or holding up the game.

See Limits.

T

Tag path

The name of an object tag the map has, such as "objects/vehicles/mongoose/mongoose", written with forward slashes. place_at_me, set_weapon, a class's weapons and the vehicle calls take one, so a mode can use a mod's or another game's objects loaded on the map.

See Tag paths.

Team count

declare team_count, from 2 to 64 at the top level of the script, gives a team game more teams than Halo 3's eight. Only Slayer, Oddball, King of the Hill, VIP and Territories can have more than eight, and in a mode with classes it must match the classes' teams.

See More teams, names and colors.

Team names and colors

team[3].set_name("Squad %n", 4) and team[3].set_color(255, 140, 0) rename and recolor a team everywhere players see it. Teams 9 to 64 start as “Team 9” to “Team 64”, each with a color of its own.

See Team names and colors.

Team variable

A variable slot that belongs to a team: 32 numbers, 8 objects, 8 players, 8 teams and 8 timers, such as team.number[0].

See The language.

Temporaries

Variable slots that last for the current tick only: 256 numbers, 128 objects, 64 players and 64 teams, and no timers. They take no starting value. local variables and functions' values are temporaries too.

See The language.

Territories

Halo 3's game type of capturing and holding territories, which Conquest plays. team.get_territory_count() counts a team's, and object.get_territory_owner() tells who holds one by its marker object.

See Game types.

Tick

One step of the game, 30 or 60 a second as the host runs, which game.get_ticks_per_second() reads; game.get_tick() counts them from the round's start. Everything outside an event runs on every tick, after that tick's deaths and spawns; a paused game has no ticks.

See Events and timers.

Tickets

A team's score in Conquest, kept in a number of the script: each death costs one, a Medic's revive gives it back, and the team holding fewer territories bleeds them. A team out of tickets loses.

See Conquest.

Timer

A variable that counts seconds. set_rate(-100%) counts it down, 100% up and 0% stops it; reset() puts back its declared value, and is_zero() is a test to check every tick, not an event.

See Events and timers.

Trait set

A set of Halo 3 player traits declared in [[logic.megalo_traits]], read as script_traits[0] and on, up to 16. apply_traits gives one for a single tick, so apply it every tick the player should have it.

See Options, traits and zones.

Trait values

The values a trait set or a class's traits take: each a choice by its place in Game Options' list, not a percentage, with 0 meaning unchanged.

See Trait values.

V

Variable

A numbered slot holding a whole number, a reference or a timer. Slots belong to the round, a player, a team, an object or the current tick, count from 0, and are named with alias.

See The language.

W

Waypoint

Halo 3's objective marker over an object, shown once set_waypoint_visibility is set, with an icon, a priority, and optional text and timer. It's blue to the object's team and red to the others, and at most 64 show at once.

See Waypoints.

Z

Zone

An invisible area with a shape, a sphere, a box or a cylinder, that players can't see or bump into. A mode declares one in its header, or uses a Forge object's zone; shape_contains tests whether an object is inside (a player's body by its feet or a point just above them), and set_position moves it.

See Options, traits and zones.