Oar
Overview
The Oar component manages the interaction between a player (typically rowing) and a boat’s physics system. It applies rowing forces to move the boat and handles failure states, including applying wetness damage to nearby entities when a row action fails.
Dependencies & Tags
- Requires entity
instto haveTransformandplayercontrollercomponents (used viadoer). - Depends on
doerhaving optionalexpertsailorandmoisturecomponents. - Relies on
platformentity havingboatphysicscomponent andmoisturefunctionality. - No tags are added or removed by this component.
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
fail_idx | number | 0 | Index used to cycle through failure message variants (modulus fail_string_count). |
fail_string_count | number | 3 | Number of distinct failure message variants (used for cycling fail_idx). |
fail_wetness | number | 9 | Base amount of wetness added to nearby entities on row failure. |
max_velocity | number | TUNING.BOAT.MAX_FORCE_VELOCITY | Maximum velocity cap for rowing force application. |
force | number | 0.4 | Base rowing force applied to the boat. |
Main Functions
Row(doer, pos)
- Description: Applies rowing force to the current boat platform based on the player's position and orientation, respecting expert sailor bonuses. Triggers
"rowing"and"rowed"events. - Parameters:
doer(Entity): The entity (typically a player) performing the rowing action.pos(Vector3): The position used to compute the intended rowing direction unless the player is locally controlled — in that case, the direction is inverted (from boat to player).
RowFail(doer)
- Description: Handles a failed rowing action by increasing wetness on nearby wettable entities (e.g., via
moisturecomponent) and returning a randomized failure string identifier. Updatesfail_idxto cycle messages. - Parameters:
doer(Entity): The entity attempting to row (used for position and moisture effect calculation).
- Returns: A string
"BAD_TIMING" + N, whereNis the currentfail_idx(0–2).
Events & Listeners
- Events pushed:
"rowing"— pushed bydoer(the rowing player) during a successful row."rowed"— pushed byplatform(the boat), withdoerpassed as data.
- No event listeners are registered in this component.