player.set_biped
If this function is passed a valid biped, it forces the context player to abandon control of their current biped and take control of the passed-in biped. If this function is not passed a valid biped, then it does nothing. Either way, the player's old biped is not deleted from the map; it simply becomes an inactive NPC.
Arguments
- biped
The biped to force the player into.
Example
-- -- Force players into Monitors. -- for each player do if current_player.biped != no_object and not current_player.biped.is_of_type(monitor) then global.object[0] = current_player.biped global.object[1] = current_player.biped.place_at_me(monitor, none, none, 0, 0, 0, none) current_player.set_biped(global.object[1]) global.object[0].delete() end end
Notes
-
Holograms do not test as being Spartans, Elites, or Monitors. However, they are still valid bipeds; passing a Hologram to
set_biped
will place the player in control of the biped.Holograms spawn with a primary weapon only, with a full magazine regardless of how much ammo the caster had left. If a Hologram's player traits don't prevent it from taking damage, then it will be killed when it expires. Any weapons dropped by a Hologram will be deleted instantly; this includes any cases of a Hologram swapping a held weapon for one on the ground. Any items that a Hologram is carrying at the time it dies or expires will be deleted. Holograms can use Armor Abilities, but the Hologram ability has no effect for them because the "hologram" bipeds don't have a "Hologram Unit" set.
If a player is forced to control their own Hologram, this will affect their respawns. If the Hologram dies while under control, they will not be placed back into their original body; instead, they will respawn normally (if the Hologram was killed), or they will instantly appear in a new body such that there is never any frame on which the player has no biped (if the Hologram expires due to its natural timer).
-
If necessary, you can spawn a biped inside of a vehicle by spawning the biped, forcing a player to control it, forcing the player into the vehicle, and then returning the player to their original biped. However, if the player is spawned on the map at the time, then there will be a brief cut to black for that player; they will notice the loss of control. If you need to spawn NPC bipeds into vehicles, it is best to do this during the initial loadout camera or while a player is waiting to respawn, if possible.
NPC bipeds that occupy vehicles will behave the same as players who are not providing any inputs; for example, an NPC-occupied Banshee will fly forward automatically.
By default, Monitors spawn with an invisible Focus Rifle, and are capable of picking up weapons, grenades, and Armor Abilities. Monitors can fire any ranged weapon and can use any Armor Ability that does not depend on character model animations (e.g. they can use Active Camo but cannot Sprint); they cannot melee or throw grenades, though they will make melee sounds. Equipped Armor Abilities will be visible on the Monitor's body, displaying their holographic icons as if they were still lying around waiting to be picked up.
Once a Megalo-spawned biped has been controlled by a player, it will take on that player's appropriate armor or team color and (if it's a Spartan) its voice will match the player's chosen gender regardless of its own gender presentation. Moreover, in FFA games, the biped will appear allied to the last player who controlled it, even if it appeared as an enemy to them beforehand.
-
You can force a player into a biped while the initial loadout camera is playing, and they will be able to play early. However, if you do this, the player will hear a constant shrill beeping, like the ring of an alarm clock. It appears that this beeping plays for every frame that the player spends in control of a biped, if that player has never controlled a "natural" biped before; the solution is to ensure that the player has spent at least one frame in control of a normally-spawned biped before forcing them into a new biped.
I was able to identify the beeping sound; it is defined in the following tags. These tags seem to have been intended for the Missile Pod, a weapon present only in Halo 3; however, a search for Missile Pod gameplay videos on YouTube failed to turn up anywhere this exact sound plays.
- lsnd\sound\weapons\missile_launcher\tracking_locking\locking\loop
- snd!\sound\weapons\missile_launcher\tracking_locking\locking\loop
I was unable to locate anything that could use the tag. If the usual community tools for browsing *.MAP files allow you to search for anything that uses a tag, I haven't managed to find that feature.
Suppose a player is given control of a biped and later has that control revoked. If at some point afterward you try to rotate the biped and give the player control over it, all on the same frame, then the rotation will fail: the biped will continue to aim in the last direction the player was aiming when they lost control over it. This can cause issues in cases where you want to switch a player between multiple bipeds, seamlessly; the solution is to rotate the biped on one frame and then wait 'til the next to actually force the player into it.
Forcing the player into a dead biped will cause their camera to point toward the ground, and lock their camera more-or-less at ground height. They will be unable to move, pick up weapons, or otherwise interact with the environment. As long as the body remains present, the player will not respawn; if the biped was set by scripts to never be garbage-collected, then the player is effectively trapped.