Class: CGameGraph
Game graph access binding.
Source
C++ class CGameGraph
Custom Constructor
CGameGraph
Remarks
Represents the global AI game graph. Validate ids before resolving vertices, and restore accessibility changes when they are only needed temporarily.
Constructors
Constructor
new CGameGraph(): CGameGraph;Returns
CGameGraph
Methods
accessible()
Call Signature
accessible(vertexId: number): boolean;Check whether a game-graph vertex can be used for AI travel.
Parameters
| Parameter | Type | Description |
|---|---|---|
vertexId | number | Game-graph vertex id. |
Returns
boolean
Whether the vertex is currently accessible.
Remarks
This is pathing accessibility, not whether the vertex exists.
Call Signature
accessible(vertexId: number, value: boolean): void;Mark a game-graph vertex as accessible or blocked.
Parameters
| Parameter | Type | Description |
|---|---|---|
vertexId | number | Game-graph vertex id. |
value | boolean | New accessibility state. |
Returns
void
Remarks
Blocking vertices affects AI travel through the game graph. Prefer narrow, reversible changes.
levels()
levels(): LuaIterable<cse_abstract>;Iterate over game levels registered in all.spawn.
Returns
LuaIterable<cse_abstract>
Level object on every iteration.
Remarks
Iterates graph-level descriptors, not currently loaded level objects.
valid_vertex_id()
valid_vertex_id(vertexId: number): boolean;Check whether a game-graph vertex id exists.
Parameters
| Parameter | Type | Description |
|---|---|---|
vertexId | number | Game-graph vertex id. |
Returns
boolean
Whether the id can be used with graph methods.
vertex()
vertex(vertexId: number): GameGraph__CVertex;Get a game-graph vertex by id.
Parameters
| Parameter | Type | Description |
|---|---|---|
vertexId | number | Game-graph vertex id. |
Returns
Graph vertex descriptor.
Remarks
Call CGameGraph.valid_vertex_id first. Native code expects a valid id and can fail hard on invalid graph references.
vertex_id()
vertex_id(vertex: GameGraph__CVertex): number;Resolve a graph vertex back to its id.
Parameters
| Parameter | Type | Description |
|---|---|---|
vertex | GameGraph__CVertex | Vertex returned by CGameGraph.vertex. |
Returns
number
Game-graph vertex id.
Remarks
Pass only vertices returned by this graph instance.