-
Notifications
You must be signed in to change notification settings - Fork 0
publicVariable
Multiplayer
Unary — publicVariable "<variableName>".
publicVariable <string> // quoted variable name
Broadcasts the value of a global variable to all connected clients (and the server). The variable name is passed as a string. After broadcast, the variable's current value is synchronized to all machines.
Placeholder/stub — full networking implementation is the host's responsibility.
Registered by DeclareMultiplayerCommands(). NOT called automatically — host must invoke explicitly.
Fires the host's public variable broadcast event with the variable name. The host must serialize the variable's value and transmit it over the network. Target machines update their local copy of the variable.
myVar = 42;
publicVariable "myVar"; // broadcast myVar to all clients
_missionTime = 300;
publicVariable "_missionTime";// Server sets and broadcasts
if (isServer) then {
weatherState = "clear";
publicVariable "weatherState";
};
// Clients react to change
// (host must implement variable change events)Note: The variable must already exist as a global before calling
publicVariable.
Depends on host implementation.
- publicVariableServer — send to server only
- publicVariableClient — send to specific client
- remoteExec — remote code execution
- Getting Started
- Language Guide
- Type System
- Control Flow
- Functions & Code
- Strings & Text
- Arrays & Collections
- Concurrency
- Promise System
- Thread Safety
- Host API & Embedding
- CLI Tool
- Bytecode Reference
- Multiplayer
- Syntax Sugar
- Optimization Guide
- Benchmarks
- count
- select
- pushBack
- append
- deleteAt
- deleteRange
- resize
- reverse
- sort
- find
- in
- forEach
- freeze
- thaw
- isFrozen
- currentScheduler
- clientOwner
- allSchedulers
- schedulerName
- schedulerExists
- schedulerBudget
- setSchedulerBudget
- fiberCount
- readyFiberCount
- waitingFiberCount
- schedulerLoad
- sendTo