Counter LPK_Counter.cs

This component can be added to any object to have it track a value relevant to the game. That value might be a health, currency, score, etc.

Suggested use:

Use with a Modify Counter on Event component to change the value of the counter on the given event. The counter can dispatch events once it reaches a certain value or threshold. Use a Text Display, Bar Display, Radial Display, or an Object Display component to easily display the value of the counter.

Examples found in: Project 1 - Score, Project 3 - Health & Lives

Components
Property Type Description Default Value
Component Properties
Value Integer What value to start the counter at. 0
Min Value Integer Minimum value permitted for the counter. -10
Max Value Integer Maximum value permitted for the counter. 10
Update Display On Start Boolean Update display objects when this component is activated. False
Threshold Mode LPK Logic What relation between the counter value and threshold value should trigger an event. NONE
Threshold Value Integer What value should be used as a threshold for sending an event. 0
Event Sending Info
Options
Counter Threshold Event Event Conditions Event sent when the counter's value is past a certain threshold. N/A
Counter Increased Event Event Conditions Event sent when the counter's value is increased. N/A
Counter Decreased Event Event Conditions Event sent when the counter's value is decreased. N/A
Counter Hit Max Event Event Conditions Event sent when the counter's value hits is maximum value. N/A
Counter Hit Min Event Event Conditions Event sent when the counter's value hits is minimum value. N/A
Values
Event LPK Event Object Event to dispatch when conditions are met:
  • Conditions are listed above in Options.
None
Event Sending Mode LPK Event Sending Mode Who receives the event sent info when input is given from the input device. OWNER = only send to components on the same game object. ALL = send to all game objects. TAGS = send to specified tags. TAGS
Event Sending Mode - TAGS
Tags Array of Tags Which tags will receive this event. 0
Displays
Display Components Array of Objects Which display components to connect to this counter and display it's values. 0
Display Components N Object A display component to display this counter's value. None
Debug Properties
Print Debug Info Boolean Toggle console debug messages. False
Label String Notes for the user about this component. This does nothing to the game or build. None