Blippable
Module: blippable.lua
Overview
Blippable adds radar-objective and off-screen-world-marker support to anything built on Inheritable — the base every other blip-related module (VehicleBlippable, EnemyBlippable, OrientedBlippable) builds on in turn. It provides SetBlipped/ClearBlipped to toggle visibility, with the actual radar/marker plumbing in AddObjective/RemoveObjective.
Inheritance
- Inherits from:
Inheritable - Imports:
MrxUtil
Instance pattern
Per-instance object module (keyed by uGuid, via Inheritable). A subclass typically sets some subset of these fields on itself before calling self:SetBlipped():
sName— the objective’s name (defaults totostring(uGuid), set byInheritable.Create).tColor({r, g, b}) — default radar dot color; falls back to{255, 51, 51}(red) if unset.tFlash— an alternate color used instead oftColorwhenAddObjective(true)is called.nWidth/nHeight, or justnSize(used for both if the specific ones aren’t set) — radar dot dimensions.sTexture— radar icon texture name.bSticky— whether the blip stays on-screen regardless of distance/rotation.bRotate/bOriented— whether the blip rotates to match the object’s facing.nSortOrder— draw/priority order among overlapping blips.bNetSync— whether blip add/remove is replicated to other players (seeAddObjective/RemoveObjectivebelow — this gates realNet.SendEvent_*calls, not just a cosmetic flag).tMarker(table, optional) — if present, also adds an off-screen world marker viaMarker.AddBlip, with its own sub-fields (each individually defaulted if omitted):sTexture(default"HUD_objective_destroy"),nSize(default32),tColor(defaults to the secondary-objective RGB fromMrxUtil.GetSecondaryObjectiveRgb()at alpha255),tFlash,nVerticalOffset(default0),nNearDist(default140),nFarDist(default150),nClampDist(default-1),sGroup(default""),bJust2DCheck(defaultfalse).bActive— set bySetBlipped/cleared byClearBlipped; whether the blip is currently shown.
Module-level (shared across all instances, not per-object): tHiddenGuids — a list of GUIDs that AddObjective silently refuses to blip at all (checked at the top of the function), populated by HideMarker.
Functions
OnActivate(uGuid, uRuntimeOwner, iArg) / Awake(uGuid, iArg)
Standard Inheritable-pattern activation — see Inheritable for the general mechanism.
SetBlipped(self)
Calls self:AddObjective() and sets self.bActive = true. The normal way to turn a blip on.
ClearBlipped(self)
Calls self:RemoveObjective() and clears self.bActive. The normal way to turn a blip off.
AddObjective(self, bFlash)
The actual radar/marker registration. Skips entirely (returns with no effect) if self.uGuid is in the module-level tHiddenGuids list. Builds a Hud.Radar:AddObjective({...}) call from the instance’s fields (see Instance pattern above for what each one does), using tFlash instead of tColor if bFlash is true. If tMarker is set, also removes any previous marker and adds a new one via Marker.AddBlip, and — only if Net.IsServer() and self.bNetSync — sends Net.SendEvent_AddMarkerObjective to replicate the marker to other players.
RemoveObjective(self)
The inverse of AddObjective — removes the radar objective (Hud.Radar:RemoveObjective) and, if a uMarkerGuid is set, the world marker (Marker.Remove). Note the asymmetry with AddObjective: the marker-removal net event here is gated on Net.IsServer() and not self.bDontNetSync, whereas AddObjective gates on Net.IsServer() and self.bNetSync. If an instance sets bNetSync but never sets bDontNetSync, the add path is suppressed (server-only when bNetSync is true) but the remove path fires — a real inconsistency in the decompiled source, not a documentation error.
HideMarker(uGuid)
A plain function, not an event listener (see the Events correction below) — call this directly to force-hide a specific object’s blip regardless of its own bActive state. If the object’s instance is currently loaded (found in tInstance), removes its objective immediately; either way, adds uGuid to tHiddenGuids so any future AddObjective call for it is silently skipped.
Delete(self)
Clears any active blip (self:ClearBlipped()) before deferring to Inheritable.Delete(self) — overriding the base Delete specifically to avoid leaving a stale radar objective behind when the instance goes away.
Events
- Listens for
Event.ObjectHibernationinsideOnActivate(via the standardInheritablepattern). HideMarkeris not an event — it’s a directly-callable function,Blippable.HideMarker(uGuid)(import the module first). An earlier version of this page incorrectly listed it as a listened-for custom event.
Notes for modders
- Default blip look (what you get if you set nothing): radar dot color
{255, 51, 51}(red); marker texture"HUD_objective_destroy"at size32; marker near/far display distances140/150. Override by settingtColor/sTexture/nSizeon the instance (radar) or the matching keys insidetMarker(world marker). - The common pattern: set
tColor/sTexture/nSize(and optionallytMarker) on your instance, then callself:SetBlipped()to turn the blip on andself:ClearBlipped()to turn it off — you rarely need to callAddObjective/RemoveObjectivedirectly. bNetSyncgenuinely gates network replication, not just display — if you want a blip visible to other players in co-op, setbNetSync = trueon the instance; otherwise it’s local-only.HideMarker(uGuid)is a permanent-until-you-remove-it suppression — it adds to a list nothing in this module ever clears. If you use it, you’re responsible for removing the entry fromtHiddenGuidsyourself if you want that object blippable again later.- See
VehicleBlippableandOrientedBlippablefor the actual subclasses most vehicle/world-object modules use directly, rather than inheriting fromBlippableitself.