Markable Proxy
Based on game build 714014 | Last updated: 2026-03-03
Overview
Markable_proxy acts as a forwarding wrapper for an entity's markable component. It delegates marking operations (Mark, HasMarked, SetMarkable) to the target entity's markable component (stored in self.proxy). It also ensures the "markable_proxy" tag is added or removed from its owner entity (self.inst) based on whether the target entity is currently set as markable. This is typically used in scenarios where one entity needs to control or reflect the markability state of another.
Usage example
local inst = CreateEntity()
inst:AddComponent("markable_proxy")
-- Assume target has a markable component
inst.components.markable_proxy.proxy = target
inst.components.markable_proxy:SetMarkable(true)
local success = inst.components.markable_proxy:Mark(doer)
Dependencies & tags
Components used: markable (accessed via self.proxy.components.markable)
Tags: Adds markable_proxy (via inst:AddTag("markable_proxy")) when canbemarked is true; removes it otherwise.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | nil | The entity that owns this component. |
proxy | Entity? | nil | The target entity whose markable component is proxied. |
canbemarked | boolean | nil | Reflects the markability state of the proxy's markable component; triggers tag updates when changed. |
Main functions
Mark(doer)
- Description: Attempts to mark the target entity (via its
markablecomponent). Typically called by logic that wants to apply a mark to the proxied entity. - Parameters:
doer(Entity) — the entity performing the marking action. - Returns:
trueif the mark was successful on the target,falseotherwise. - Error states: Returns
falseifproxyisnilor the proxy lacks amarkablecomponent.
SetMarkable(markable)
- Description: Configures whether the target entity is currently markable, and synchronizes the proxy owner's tag.
- Parameters:
markable(boolean) — whether the target entity should be considered markable. - Returns: Nothing.
- Error states: No effect if
proxyisnilor the proxy lacks amarkablecomponent.
HasMarked(doer)
- Description: Checks whether the given entity has already marked the target entity.
- Parameters:
doer(Entity) — the entity to check for an existing mark. - Returns:
trueif thedoerhas a mark on the target entity,nilotherwise (including when proxy is missing). - Error states: Returns
nilifproxyisnilor the proxy lacks amarkablecomponent.
Events & listeners
- Listens to: None.
- Pushes: None.
Constructor
Class(function(self, inst) ... end)
- Description: Initializes the proxy component on an entity.
- Parameters:
inst(Entity) — the entity to attach this component to. - Sets:
self.instto the owning entity;self.proxytonil;self.canbemarkedtonil. - Note: The
canbemarkedproperty uses theonmarkablecallback as its setter, automatically managing the"markable_proxy"tag.