Skip to main content

Platformhopdelay

Overview

This component provides a delay mechanism for platform-hopping behavior, storing the number of ticks that must elapse before an entity (typically a player or creature) can hop to another platform again. It is used to enforce a cooldown period between successive platform hops, likely to prevent spamming of the action or to ensure realistic movement timing.

Dependencies & Tags

The component relies on the FRAMES global constant (used to convert time-in-seconds to ticks). It does not add or remove any entity tags, nor does it require other components.

Properties

PropertyTypeDefault ValueDescription
instEntityReference to the owner entity, set during construction.
delayticksnumber (integer)8Number of ticks to wait before allowing another platform hop.

Main Functions

SetDelay(time)

  • Description: Sets the hop delay based on a time duration in seconds. Internally converts seconds to ticks by dividing by FRAMES and rounding up.
  • Parameters:
    time (number): Duration in seconds for the delay.

SetDelayTicks(ticks)

  • Description: Directly sets the hop delay in ticks.
  • Parameters:
    ticks (number): Number of ticks to wait.

GetDelayTicks()

  • Description: Returns the current hop delay in ticks.
  • Parameters: None.

Events & Listeners

None.