HammeriteAudioSoundTypes
Audio. Inherits Resource
The game's table of HammeriteAudioSoundTypes, assigned to HammeriteAudio.sound_types.
Hammerite has no opinion about what kinds of sound a game has - "footstep" and "glass_break" are the game's vocabulary, not the engine's - so the table is authored as a resource and handed over at startup. What the addon provides is the machinery that routes them. A type an emitter names but the table does not define still propagates and is still heard; it simply falls back to default_loudness_db and default_max_range. A missing entry should be a thing to tune, not a thing that silently does nothing.
Properties
| Type | Name | Default |
|---|---|---|
String | note | "" |
HammeriteAudioSoundType[] | types | [] |
float | default_loudness_db | 60.0 |
float | default_max_range | 1024.0 |
Methods
| Returns | Method |
|---|---|
HammeriteAudioSoundType | get_type(type_name: StringName) |
float | loudness_db(type_name: StringName) |
float | max_range(type_name: StringName) |
void | rebuild_index() |
Property descriptions
note
var note: String = ""
Why it is the way it is, for whoever tunes it. Never seen by a player.
types
var types: HammeriteAudioSoundType[] = []
The types this game knows about. Indexed by name, and reassigning this builds the index again. After editing the array IN PLACE at runtime (types.append(...)), call rebuild_index() - nothing tells this resource that happened.
default_loudness_db
var default_loudness_db: float = 60.0
Used for a type that is not in the table.
default_max_range
var default_max_range: float = 1024.0
Carrying range, in map units of path length, for a type that is not in the table.
Method descriptions
get_type()
func get_type(type_name: StringName) -> HammeriteAudioSoundType
The entry for type_name, or null if the table does not define it.
loudness_db()
func loudness_db(type_name: StringName) -> float
Source loudness for type_name, falling back to the table default.
max_range()
func max_range(type_name: StringName) -> float
Carrying range for type_name, falling back to the table default.
rebuild_index()
func rebuild_index() -> void
Rebuild the name index. Call after editing types at runtime.