Moisture Replica
Overview
This component acts as a network-replicated wrapper for an entity's "wet" state, ensuring consistency between the server and all clients by using a net_bool backing field. It does not store game logic but serves as a lightweight container for synchronizing the boolean iswet value.
Dependencies & Tags
- Uses the
net_boolnetwork primitive vianet_bool(inst.GUID, "moisture._iswet") - Requires the entity (
inst) to support GUID-based network replication - No additional components are required or added by this class
- No tags are set or removed
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
inst | Entity | (passed to constructor) | Reference to the entity the component belongs to |
_iswet | net_bool | nil (initialized in _ctor) | Networked boolean representing whether the entity is wet |
Main Functions
SetIsWet(iswet)
- Description: Sets the networked "wet" state of the entity. This change is automatically replicated to all clients.
- Parameters:
iswet(boolean) — The new wet state (truefor wet,falsefor dry).
IsWet()
- Description: Returns the current local value of the "wet" state, fetched from the networked boolean.
- Parameters: None
- Returns:
boolean—trueif the entity is wet,falseotherwise.
Events & Listeners
None identified.