Groundcreep
Based on game build 714014 | Last updated: 2026-03-03
Overview
Groundcreep is a minimal component designed to support saving and loading of a ground creep state attached to an entity. It does not manage the ground creep logic itself but delegates serialization responsibilities to an attached GroundCreep object on the entity (i.e., inst.GroundCreep). This ensures clean separation between game logic and persistence concerns, avoiding ad-hoc serialization code elsewhere in the codebase. It also listens for the playeractivated event to trigger fast-forwarding of the creep state when a player loads into the world.
Usage example
local inst = CreateEntity()
-- An entity with a pre-initialized inst.GroundCreep object is required
inst:AddComponent("groundcreep")
-- On save/load, the component automatically calls inst.GroundCreep:GetAsString() and SetFromString()
Dependencies & tags
Components used: None identified
Tags: Checks playeractivated event; relies on inst.GroundCreep object being present.
Properties
No public properties
Main functions
OnSave()
- Description: Serializes the attached ground creep object by calling its
GetAsString()method. Only active on the master simulation. - Parameters: None.
- Returns: String — the serialized representation of the ground creep state.
- Error states: Returns
nilifinst.GroundCreepis missing orGetAsString()fails.
OnLoad(data)
- Description: Deserializes the ground creep state by passing
datato the attached object'sSetFromString()method. Only active on the master simulation. - Parameters:
data(string) — the serialized ground creep state previously returned byOnSave(). - Returns: Nothing.
- Error states: May silently fail or cause runtime errors if
inst.GroundCreepis missing orSetFromString()encounters invalid data.
Events & listeners
- Listens to:
playeractivated— triggersFastForward()on the attached ground creep object viainst.GroundCreep:FastForward(). - Pushes: None.