- Created package.json for Docus with necessary scripts and dependencies. - Implemented sync-docus-docs.mjs to automate the generation of documentation files from source markdown. - Defined mappings for generated pages and virtual routes to ensure proper linking in documentation. - Added static content files for the documentation structure, including navigation and index pages.
5.6 KiB
Client Garage Usage Guide
The client garage addon provides player vehicle storage UI, vehicle store/retrieve actions, selected nearby vehicle service requests, vehicle context building, and the virtual garage view.
Open Garage UI
call forge_client_garage_fnc_openUI;
The garage UI opens RscGarage, loads ui/_site/index.html, and routes
browser events through forge_client_garage_fnc_handleUIEvents.
Open Virtual Garage
call forge_client_garage_fnc_openVG;
The virtual garage uses mission-configured FORGE_CfgGarages locations to set
the spawn/preview position, opens the BIS garage interface, and restricts the
available vehicle lists from the virtual garage repository.
Client Services
<th>
Purpose
</th>
<td>
Player garage view state.
</td>
<td>
Virtual garage unlock view state.
</td>
<td>
Vehicle names, hit points, and payload helpers.
</td>
<td>
Nearby/current vehicle context.
</td>
<td>
Browser hydrate payload construction.
</td>
<td>
Store/retrieve request handling and selected nearby vehicle refuel/repair request forwarding.
</td>
<td>
Browser ready, hydrate, and sync delivery.
</td>
| Service |
|---|
GarageRepository
|
VGRepository
|
GarageHelperService
|
GarageContextService
|
GaragePayloadService
|
GarageActionService
|
GarageUIBridge
|
Browser Events
<th>
Client behavior
</th>
<td>
Mark browser ready and send <code>
garage::hydrate
</code>
.
</td>
<td>
Send current garage payload as <code>
garage::sync
</code>
.
</td>
<td>
Forward retrieve request through the action service.
</td>
<td>
Forward store request through the action service.
</td>
<td>
Forward selected nearby vehicle refuel request to the server economy service.
</td>
<td>
Forward selected nearby vehicle repair request to the server economy service.
</td>
<td>
Dispose bridge screen state and close the display.
</td>
| Event |
|---|
garage::ready
|
garage::refresh
|
garage::vehicle::retrieve::request
|
garage::vehicle::store::request
|
garage::vehicle::refuel::request
|
garage::vehicle::repair::request
|
garage::close
|
Browser Response Events
<th>
Purpose
</th>
<td>
Initial vehicle and session payload.
</td>
<td>
Refreshed vehicle payload.
</td>
<td>
Browser notice for accepted refuel/repair requests.
</td>
<td>
Browser notice for rejected refuel/repair requests.
</td>
| Event |
|---|
garage::hydrate
|
garage::sync
|
garage::service::success
|
garage::service::failure
|
Server action responses are handled by the action service and notification flow.
Vehicle Service
The selected vehicle detail panel includes refuel and repair actions for nearby world vehicles. Stored records must be retrieved first because server economy services operate on live vehicle objects, not stored garage records.
Refuel requests use the server economy RefuelService event. Repair requests
use the server economy RepairService event. Both services are billed by the
server economy addon through organization funds.
Mission Setup
Garage interactions are normally surfaced through the actor menu when nearby objects have garage variables such as:
_object setVariable ["isGarage", true, true];
_object setVariable ["garageType", "cars", true];
Virtual garage access also requires configured garage locations in mission config so the preview/spawn position can be resolved.
Authoritative State
The client gathers vehicle context and sends store/retrieve requests. Stored vehicle state, validation, spawning, removal, and persistence are owned by the server garage addon and extension.