Skip to content

MapInfo

MapInfo provides parameters of the current map and finds the gameplay zones at a world position.

Properties are read from the loaded map definition. GetZones(position) checks the provided world point against game-zone volumes and returns the names of every matching zone. It does not move an object into a zone or subscribe to enter/exit events.

To track an agent, repeat the query with its current Movement.Position in an appropriate loop.

local zones = MapInfo:GetZones(Cameras.Main.Position)
for index = 1, zones.Length do
print(zones[index])
end

Cameras.Main is client-only. In server.lua, pass a position obtained from a server-side API.

Property Type Access Description
BasementBottomY number get Lower Y boundary of the basement level.
BasementTopY number get Upper Y boundary of the basement level.
MapCameraHeight number get Minimap camera height.
MapCenter Vector3 get Map center in world space.
MapName string get Current map name.
MapSize number get Map size used by its representation.

All properties are getter-only.

Testing on Castle produced:

Property Value
BasementBottomY -5
BasementTopY 0
MapCameraHeight 200
MapCenter (15, 0, 20)
MapName Castle
MapSize 130

These values describe only the tested map and are not global constants.

MapInfo:GetZones(position: Vector3): Array<string>

Returns an Array<string> containing the names of every zone that includes the given world position.

A position can belong to multiple zones at once:

local zones = MapInfo:GetZones(Cameras.Main.Position)
-- Example: BuyZoneCT, CSspawn

When a position is not inside any zone, the method returns an empty array with Length == 0, not nil.

local zones = MapInfo:GetZones(Vector3.zero)
if zones.Length == 0 then
print("No zone at this position")
end

MapInfo and GetZones() work on both the client and the Reflex server. Results for the same map and position matched in both contexts.