Settings
Every tunable is an attribute on the Ocean ModuleScript. The server writes them, so they replicate
to every client; the Studio plugin's panel is generated from Settings.List. Change them from a
server script with Settings.Set or simply Ocean:SetAttribute(name, value).
Settings marked Weather = true are the ones a weather can override (see Ocean:CreateWeather).
Types
Entry
interface Entry {Name: string--
the attribute name
Section: string--
the panel section it belongs to
Min: number?--
numbers only
Max: number?--
numbers only
Step: number?--
slider step
Weather: boolean?--
a weather may override it
Rebuild: boolean?--
changing it rebuilds the surface mesh
Options: {string}?--
strings with a fixed set of choices
Snaps: {number}?--
numbers whose slider lands on these values only
Hint: string?--
what the setting does, as shown in the plugin
}Properties
List
Every setting, in panel order.
Spec
The same entries keyed by name.
Defaults
Settings.Defaults: {[string]: any}Default value per setting name.
Functions
GetHost
The Instance whose attributes hold the settings (the Ocean ModuleScript).
LocalOverride
This item only works when running on the client. ClientSettings.LocalOverride(name: string) → anyA client-local override set with Settings.SetLocalOverride, or nil.
SetLocalOverride
This item only works when running on the client. ClientSettings.SetLocalOverride(name: string,value: any) → ()
Makes this client use value instead of the replicated setting, for everything that reads
Settings.Get. Never replicated and never written to the module. The Zones addon uses it to give a
player inside a zone that zone's look everywhere they look. Pass nil to clear.
Get
Settings.Get(name: string) → anyThe effective value of a setting on this side: the local override if any, else the attribute, else the default.
Set
This item only works when running on the server. ServerSettings.Set(name: string,value: any) → anyValidates and clamps the value against the spec and writes the attribute. Returns the value stored, or nil if it was rejected (unknown name, wrong type, or a string outside the entry's Options).
OnChanged
Settings.OnChanged(fn: (name: string) → ()) → Connection--
call :Disconnect() to stop
Calls fn(name) whenever a setting changes on this side, whether by attribute or local override.
PublishDefaults
This item only works when running on the server. ServerSettings.PublishDefaults() → ()Writes every default that is not yet an attribute, so all settings show in Properties and replicate. Ocean.Init does this.
Reset
This item only works when running on the server. ServerSettings.Reset() → ()Sets every setting back to its default.