Skip to main content

Researchpointconverter

Overview

This component provides a minimal abstraction for entities that need to track activation state and optionally respond to state changes via user-defined callbacks. It stores simple state variables (val, active, level, on) and exposes TurnOn, TurnOff, and Activate methods that invoke optional callback hooks if present. According to the source comment, this component is deprecated and should not be used; prototyper.lua is recommended instead.

Dependencies & Tags

No external components are added or required by this script. No tags are applied or removed. The component simply attaches to an entity via Class(function(self, inst) ...).

Properties

PropertyTypeDefault ValueDescription
instEntitynil (passed to constructor)The entity instance the component is attached to.
valnumber0An arbitrary numeric value (unused internally).
activebooleanfalseLogical state flag (unused internally).
levelnumber1An arbitrary level value (unused internally).
onbooleanfalseTracks whether the converter is currently "on".

Main Functions

TurnOn()

  • Description: Turns the converter "on" if it is currently off, and invokes the optional onturnon callback (passed externally) with self.inst as its argument.
  • Parameters: None.

TurnOff()

  • Description: Turns the converter "off" if it is currently on, and invokes the optional onturnoff callback (passed externally) with self.inst as its argument.
  • Parameters: None.

Activate()

  • Description: Invokes the optional onactivate callback if defined. No entity reference is passed in this case.
  • Parameters: None.

Events & Listeners

No events are listened to or emitted by this component.