Wait N frames
wait_framesWaits until the game’s main loop advances n frames so console commands, spawns, or SetPos changes take effect; returns frames and elapsed time, or times out if too few frames render.
Instructions
Waits until the game's main loop has run n more frames (counted by gmod-mcp every frame, map or not), e.g. to let a console command, a spawn or a SetPos take effect. Result: {frames, elapsed_s}. Error timeout if the game renders fewer frames in timeout_s (frozen, minimized with a low fps_max_nofocus). A light test client runs at 20 fps: 20 frames = 1 s.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"n": "<n>"
},
"name": "wait_frames"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| n | Yes | Number of frames to wait. | |
| instance | No | Optional. Instance identifier (see instances_list). If present and different from the local instance, the call is relayed by the coordinator to that instance. | |
| timeout_s | No | Max wait in seconds (default 30). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| next | No | ||
| note | No | ||
| frames | Yes | ||
| warning | No | ||
| elapsed_s | Yes | ||
| next_call | No | ||
| answered_by | No | ||
| truncated_note | No | ||
| version_warning | No |