DocsMegalithObjects and the world
Object types and tag paths
is_of_type(…) and place_at_me(…) take:
| Type | Names | Takes it |
|---|---|---|
| An object kind | biped, vehicle, weapon, equipment | is_of_type |
| A kind of vehicle | aircraft (one that flies: Banshee, Hornet), ground_vehicle, multi_seat_aircraft and multi_seat_ground_vehicle (more than one seat a player may take: the Hornet; the Warthog, Mongoose, Scorpion…). A turret, mounted or not, is of none of them. | is_of_type, set_driver_use |
| A stock object | Equipment, emplacements and vehicles | Both |
| A weapon | assault_rifle, battle_rifle, smg, smg_silenced, carbine, magnum, automag, plasma_pistol, plasma_rifle, spiker, needler, shotgun, sniper_rifle, beam_rifle, rocket_launcher, spartan_laser, brute_shot, mauler, energy_sword, gravity_hammer, sentinel_beam, fuel_rod_gun, flamethrower, missile_pod, machine_gun_turret, plasma_cannon, hunter_cannon | Both |
| A body | The body list | place_at_me |
| An objective item | flag, bomb, oddball (or skull) | is_of_type |
| A tag path | "objects/vehicles/mongoose/mongoose", as text | Both |
A name matches only those objects, whoever made them. Halo 3 makes mounted guns and the Automated Turret as vehicles. hunter_cannon is the Hunter's own weapon, from the campaign. Weapons are the same names set_weapon and a class's primary take.
A Megalith mode's game gets every Forge object, on a saved Forge map too, since a script may create any of them; a plain game type on a saved map loads only what the map places.
Tag paths
A tag path names any object tag the map has: vehicles, weapons, equipment, bodies, scenery, crates and devices, such as machines and controls, modded ones included. Write it with forward slashes, since a backslash in text starts an escape; case doesn't matter. set_weapon, a class's primary and secondary, set_respawn_vehicle, set_weapon_pickup and set_driver_use take paths too. The Reclaimer Kit shows you a map's tags.
New in 0.10.5: weapon paths work in loadouts as well as object creation. For example, current_player.set_weapon("objects/weapons/rifle/battle_rifle/battle_rifle") keeps that weapon in the player's hands. In a class header, use primary = "objects/weapons/rifle/battle_rifle/battle_rifle". Replace the path with the weapon tag shown in your map's Tags workspace to use a mod's weapon.
A path first finds the map's own tag, then another game's content brought onto it. With the host's Sandbox set to Halo 3 on a Reach map, Halo 3 weapon paths still find Halo 3's imported weapons. A stock name such as battle_rifle follows the chosen sandbox's replacement; a path keeps the particular tag it names. A path alone does not install a game or import a missing weapon.
alias barrel = player.object[0]
for each player do
if current_player.is_not_respawning() and current_player.barrel == no_object then
current_player.barrel = current_player.biped.place_at_me("objects/gear/human/industrial/h_barrel_rusty/h_barrel_rusty", "barrel", none, 20, 3, 5, none)
end
end
A map's cache file holds more tags than the map loads. A path names only a tag whose model and its parts the map loads: the engine makes objects of no other, a crate needs its physics, and a tag the map lacks never matches. The host's log lists, once a round, which of the script's types the map has and which it lacks: [modes] 'NAME' names what this map lacks: …. Guardian, for example, loads its rusty barrels and pallets but not its packing crates or street cones.
Copies
place_at_me(object, label, flags, x, y, z, none) given an object in place of a type makes a new object of its tag, while the original stays. object.duplicate("label") is the short form: a copy of the object where it is, under that label. A copy of no_object makes nothing.
A tag path or a copy the engine refuses there, because it's placed outside the map, makes nothing: the host logs it once, and the script goes on with an empty reference. A stock or named object the map lacks, or the engine refuses, stops the script.
