Documentation
¶
Overview ¶
Package mod writes Modlock mods in Go. A mod registers its handlers in an init function; modlock-host compiles the module to a sandbox inside the game server and calls the handlers on the server's frame thread, one at a time.
package main
import "github.com/paralin/modlock/mod"
func init() {
mod.Command("hello", func(p mod.Player, args string) {
p.Chat("Hello from Go!")
})
}
func main() {}
Build it with:
GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o hello.wasm
The calls into the game and their types are generated from the schema in host.gen.go.
Index ¶
- Constants
- func BlockInput(buttons uint64) error
- func CallService(service, method string, payload []byte) ([]byte, error)
- func ClearMap() error
- func Command(name string, handler func(p Player, args string))
- func CreateEntity(options *EntityOptions) (uint32, error)
- func Damage(options *HitOptions) error
- func EmitSound(entity uint32, sound string) error
- func EncodeSpot(s *Spot) ([]byte, error)
- func FindEntities(className string) ([]uint32, error)
- func FireInput(entity uint32, input string, value any, activator *uint32) (bool, error)
- func HoldMatchClock(seconds *float32) error
- func HoldModifierState(entity uint32, state string, active *bool) error
- func HoldReload(held bool) error
- func Log(args ...any)
- func MatchClock() (float32, error)
- func ModifierState(entity uint32, state string) (bool, error)
- func MoveEntity(entity uint32, position *Vector, facing *Angles, velocity *Vector) error
- func OnDamage(handler func(hit *DamageEvent) *DamageResult)
- func OnDamaged(handler func(hit *DamagedEvent))
- func OnFrame(handler func(f *FrameEvent))
- func OnImpact(handler func(impact *ImpactEvent))
- func OnInput(handler func(p Player, pressed, released uint64))
- func OnLanded(handler func(landing *LandedEvent))
- func OnLaunch(handler func(projectile *LaunchEvent))
- func OnNpcsRestored(handler func(err error))
- func OnRestored(handler func(p Player, err error))
- func OnSettingChanged(handler func(p Player, key, value string))
- func OnStart(handler func(args []string))
- func OnWorld(handler func(mapName string))
- func Pause(paused bool) error
- func Precache(options *PrecacheOptions) error
- func PushEntity(entity uint32, velocity, spin *Vector) error
- func ReadField(entity uint32, className, field string, kind FieldType) (any, error)
- func ReadFieldList(entity uint32, className, field string, kind FieldType) ([]any, error)
- func ReadFile(name string) (*string, error)
- func ReadModifierField(entity uint32, modifier, className, field string, kind FieldType) (any, error)
- func RemapInput(from, to uint64, repeat *bool) error
- func RemoveEntities(className string) (int32, error)
- func RemoveEntity(entity uint32) (bool, error)
- func RestoreNpcs(npcs []*NpcTarget) error
- func Serve(service string, handler Service)
- func ServerCommand(command string) error
- func SetFreeForAll(enabled bool) error
- func SetOrbitCamera(player Player, enabled bool) error
- func SetTeamSeating(enabled bool) error
- func ShowEntityOnlyTo(entity uint32, players []int32) error
- func ShowEntityToAll(entity uint32) error
- func StartRift(position *Vector) error
- func WatchInput(buttons uint64) error
- func WatchProjectiles(options *ProjectileOptions) error
- func WriteField(entity uint32, className, field string, kind FieldType, value any) error
- func WriteFieldList(entity uint32, className, field string, kind FieldType, values []any) error
- func WriteFile(name, text string) error
- type Ability
- type AbilityOptions
- type Angles
- type BotOptions
- type BotOptionsHeroId
- type BotOptionsHeroName
- type CameraApproach
- type CameraHold
- type CameraLag
- type CameraLerp
- type CameraOptions
- type CameraParam
- type CameraSpring
- type CommandEvent
- type CommandResult
- type Connection
- type DamageEvent
- type DamageResult
- type DamagedEvent
- type DriveCommand
- type EntityClassName
- type EntityOptions
- type EntityPlacement
- type EquipmentTarget
- type FieldType
- type FieldWrite
- type FogOptions
- type FrameEvent
- type HeroTarget
- type HitOptions
- type ImpactEvent
- type InputEvent
- type KeyValue
- type LandedEvent
- type LaunchEvent
- type LoadedSpot
- func (l *LoadedSpot) At(entity uint32) *Placed
- func (l *LoadedSpot) Bounce(movement []*MovementSample)
- func (l *LoadedSpot) Clear()
- func (l *LoadedSpot) Objects() []*Placed
- func (l *LoadedSpot) Place(object *SpotObject) (*Placed, error)
- func (l *LoadedSpot) Remove(placed *Placed)
- func (l *LoadedSpot) Spot() *Spot
- type ModelOptions
- type MovementAction
- type MovementCommand
- type MovementSample
- type Npc
- type NpcOptions
- type NpcState
- type NpcTarget
- type NpcsRestoredEvent
- type ParticleAnchor
- type ParticleOptions
- type ParticlePoint
- type Pawn
- type Pickup
- type PickupKind
- type Placed
- type Player
- func (p Player) Abilities() ([]*Ability, error)
- func (p Player) AddMetric(name string, value float64, label *string) error
- func (p Player) AdjustSouls(delta int32, silent *bool) error
- func (p Player) Announce(title, text string) error
- func (p Player) BlockInput(buttons uint64) error
- func (p Player) Buttons() (uint64, error)
- func (p Player) CenterText(text string) error
- func (p Player) ChangeTeam(team int32) error
- func (p Player) Chat(text string) error
- func (p Player) ClearCamera(context *string) error
- func (p Player) ClearItems() error
- func (p Player) ClearScreenEffect(effect ScreenEffect) error
- func (p Player) Drive(command *DriveCommand) error
- func (p Player) FreeCamera(position *Vector, facing *Angles) error
- func (p Player) Freeze(frozen *bool) error
- func (p Player) GiveItem(item string) error
- func (p Player) GiveModifier(modifier string, seconds float32) error
- func (p Player) Heal(amount int32) error
- func (p Player) HoldModifier(modifier string, active *bool) error
- func (p Player) Kill() error
- func (p Player) Move(position *Vector, facing *Angles, velocity *Vector) error
- func (p Player) MoveCamera(options *CameraOptions) error
- func (p Player) Pawn() (*Pawn, error)
- func (p Player) Press(buttons uint64) error
- func (p Player) RefreshAbility(ability string) error
- func (p Player) RemoveBot() error
- func (p Player) ReplaceAbility(index uint32, ability string) error
- func (p Player) ResetHero(souls int32) error
- func (p Player) Respawn() error
- func (p Player) RestoreHero(target *HeroTarget) error
- func (p Player) RestoreStamina() error
- func (p Player) ScreenEffect(effect ScreenEffect, timing *ScreenTiming) error
- func (p Player) SelectHero(hero any, team int32) (uint32, error)
- func (p Player) SetAbility(options *AbilityOptions) error
- func (p Player) SetSetting(key, value string) error
- func (p Player) SetStamina(stamina float32) error
- func (p Player) SetVelocity(velocity *Vector) error
- func (p Player) Setting(key string) (string, error)
- func (p Player) SettingNumber(key string) (float64, error)
- func (p Player) SettingOn(key string) (bool, error)
- func (p Player) Sound(sound string) error
- func (p Player) Spectate() error
- func (p Player) StartingSouls(souls int32) error
- func (p Player) Steer(steering *Steering) error
- func (p Player) Teleport(position *Vector, facing *Angles, velocity *Vector) error
- func (p Player) Unwatch() error
- func (p Player) Watch(target uint32, chase *bool) error
- func (p Player) WatchMovement(watch bool) error
- type PlayersChangedEvent
- type PrecacheOptions
- type ProjectileOptions
- type RestoredEvent
- type RiftState
- type Score
- type ScreenEffect
- type ScreenTiming
- type Service
- type ServiceCall
- type ServiceReply
- type SettingChangedEvent
- type Spot
- type SpotObject
- type StartEvent
- type StartResult
- type Steering
- type TextOptions
- type Timer
- type TimerTarget
- type TraceHit
- type TraceOptions
- type UiPressEvent
- type Vector
- type WorldEvent
- type WorldObject
- func (w WorldObject) Entity() (uint32, error)
- func (w WorldObject) Move(position *Vector, facing *Angles) error
- func (w WorldObject) Remove() error
- func (w WorldObject) SetHidden(player Player, hidden bool) error
- func (w WorldObject) SetText(text string) error
- func (w WorldObject) ShowOnlyTo(players []int32) error
- func (w WorldObject) ShowToAll() error
Constants ¶
const ( // ButtonAttack is the primary fire button. ButtonAttack uint64 = 1 // ButtonJump is the jump key, Space by default (IN_MANTLE). Blocking it // stops the native jump and mantle; the jumping client still predicts // the jump and is corrected. ButtonJump uint64 = 1 << 48 // ButtonCrouch is the crouch key, Ctrl by default. ButtonCrouch uint64 = 1 << 2 // ButtonDash is the dash key, Shift by default. ButtonDash uint64 = 1 << 16 // ButtonUse is the interact key. ButtonUse uint64 = 1 << 5 // ButtonAltFire is the zoom and alternate fire button, right mouse by // default. ButtonAltFire uint64 = 1 << 11 // ButtonReload is the reload key. ButtonReload uint64 = 1 << 13 // ButtonMelee is the light melee key, Q by default. ButtonMelee uint64 = 1 << 32 // ButtonAbility1 to ButtonAbility3 are the hero's first three ability // keys. ButtonAbility1 uint64 = 1 << 33 ButtonAbility2 uint64 = 1 << 34 ButtonAbility3 uint64 = 1 << 35 // ButtonUltimate is the hero's ultimate ability key, the fourth. ButtonUltimate uint64 = 1 << 36 // ButtonParry is the melee parry button. ButtonParry uint64 = 1 << 42 )
Button bits name inputs for BlockInput, WatchInput and Player.Press.
const ( // LayerSolid is the world and solid objects. LayerSolid uint64 = 1 << 0 // LayerHitbox is the hit boxes of heroes and units. LayerHitbox uint64 = 1 << 1 // LayerTrigger is invisible volumes that react to touch. LayerTrigger uint64 = 1 << 2 // LayerPlayerClip is walls that only stop heroes. LayerPlayerClip uint64 = 1 << 4 // LayerPlayer is player-controlled heroes. LayerPlayer uint64 = 1 << 18 // LayerNpc is units that are not players. LayerNpc uint64 = 1 << 19 // LayerStaticLevel is the map's built geometry, foliage included. LayerStaticLevel uint64 = 1 << 30 // LayerHero, LayerTrooper and LayerBuilding are those units' bodies. LayerHero uint64 = 1 << 37 LayerTrooper uint64 = 1 << 38 LayerBuilding uint64 = 1 << 40 )
Layer bits name collision layers for Trace.
const ( // ScreenEffectKilled is the death treatment. ScreenEffectKilled = effectspb.ScreenEffect_SCREEN_EFFECT_KILLED // ScreenEffectBlack fades the view to black. ScreenEffectBlack = effectspb.ScreenEffect_SCREEN_EFFECT_BLACK // ScreenEffectBlinded is the blind treatment. ScreenEffectBlinded = effectspb.ScreenEffect_SCREEN_EFFECT_BLINDED // ScreenEffectDarkness is Drifter's darkness view. ScreenEffectDarkness = effectspb.ScreenEffect_SCREEN_EFFECT_DARKNESS // ScreenEffectMatchIntro is the match start treatment. ScreenEffectMatchIntro = effectspb.ScreenEffect_SCREEN_EFFECT_MATCH_INTRO )
The values of ScreenEffect.
const ( // FieldTypeBool is one byte read as a boolean. FieldTypeBool = fieldspb.FieldType_FIELD_TYPE_BOOL // FieldTypeInt8 through FIELD_TYPE_UINT32 are integers read as numbers. FieldTypeInt8 = fieldspb.FieldType_FIELD_TYPE_INT8 FieldTypeInt16 = fieldspb.FieldType_FIELD_TYPE_INT16 FieldTypeInt32 = fieldspb.FieldType_FIELD_TYPE_INT32 FieldTypeUint8 = fieldspb.FieldType_FIELD_TYPE_UINT8 FieldTypeUint16 = fieldspb.FieldType_FIELD_TYPE_UINT16 FieldTypeUint32 = fieldspb.FieldType_FIELD_TYPE_UINT32 // FieldTypeInt64 and FIELD_TYPE_UINT64 are 64-bit integers. FieldTypeInt64 = fieldspb.FieldType_FIELD_TYPE_INT64 FieldTypeUint64 = fieldspb.FieldType_FIELD_TYPE_UINT64 // FieldTypeFloat32 and FIELD_TYPE_FLOAT64 are floating point numbers. FieldTypeFloat32 = fieldspb.FieldType_FIELD_TYPE_FLOAT32 FieldTypeFloat64 = fieldspb.FieldType_FIELD_TYPE_FLOAT64 // FieldTypeVector is three floats, such as a position or angles. FieldTypeVector = fieldspb.FieldType_FIELD_TYPE_VECTOR // FieldTypeHandle is an entity handle, read as a number. FieldTypeHandle = fieldspb.FieldType_FIELD_TYPE_HANDLE // FieldTypeString is a string the field points to. FieldTypeString = fieldspb.FieldType_FIELD_TYPE_STRING )
The values of FieldType.
const ( // PickupKindUrn is the soul urn, which its carrier delivers. PickupKindUrn = entitiespb.PickupKind_PICKUP_KIND_URN // PickupKindMovementBuff is the movement speed buff. PickupKindMovementBuff = entitiespb.PickupKind_PICKUP_KIND_MOVEMENT_BUFF )
The values of PickupKind.
const ( MovementActionLanded = movementpb.MovementAction_MOVEMENT_ACTION_LANDED MovementActionZiplineAttached = movementpb.MovementAction_MOVEMENT_ACTION_ZIPLINE_ATTACHED MovementActionGroundDash = movementpb.MovementAction_MOVEMENT_ACTION_GROUND_DASH MovementActionSlide = movementpb.MovementAction_MOVEMENT_ACTION_SLIDE MovementActionBouncePad = movementpb.MovementAction_MOVEMENT_ACTION_BOUNCE_PAD MovementActionDashJump = movementpb.MovementAction_MOVEMENT_ACTION_DASH_JUMP MovementActionAirJump = movementpb.MovementAction_MOVEMENT_ACTION_AIR_JUMP MovementActionWallJump = movementpb.MovementAction_MOVEMENT_ACTION_WALL_JUMP MovementActionAirDash = movementpb.MovementAction_MOVEMENT_ACTION_AIR_DASH MovementActionMeleeStarted = movementpb.MovementAction_MOVEMENT_ACTION_MELEE_STARTED // AbilityExecuted is any ability the hero cast. MovementActionAbilityExecuted = movementpb.MovementAction_MOVEMENT_ACTION_ABILITY_EXECUTED )
The values of MovementAction.
const ( // CameraParamDistance is how far behind the hero the camera sits. CameraParamDistance = playerspb.CameraParam_CAMERA_PARAM_DISTANCE // CameraParamFieldOfView is the view's field of view in degrees. CameraParamFieldOfView = playerspb.CameraParam_CAMERA_PARAM_FIELD_OF_VIEW // CameraParamTarget is the position the camera follows. CameraParamTarget = playerspb.CameraParam_CAMERA_PARAM_TARGET // CameraParamVerticalOffset raises the camera. CameraParamVerticalOffset = playerspb.CameraParam_CAMERA_PARAM_VERTICAL_OFFSET // CameraParamHorizontalOffset moves the camera to the side. CameraParamHorizontalOffset = playerspb.CameraParam_CAMERA_PARAM_HORIZONTAL_OFFSET )
The values of CameraParam.
Variables ¶
This section is empty.
Functions ¶
func BlockInput ¶
BlockInput withholds buttons from every player's hero until called again. Stopping the mod releases them.
func CallService ¶
CallService calls method of a service the host provides outside Modlock, such as a game mode's match, and returns the service's answer. The service defines the payload's encoding.
func ClearMap ¶
func ClearMap() error
ClearMap removes the map's own units and objectives, such as troopers, guardians and walkers, so a mode can use the map as an arena.
func Command ¶
Command calls handler when a player types /name in chat. The handler runs with the next server frame, before the frame handlers, and receives the text after the name, trimmed of surrounding spaces. Registering a name again replaces its handler.
func CreateEntity ¶ added in v0.1.1
func CreateEntity(options *EntityOptions) (uint32, error)
CreateEntity creates any entity the server knows by its designer name, such as npc_trooper_boss or prop_dynamic, with spawn key values and fields written before it spawns. The world removes it when the world ends; stopping the mod removes it too. It refuses an ability, item or weapon, which only a hero holds: GiveItem and ReplaceAbility give one.
func Damage ¶
func Damage(options *HitOptions) error
Damage deals a hit as the game would. The mod's Damage events do not include its own hits.
func EncodeSpot ¶
EncodeSpot returns the spot document. Equal spots encode to equal bytes; positions and angles keep single precision.
func FindEntities ¶ added in v0.1.3
FindEntities returns the handle of every live entity of a class, such as zip_line_node.
func FireInput ¶ added in v0.1.1
FireInput sends an input to a live entity, as a map's output would, such as Skin with the integer 1. The value must have the type the input reads. It reports false once the entity is gone.
func HoldMatchClock ¶
HoldMatchClock keeps the match time at seconds every frame until called again; omitted seconds let it run.
func HoldModifierState ¶
HoldModifierState holds a modifier state, such as MODIFIER_STATE_FRIENDLY_FIRE_ENABLED, on an entity while the mod runs, or releases the hold. The hold ends with the entity.
func HoldReload ¶ added in v0.1.2
HoldReload keeps the running build through a reload while held is true, such as while a player is partway through something a new build would lose. A reload that arrives meanwhile waits, and the newest one applies on the first frame after the mod releases the hold. A new build starts without a hold.
func Log ¶
func Log(args ...any)
Log writes one line to the server log under the mod's name. Arguments are formatted as by fmt.Sprint.
func MatchClock ¶
MatchClock returns the match time in seconds that the scoreboard shows.
func ModifierState ¶
ModifierState reports whether an entity has a modifier state, such as MODIFIER_STATE_PARRY_ACTIVE.
func MoveEntity ¶
MoveEntity places any entity, such as a projectile, and replaces its facing and motion when given. Without a position it leaves the entity where it is, so a velocity alone steers a body the physics simulates, such as a prop_physics, which carries the motion on against the world.
func OnDamage ¶
func OnDamage(handler func(hit *DamageEvent) *DamageResult)
OnDamage calls handler before each hit lands, so it can block the hit or change its damage by returning a result; nil lets the hit through. Later handlers see the earlier ones' amount.
func OnDamaged ¶
func OnDamaged(handler func(hit *DamagedEvent))
OnDamaged calls handler on the frame after each hit lands.
func OnFrame ¶
func OnFrame(handler func(f *FrameEvent))
OnFrame calls handler once per server frame.
func OnImpact ¶
func OnImpact(handler func(impact *ImpactEvent))
OnImpact calls handler when a watched projectile strikes something, inside the game's impact: its calls apply before the game continues.
func OnInput ¶
OnInput calls handler with the watched buttons a player pressed and released, as Button bits, before the next frame. A button is held from its press until its release.
func OnLanded ¶
func OnLanded(handler func(landing *LandedEvent))
OnLanded calls handler when a hero lands under the manifest's QuakeWorld movement, before the next frame.
func OnLaunch ¶
func OnLaunch(handler func(projectile *LaunchEvent))
OnLaunch calls handler with each watched projectile's first frame, before the next frame. WatchProjectiles names the projectiles.
func OnNpcsRestored ¶
func OnNpcsRestored(handler func(err error))
OnNpcsRestored calls handler when RestoreNpcs ends: err is nil once the map holds every target, or says why it does not.
func OnRestored ¶
OnRestored calls handler when a player's Player.RestoreHero ends: err is nil once the target held for a second, or says why it did not.
func OnSettingChanged ¶
OnSettingChanged calls handler when a player's setting changes outside the mod, such as on the player's profile. The mod's own Player.SetSetting calls do not reach it.
func OnStart ¶
func OnStart(handler func(args []string))
OnStart calls handler once when the server starts the mod, with the arguments that follow -- on the modlock-host command line.
func OnWorld ¶
func OnWorld(handler func(mapName string))
OnWorld calls handler with the map's name each time a world loads, and at start when one already has. Objects and bots from an earlier world are gone by then.
func Pause ¶
Pause stops or resumes the game clock, as the pause command would. Stopping the mod resumes it.
func Precache ¶
func Precache(options *PrecacheOptions) error
Precache loads heroes and resources with the next world. Call it during start, before the first world loads; a call after that, such as from a reload, prepares only the world after the next map change. Name every hero whose abilities ReplaceAbility gives, with their particles.
func PushEntity ¶ added in v0.1.31
PushEntity adds a velocity and an angular velocity to any entity. On a body the physics simulates, such as a prop_physics, it acts like an impulse that the simulation carries on.
func ReadField ¶
ReadField reads one schema field of a live entity, such as the int32 m_iHealth of CBaseEntity. The host finds the field by name, so it survives game updates that move it, and refuses an entity that is not of the named class or a subclass. The match's state, such as the gold of each team or the winning team, is a field of CCitadelGameRules, which the citadel_gamerules entity reads. The parts of an entity's model that its body component holds read through the entity too: CGameSceneNode, and for a model entity CSkeletonInstance and CModelState, such as the uint64 m_MeshGroupMask of CModelState that chooses which mesh groups draw.
func ReadFieldList ¶ added in v0.1.3
ReadFieldList reads a field that holds a list, such as the m_vecBannedHeroes of CCitadelGameRules. The type is the type of one element: a number, a handle, a boolean or a vector. A list of structures cannot be read.
func ReadFile ¶ added in v0.1.13
ReadFile reads one of the mod's files: the host's copy, which the mod wrote or the server's operator placed, else the one the mod ships under data/. A file in neither reads as unset. Names that leave the mod's directories are refused.
func ReadModifierField ¶ added in v0.1.17
func ReadModifierField(entity uint32, modifier, className, field string, kind FieldType) (any, error)
ReadModifierField reads one schema field of a modifier the entity holds, such as the int32 m_nCameraLevel of CCitadel_Modifier_OrbitCamera on a pawn holding modifier_citadel_orbit_camera. The answer holds no value while the entity lacks the modifier. The host cannot check the modifier's class, so a wrong class reads the wrong bytes, though never past readable memory.
func RemapInput ¶
RemapInput makes the from buttons act as the to buttons for every player's hero until called again; from reads as up. With repeat, a held from button uses the to ability again as soon as it is ready. A zero from stops remapping, and stopping the mod does too. BlockInput applies after the remap.
func RemoveEntities ¶
RemoveEntities removes every entity of a class, such as npc_trooper, without rewards, and returns how many it removed.
func RemoveEntity ¶ added in v0.1.1
RemoveEntity takes an entity the mod created out of the world without rewards. It reports false when the entity was already gone.
func RestoreNpcs ¶
RestoreNpcs replaces the map's lane units and objectives with targets over the next frames. Units of these classes not in the list are removed, structures that match are kept, and moving units are spawned again in place. An NpcsRestored event reports when every target stands as its own unit, or why not. A new call replaces the running one.
func Serve ¶
Serve answers the host's calls to service with handler. Registering a service again replaces its handler.
func ServerCommand ¶
ServerCommand runs one line at the server console, as if typed there. A line that sets a variable may set a development-only or cheat-protected one.
func SetFreeForAll ¶ added in v0.1.4
SetFreeForAll turns free-for-all on or off for the running mod, over the Manifest's free_for_all default. While on, the host seats each new player on the smaller team with no team screen, holds friendly fire on every hero, makes teammates enemies to abilities, projectiles and target checks, and ignores changeteam commands. The stock hero picker does not open for a seated player, so the mod gives each seated player whose pawn has hero 0 a hero with SelectHero. Turning it off releases the friendly fire holds and restores stock team relations; players keep their teams. Clients still draw teammates as allies.
func SetOrbitCamera ¶ added in v0.1.8
SetOrbitCamera gives the player's hero the hideout's orbit camera, zoomed with the wheel, or returns the normal camera. The hideout HUD replaces the game HUD while it is on.
The pawn's networked m_bInHideoutZone moves its client to the hideout view, and the wheel zooms only while the pawn holds MODIFIER_STATE_HIDEOUT_ZONE, since the server ignores orbit_camera_in and orbit_camera_out without it.
func SetTeamSeating ¶ added in v0.1.28
SetTeamSeating turns team seating on or off for the running mod. While on, the host seats each player who joins with no team on the smaller team with no team screen; friendly fire and changeteam stay as the game has them. The stock hero picker does not open for a seated player, so the mod gives each seated player whose pawn has hero 0 a hero with SelectHero. Free-for-all seats players this way whatever this says. Turning it off leaves players on their teams.
func ShowEntityOnlyTo ¶ added in v0.1.4
ShowEntityOnlyTo sends an entity the mod created only to the players with the listed server slots; every other client drops it, or never receives it when the call follows its creation in the same frame. With no players no client receives it. The list replaces any earlier one. A player who leaves is taken off every list, so whoever joins in their slot does not receive the entity. The rule holds for an entity created with TransmitAlways too, but not for entities parented to it, which need their own call. Removing the entity, the world ending or the mod stopping drops the rule.
func ShowEntityToAll ¶ added in v0.1.4
ShowEntityToAll sends an entity the mod created to every player the game would send it to again, undoing ShowEntityOnlyTo.
func WatchInput ¶
WatchInput replaces the buttons whose presses and releases arrive as Input events. Watching does not withhold a press; block it with BlockInput.
func WatchProjectiles ¶
func WatchProjectiles(options *ProjectileOptions) error
WatchProjectiles reports the projectiles with these designer names, such as rocket_launcher_rocket_projectile, in Launch and Impact events. A new call replaces the list; an empty list stops watching.
func WriteField ¶
WriteField writes one schema field of a live entity and sends the change to the players. The value takes the form ReadField returns for the type; text fields cannot be written. A write to the match's state sends all of it, so players already in the match see the change, and a write to a model part, as ReadField names them, sends the entity.
func WriteFieldList ¶ added in v0.1.3
WriteFieldList replaces the elements of a list field and sends the change to the players, growing the list when it holds fewer elements than the new ones.
func WriteFile ¶ added in v0.1.13
WriteFile replaces one of the mod's files in the host's copy, which outlives a restart and an update of the mod; the files the mod ships stay as they are. The write is whole or not at all, and the host refuses one past its quota of 4 MiB per mod. A host that keeps no files refuses every write.
Types ¶
type AbilityOptions ¶
type AbilityOptions = abilitiespb.AbilityOptions
AbilityOptions changes one ability of a player's hero.
type BotOptionsHeroId ¶
type BotOptionsHeroId = playerspb.BotOptions_HeroId
BotOptionsHeroId sets BotOptions.Hero to HeroId.
type BotOptionsHeroName ¶
type BotOptionsHeroName = playerspb.BotOptions_HeroName
BotOptionsHeroName sets BotOptions.Hero to HeroName.
type CameraApproach ¶ added in v0.1.8
type CameraApproach = playerspb.CameraApproach
CameraApproach moves a param toward a value.
type CameraHold ¶ added in v0.1.8
type CameraHold = playerspb.CameraHold
CameraHold keeps a param where it is.
type CameraLerp ¶ added in v0.1.8
type CameraLerp = playerspb.CameraLerp
CameraLerp moves a param from one value to another over a time.
type CameraOptions ¶ added in v0.1.8
type CameraOptions = playerspb.CameraOptions
CameraOptions adds one operation to a player's camera.
type CameraParam ¶ added in v0.1.8
type CameraParam = playerspb.CameraParam
CameraParam is one value of the camera that follows a hero, which the game's abilities move as Mirage's Tornado pulls the camera back.
type CameraSpring ¶ added in v0.1.8
type CameraSpring = playerspb.CameraSpring
CameraSpring pulls a param toward a value.
type CommandEvent ¶
type CommandEvent = wasmpb.CommandEvent
CommandEvent carries one command line from a player: a chat line that starts with a slash (or ".", "+" or "-"), without that prefix, or a console command the server received.
type CommandResult ¶
type CommandResult = wasmpb.CommandResult
CommandResult answers whether the mod handled a command.
type Connection ¶
type Connection = playerspb.Connection
Connection is one occupied player slot.
func Players ¶
func Players() ([]*Connection, error)
Players lists the occupied player slots in slot order. It answers from the roster the host last reported, and asks the host until a report arrives.
type DamageEvent ¶
type DamageEvent = combatpb.DamageEvent
DamageEvent is one hit before the game applies it. Handles are zero when the game names no such entity.
type DamageResult ¶
type DamageResult = combatpb.DamageResult
DamageResult answers a DamageEvent. An empty result lets the hit through.
type DamagedEvent ¶
type DamagedEvent = combatpb.DamagedEvent
DamagedEvent reports one hit the game applied.
type DriveCommand ¶ added in v0.1.8
type DriveCommand = movementpb.DriveCommand
DriveCommand is a player's controls for one tick and the ticks after it.
type EntityClassName ¶ added in v0.1.1
type EntityClassName = entitiespb.EntityClassName
EntityClassName names one entity's class two ways.
func EntityClass ¶ added in v0.1.1
func EntityClass(entity uint32) (*EntityClassName, error)
EntityClass returns a live entity's schema class, such as CCitadelPlayerPawn, whose fields ReadField reads, and its designer name.
type EntityOptions ¶ added in v0.1.1
type EntityOptions = entitiespb.EntityOptions
EntityOptions describes an entity to create.
type EntityPlacement ¶ added in v0.1.21
type EntityPlacement = entitiespb.EntityPlacement
EntityPlacement is an entity's place in the world.
func EntityPosition ¶ added in v0.1.21
func EntityPosition(entity uint32) (*EntityPlacement, error)
EntityPosition returns where a live entity stands, its absolute origin and angles, as MoveEntity places it, and its velocity. Any entity with a place in the world has one, such as one of the map's boxes.
type EquipmentTarget ¶
type EquipmentTarget = playerspb.EquipmentTarget
EquipmentTarget is one ability or item a HeroTarget gives the hero.
type FieldWrite ¶ added in v0.1.1
type FieldWrite = fieldspb.FieldWrite
FieldWrite writes one schema field of an entity the host creates.
type FogOptions ¶
type FogOptions = objectspb.FogOptions
FogOptions describes an oriented box of tinted fog.
type HeroTarget ¶
type HeroTarget = playerspb.HeroTarget
HeroTarget is the state RestoreHero gives one hero. Omitted parts keep the hero's own.
type ImpactEvent ¶
type ImpactEvent = combatpb.ImpactEvent
ImpactEvent is a watched projectile striking something.
type InputEvent ¶
type InputEvent = inputpb.InputEvent
InputEvent is one player's watched buttons that went down or up.
type KeyValue ¶ added in v0.1.1
type KeyValue = entitiespb.KeyValue
KeyValue is one spawn key value.
type LaunchEvent ¶
type LaunchEvent = combatpb.LaunchEvent
LaunchEvent is a watched projectile's first frame.
type LoadedSpot ¶
type LoadedSpot struct {
Map string
// contains filtered or unexported fields
}
LoadedSpot is a spot standing in the world, in placement order.
func LoadSpot ¶
func LoadSpot(s *Spot) *LoadedSpot
LoadSpot places every object of s and returns it standing. Objects the game cannot place are skipped with a log line; the rest load.
func (*LoadedSpot) At ¶
func (l *LoadedSpot) At(entity uint32) *Placed
At returns the placed object whose entity a trace hit, or nil.
func (*LoadedSpot) Bounce ¶
func (l *LoadedSpot) Bounce(movement []*MovementSample)
Bounce launches each sampled hero who stands on a bouncing object. A mode calls it with each frame's movement samples, for the heroes it watches.
func (*LoadedSpot) Objects ¶
func (l *LoadedSpot) Objects() []*Placed
Objects returns the placed objects in placement order.
func (*LoadedSpot) Place ¶
func (l *LoadedSpot) Place(object *SpotObject) (*Placed, error)
Place spawns object as a solid model and adds it to the spot. A model the game cannot place logs why and returns the error.
func (*LoadedSpot) Remove ¶
func (l *LoadedSpot) Remove(placed *Placed)
Remove takes a placed object out of the world and the spot.
type ModelOptions ¶
type ModelOptions = objectspb.ModelOptions
ModelOptions describes a model placed in the world.
type MovementAction ¶
type MovementAction = movementpb.MovementAction
MovementAction is a movement fact the game announced for a hero.
type MovementCommand ¶ added in v0.1.1
type MovementCommand = movementpb.MovementCommand
MovementCommand is the movement a player commanded over one tick. The server runs a player's commands as they arrive, so a tick may run several or none: every press among them is kept once, and a tick that ran none holds the last buttons without pressing them again.
type MovementSample ¶
type MovementSample = movementpb.MovementSample
MovementSample is one watched hero's movement on one tick, as the game keeps it. A hero whose position, velocity or ground the game does not provide has no sample; another field the game did not provide is absent or zero.
type Npc ¶
type Npc struct {
// Entity is the unit's entity handle, as damage events report it.
Entity uint32
}
Npc is one unit the mod spawned.
func SpawnNpc ¶
func SpawnNpc(options *NpcOptions) (Npc, error)
SpawnNpc adds a unit that is not a player, such as a trooper, as CreateEntity does, then sets its health and lane. It thinks from the next frame. The world removes it when the world ends; stopping the mod removes it too.
func (Npc) Move ¶
Move places the unit and sets its velocity, which drives its walk animation. It reports false once the unit is gone.
type NpcOptions ¶
type NpcOptions = npcspb.NpcOptions
NpcOptions describes a unit that is not a player, such as a trooper.
type NpcsRestoredEvent ¶
type NpcsRestoredEvent = npcspb.NpcsRestoredEvent
NpcsRestoredEvent reports how a RestoreNpcs ended.
type ParticleAnchor ¶ added in v0.1.8
type ParticleAnchor = objectspb.ParticleAnchor
ParticleAnchor ties one control point of a particle effect to an entity.
type ParticleOptions ¶
type ParticleOptions = objectspb.ParticleOptions
ParticleOptions describes a particle effect.
type ParticlePoint ¶
type ParticlePoint = objectspb.ParticlePoint
ParticlePoint places one control point of a particle effect.
type Pickup ¶
type Pickup struct {
// Entity is the pickup's entity handle.
Entity uint32
}
Pickup is one pickup the mod placed.
func CreatePickup ¶
func CreatePickup(kind PickupKind, position *Vector) (Pickup, error)
CreatePickup places an urn, which a hero carries once collected, or a movement buff. Stopping the mod removes it.
type PickupKind ¶
type PickupKind = entitiespb.PickupKind
PickupKind is a kind of item players collect by walking over it.
type Placed ¶
type Placed struct {
Object *SpotObject
World WorldObject
// Entity is the model's entity handle, as traces report it.
Entity uint32
}
Placed is one spot object standing in the world.
type Player ¶
type Player struct {
// Slot identifies the player on the server.
Slot int32
}
Player addresses one connected player by their server slot.
func AddBot ¶
func AddBot(options *BotOptions) (Player, error)
AddBot adds a bot player and returns it. The bot leaves when the world ends or the mod stops.
func (Player) Abilities ¶
Abilities lists the abilities of the player's hero in the hero's order, or none without a live hero.
func (Player) AddMetric ¶
AddMetric adds to the player's total of a metric the manifest declares. The host keeps each player's totals in memory and hands them on once, when the player leaves or the mod stops; a bot keeps none.
func (Player) AdjustSouls ¶
AdjustSouls gives the player delta souls, or takes them when delta is negative. A spend larger than the player's souls fails and spends nothing. Silent skips the pickup's sound and number.
func (Player) BlockInput ¶
BlockInput withholds buttons from the player's hero until called again, on top of the block on everyone. Zero releases the player.
func (Player) Buttons ¶
Buttons returns the buttons a player holds, as Buttons bits, while the player is alive or dead.
func (Player) CenterText ¶
CenterText shows text in the middle of the player's screen until it is replaced. Empty text clears it.
func (Player) ChangeTeam ¶ added in v0.1.39
ChangeTeam moves the player's hero, living or dead, to team 2 or 3 where it stands, for a human or a bot alike. The hero keeps its hero, abilities, items and health, and the player keeps their connection; a dead hero respawns on its new team, on its timer or through Respawn. A living hero moved inside the other team's base dies to the base's defense. A player without a hero joins a team through SelectHero instead.
func (Player) ClearCamera ¶ added in v0.1.8
ClearCamera removes a context's camera operations from the player's camera, or every operation, and the camera returns to its usual place.
func (Player) ClearItems ¶
ClearItems removes every item the player's hero owns.
func (Player) ClearScreenEffect ¶
func (p Player) ClearScreenEffect(effect ScreenEffect) error
ClearScreenEffect ends every running instance of effect on the player's view.
func (Player) Drive ¶ added in v0.1.8
func (p Player) Drive(command *DriveCommand) error
Drive gives a bot the controls a player has, where it looks, the movement axes and the buttons, as its input on every tick until the next Drive replaces it. The game runs that input as a player's own, so the hero accelerates, turns, jumps, dashes, slides and casts with its own movement and animation; the bot's own brain no longer moves it. Presses count once. A Drive without a command returns the bot to its brain.
func (Player) FreeCamera ¶ added in v0.1.8
FreeCamera lets the player fly their camera from a position, with the movement keys and the mouse, as the game's roaming spectator camera does. A player with a hero leaves it where it stands, as Watch does, until Unwatch returns them to it; Watch follows a hero again.
func (Player) Freeze ¶
Freeze holds the player's hero in place, without input or damage, until it is released. Stopping the mod releases it.
func (Player) GiveItem ¶
GiveItem gives the hero an item, enabled and free. A hero that owns it keeps its one copy.
func (Player) GiveModifier ¶
GiveModifier gives the hero an ability's modifier, named "<ability>/<modifier>", for seconds, as if the hero's own ability applied it; a hero without that ability applies it with its first ability. The game may end it sooner, as invisibility ends on a shot.
func (Player) HoldModifier ¶
HoldModifier keeps an ability's modifier, named "<ability>/<modifier>", on the hero with no expiry, giving it back whenever the game removes it or the hero returns. The hero must own the ability or item. Every hero that gains the modifier from the same ability keeps it until the hold ends. Releasing leaves the hero's current modifier until it dies.
func (Player) Move ¶ added in v0.1.1
Move carries the player's hero to a position as continuous motion, as a recording plays back. Unlike Teleport it keeps the hero's animated model drawn when repeated every tick, and leaves the camera alone.
func (Player) MoveCamera ¶ added in v0.1.8
func (p Player) MoveCamera(options *CameraOptions) error
MoveCamera adds one operation to the player's camera, as the game's abilities pull it back, widen its view or swing it to a point. Operations run alongside the game's own until they end or ClearCamera removes them.
func (Player) Press ¶
Press presses buttons at the player's next input, even through a block. A bot presses them as a player would.
func (Player) RefreshAbility ¶
RefreshAbility ends the cooldown of the hero's ability named ability, such as citadel_ability_melee_parry.
func (Player) ReplaceAbility ¶
ReplaceAbility puts the ability named ability, untrained, in the hero's ability slot index, as Ability.slot, removing the ability there. An ability from another hero loads its models and particles only if Precache named that hero and those resources before the world loaded; otherwise its first effect stalls the game on a blocking load and the game reports an assertion.
func (Player) ResetHero ¶ added in v0.1.3
ResetHero rebuilds the player's hero as it first spawned, without items, ability upgrades, levels or ability points, holding souls.
func (Player) RestoreHero ¶
func (p Player) RestoreHero(target *HeroTarget) error
RestoreHero gives the player's live hero target over the next few seconds: the build first, then health, stamina and pose once it settles, then charges and cooldowns. A Restored event reports when the result has held for a second, or why it could not. A new call replaces the running one.
func (Player) RestoreStamina ¶
RestoreStamina refills the player's stamina.
func (Player) ScreenEffect ¶
func (p Player) ScreenEffect(effect ScreenEffect, timing *ScreenTiming) error
ScreenEffect plays a full-screen effect on the player's view. Effects of one kind stack. The player's hero must be alive.
func (Player) SelectHero ¶
SelectHero gives the player a hero on a team, 2 or 3, and returns the hero's identifier as Pawn.hero reports it. The hero appears on a later frame.
func (Player) SetAbility ¶
func (p Player) SetAbility(options *AbilityOptions) error
SetAbility changes the upgrades, charges or timers of one of the hero's abilities. An omitted option stays as it is.
func (Player) SetSetting ¶
SetSetting changes the player's value of a setting the manifest declares. The value follows the player to later games and other mods' servers of the same mod; a bot keeps the defaults.
func (Player) SetStamina ¶ added in v0.1.3
SetStamina sets the player's stamina, as Pawn.stamina reads it. The game regenerates it as usual afterwards.
func (Player) SetVelocity ¶
SetVelocity replaces the motion of a player's hero without moving it.
func (Player) Setting ¶
Setting returns the player's value of a setting the manifest declares: the value they chose, or the setting's default. A bot has the defaults.
func (Player) SettingNumber ¶
SettingNumber returns the player's value of a number setting the manifest declares.
func (Player) SettingOn ¶
SettingOn returns the player's value of a switch setting the manifest declares.
func (Player) Sound ¶
Sound plays a game sound event, such as Damage.Send.Crit, on the player's hero.
func (Player) Spectate ¶ added in v0.1.1
Spectate moves the player to the spectators, without a hero. The player watches until a hero selection seats them again.
func (Player) StartingSouls ¶
StartingSouls sets the souls the player's hero spawns with.
func (Player) Steer ¶ added in v0.1.1
Steer replays a recorded movement command on the player's hero, usually a bot: the game runs the command's buttons and axes, so the hero crouches, slides, jumps and mantles with its own animation, and the step then ends on the recorded pose. The steering stays until the next Steer replaces it, its presses counting once; a Steer without one releases the hero.
func (Player) Teleport ¶
Teleport moves the player's hero and turns it and the camera. With a velocity it also sets the hero's motion, as a launch, and the camera follows the hero.
func (Player) Unwatch ¶ added in v0.1.3
Unwatch returns a player watching or flying the free camera from their hero back to it. Stopping the mod returns every such player.
func (Player) Watch ¶ added in v0.1.2
Watch points the player's camera at a hero, through the hero's own view or chasing it, as the game's spectator camera follows it. A spectator watches through their spectator camera, once it exists. A player with a hero watches while the hero stays where it stands, keeping its level, souls and items, until Unwatch returns them to it.
func (Player) WatchMovement ¶
WatchMovement adds a player's hero to the movement samples of each Frame event on a new tick, or removes it.
type PlayersChangedEvent ¶ added in v0.1.4
type PlayersChangedEvent = playerspb.PlayersChangedEvent
PlayersChangedEvent holds every occupied player slot, as Players lists them.
type PrecacheOptions ¶
type PrecacheOptions = wasmpb.PrecacheOptions
PrecacheOptions names what the next world loads ahead of use.
type ProjectileOptions ¶
type ProjectileOptions = combatpb.ProjectileOptions
ProjectileOptions selects the projectiles a mod watches.
type RestoredEvent ¶
type RestoredEvent = playerspb.RestoredEvent
RestoredEvent reports how a RestoreHero ended.
type RiftState ¶
RiftState is the Rift objective's timing as the game holds it. Times are game times in seconds, or zero when unset.
type Score ¶ added in v0.1.3
Score is one player's scoreboard counters since the match began, as the game counts them.
type ScreenEffect ¶
type ScreenEffect = effectspb.ScreenEffect
ScreenEffect is a stock full-screen view effect.
type ScreenTiming ¶
type ScreenTiming = effectspb.ScreenTiming
ScreenTiming is a screen effect's timing in seconds.
type Service ¶
Service answers calls to one service the mod serves: the method's name and payload in, the answer out.
type ServiceCall ¶
type ServiceCall = wasmpb.ServiceCall
ServiceCall calls one method of a service outside Modlock. A host that embeds Modlock provides services of its own, such as a game mode's match, and a mod may serve one to the host. The service and its caller agree on the payload's encoding.
type SettingChangedEvent ¶
type SettingChangedEvent = settingspb.SettingChangedEvent
SettingChangedEvent is one player's new value of one setting.
type Spot ¶
type Spot struct {
Map string
// Objects are the placed objects in placement order.
Objects []*SpotObject
}
Spot is a base map and the objects players placed on it. Nothing is compiled: loading a spot spawns each object as a solid model on the map the world already runs.
type SpotObject ¶
type SpotObject struct {
// Model is the model's path, which the mode precached.
Model string
Position *Vector
Facing *Angles
// Scale multiplies the model's size.
Scale float32
// Bounce launches a hero who stands on the object upward at this speed,
// in units per second; zero makes an ordinary object.
Bounce float32
// PlacedBy is the Steam ID of the player who placed the object, or zero.
PlacedBy uint64
}
SpotObject is one solid object placed in a spot.
type StartEvent ¶
type StartEvent = wasmpb.StartEvent
StartEvent describes the server the mod starts in.
type StartResult ¶
type StartResult = wasmpb.StartResult
StartResult declares which events the mod consumes.
type Steering ¶ added in v0.1.1
type Steering = movementpb.Steering
Steering is one recorded movement command and the pose its step ends on.
type TextOptions ¶
type TextOptions = objectspb.TextOptions
TextOptions describes text that floats in the world.
type Timer ¶ added in v0.1.4
type Timer struct {
// contains filtered or unexported fields
}
Timer is one scheduled callback. Time is the game's, so a paused game holds its timers. A tick is 1/64 second.
func Sequence ¶ added in v0.1.4
Sequence calls fn on the next frame with the number of times it has run, starting at 1. fn returns the wait before it runs again and true, or false to end the sequence.
type TimerTarget ¶
type TimerTarget = playerspb.TimerTarget
TimerTarget sets one owned ability's or item's charges and cooldowns. Times are seconds from the moment the host writes them; an omitted start and end mean no timer.
type TraceHit ¶
TraceHit is where a traced line first hit something.
func Trace ¶
func Trace(options *TraceOptions) (*TraceHit, error)
Trace returns where a line first hits something, or nothing when it hits nothing or the world's collision is not ready.
type TraceOptions ¶
type TraceOptions = combatpb.TraceOptions
TraceOptions describes a line to test against the world. Layers are bits of the game's collision layers: bit 0 is solid, 2 trigger, 4 player clip, 18 player and 19 NPC.
type UiPressEvent ¶
type UiPressEvent = uipb.UiPressEvent
UiPressEvent reports a press on a button in a player's interface.
type Vector ¶
type Vector = geometrypb.Vec3
Vector is a position or direction in the world, in game units.
type WorldObject ¶
type WorldObject struct {
// ID identifies the object among the mod's objects.
ID uint32
}
WorldObject is one object the mod placed in the world.
func CreateFog ¶
func CreateFog(options *FogOptions) (WorldObject, error)
CreateFog fills a box with tinted fog whose density fades across the box's boundary. Removing the object clears it; moving it moves the box.
func CreateModel ¶
func CreateModel(options *ModelOptions) (WorldObject, error)
CreateModel places a model in the world, solid when the options ask. The world removes it when the world ends; stopping the mod removes it too.
func CreateParticle ¶
func CreateParticle(options *ParticleOptions) (WorldObject, error)
CreateParticle starts a particle effect. Removing the object stops it and lets its end cap play out; moving it moves the effect.
func CreateText ¶
func CreateText(options *TextOptions) (WorldObject, error)
CreateText places text that floats in the world.
func (WorldObject) Entity ¶
func (w WorldObject) Entity() (uint32, error)
Entity returns the entity handle of a model or particle, as traces report it and particle anchors take it.
func (WorldObject) Move ¶
func (w WorldObject) Move(position *Vector, facing *Angles) error
Move places the object at position, turning it to facing. The physics step pulls a solid model to its new place over one tick, so a model moved each frame strikes physics props such as the Hideout ball with its speed instead of passing through them.
func (WorldObject) Remove ¶
func (w WorldObject) Remove() error
Remove takes the object out of the world.
func (WorldObject) SetHidden ¶ added in v0.1.2
func (w WorldObject) SetHidden(player Player, hidden bool) error
SetHidden hides the object from one player or shows it again. Other players still see it. A player who leaves sees every object when they return.
func (WorldObject) SetText ¶
func (w WorldObject) SetText(text string) error
SetText replaces a text object's words.
func (WorldObject) ShowOnlyTo ¶ added in v0.1.27
func (w WorldObject) ShowOnlyTo(players []int32) error
ShowOnlyTo sends the object only to the players with the listed server slots; every other client drops it, or never receives it when the call follows its creation in the same frame. With no players no client receives it. The list replaces any earlier one and follows the object when its entity changes. A player who leaves is taken off every list, so whoever joins in their slot does not receive the object. A removed object reaches no client while the engine retires its entity.
func (WorldObject) ShowToAll ¶ added in v0.1.27
func (w WorldObject) ShowToAll() error
ShowToAll sends the object to every player again, undoing ShowObjectOnlyTo.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package console sets the server's console variables and runs its console commands, through values modlock-entitygen generates from the game's console:
|
Package console sets the server's console variables and runs its console commands, through values modlock-entitygen generates from the game's console: |
|
Package entity reads and writes the fields of live entities, sends them inputs and creates them, through typed classes generated from the game's schema and entity dump by modlock-entitygen.
|
Package entity reads and writes the fields of live entities, sends them inputs and creates them, through typed classes generated from the game's schema and entity dump by modlock-entitygen. |