Skip to content

docs: add camera, audio and voice chat guides - #12

Merged
Kheartz merged 1 commit into
hogwarts-mp:mainfrom
Kheartz:camera-and-sound
Oct 14, 2026
Merged

Kheartz merged 1 commit into
hogwarts-mp:mainfrom
Kheartz:camera-and-sound

Conversation

@Kheartz

@Kheartz Kheartz commented Oct 14, 2026

Copy link
Copy Markdown
Member

First of three stacked PRs (camera and sound, then mounts and races, then appearance). This one is based on main.

Adds a Camera and sound section (sidebar orders 70–79), written for 1.8.2 and checked against the v1.8.2 Mod source and its Framework pin:

  • Camera: capture/activate/restore, moves, paths and orbits, lens, fades, shakes.
    • The custom camera is shared by every resource on a client and isn't handed back when a resource stops, so the guide restores it in resourceStop and only when Camera.active.
    • Look-at stays armed after an orbit, stop and restore, so the samples call clearLookAt() before each new shot.
    • An orbit jumps onto its circle from wherever the camera is, so the sample activates on the circle first.
  • Audio: the server's four ways to play a sound and who hears each, held sounds and stop events, client sounds, soundbanks and music.
    • Server sounds ignore virtual worlds and reach only players in range when they start. Music, states and banks reach only players connected at the time.
    • The guide shows filtering by world with client playback.
  • Voice chat: who hears whom (range, virtual worlds, mutes, streaming distance, six talkers at most), tiers and ranges, mutes and deafens, talking events, and each player's client settings.
    • Ranges are centimetres: 800 / 2500 / 6000 for whisper, normal and shout.
    • Voice.setRange(0) sets 25 cm rather than the default, so the guide says to pass 2500 instead.

Also in this PR:

  • The overview's client camera example orbited the camera's own position and restored in the same tick. It now orbits the player and restores on a second key press.
  • check_samples.mjs lets a JavaScript sample pass an untyped event argument (unknown) on to a function, as it already lets it read members of one. In 1.8.2, events outside the small typed map, such as playerDownedEnd, hand JS samples unknown arguments.

Checks: check_samples (101 samples, 1.8.2 contract), docs.mjs build, check_links and git diff --check all pass.

New Camera and sound section (orders 70-79), written against 1.8.2: the client's custom camera, server and client sounds, and proximity voice chat with its ranges, tiers and mutes. The overview's camera example now orbits the player and restores on a second key press instead of restoring in the same tick. The sample checker also lets JavaScript pass an untyped event argument on, as it already lets it read one.
@Kheartz
Kheartz merged commit d41f965 into hogwarts-mp:main Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant