4.8 KiB
Client Actor Usage Guide
The client actor addon owns the player interaction menu and client-side actor repository. It is the main launcher for nearby player actions and other Forge client UIs.
Open the Actor Menu
call forge_client_actor_fnc_openUI;
The actor menu opens RscActorMenu, loads ui/_site/index.html, and routes
browser alerts through forge_client_actor_fnc_handleUIEvents.
Repository
forge_client_actor_fnc_initRepository creates GVAR(ActorRepository).
The repository:
- requests actor initialization from the server
- saves actor state through the server actor addon
- caches client-visible actor fields
- applies position, direction, stance, rank, and loadout on JIP sync when the relevant settings allow it
- provides nearby interaction actions to the browser UI
Initialize actor state through the repository:
GVAR(ActorRepository) call ["init", []];
Save actor state through the server:
GVAR(ActorRepository) call ["save", [true]];
Nearby Actions
The menu asks for nearby actions with:
actor::get::actions
The repository scans objects within 5 meters and returns actions based on mission object variables:
<th>
Action
</th>
<td>
store
</td>
<td>
ATM
</td>
<td>
bank
</td>
<td>
garage
</td>
<td>
garage subtype
</td>
<td>
virtual arsenal action when VA is enabled
</td>
<td>
device action placeholder
</td>
<td>
player interaction placeholder
</td>
| Variable |
|---|
storeType
|
isAtm
|
isBank
|
isGarage
|
garageType
|
isLocker
|
deviceType
|
| nearby player unit |
The response is pushed into the browser with updateAvailableActions(...).
Browser Events
<th>
Client behavior
</th>
<td>
Refresh nearby actions.
</td>
<td>
Close actor menu.
</td>
<td>
Open bank UI in ATM mode.
</td>
<td>
Open bank UI in bank mode.
</td>
<td>
Open CAD UI.
</td>
<td>
Open garage UI.
</td>
<td>
Open virtual garage.
</td>
<td>
Open organization UI.
</td>
<td>
Open ACE arsenal on <code>
FORGE_Locker_Box
</code>
.
</td>
<td>
Open phone UI.
</td>
<td>
Open store UI.
</td>
| Event |
|---|
actor::get::actions
|
actor::close::menu
|
actor::open::atm
|
actor::open::bank
|
actor::open::cad
|
actor::open::garage
|
actor::open::vgarage
|
actor::open::org
|
actor::open::vlocker
|
actor::open::phone
|
actor::open::store
|
Device and player interaction events currently display placeholder feedback.
Authoritative State
Actor persistence is server-owned. The client repository requests and displays actor data, but actor creation, durable updates, and hot-state behavior are handled by the server actor addon and extension.