Home › Dev CE (experimental) › MapAreaPortal

Experimental: needs Dev CE (fork of the Community Extension, release zip and source). A GameCore that adds these Lua methods by calling engine functions directly. Not part of the upstream Community Extension, single-player testing only. Descriptions on these pages were written by an AI assistant from decompiled code and are marked inferred unless a test result confirms them.

MapAreaPortal

3 methods (Dev CE test build). this is found with the game's own IMapAreaPortal instance resolver (plain).

Method Signature Purpose (AI-written, inferred) Tested Engine function Current
AddSourceAt MapAreaPortal:AddSourceAt(iSourcePlot: integer) → boolean Adds a source plot to the portal via base Portal::Instance::AddSourceAt and, if it succeeded, re-attaches areas (AttachAreas). plumbing: not run (no live object) — 0x63430
AttachAreas MapAreaPortal:AttachAreas() For a route-portal area, walks its list of area ids, looks each up on the map, and collects the owning players of those areas (unique) into a fixed vector. plumbing: not run (no live object) Map::Route::Portal::AreaInstance::AttachAreas 0x634d0
RemoveSourceAt MapAreaPortal:RemoveSourceAt(iSourcePlot: integer) → boolean Removes a source plot from the portal's list (offset 0x10-0x18), resets a field at 0xa0 from 0x98, and re-attaches areas. plumbing: not run (no live object) — 0x64c20

Details

AddSourceAt

Arguments: iSourcePlot — plot index to add as source

Writes - Portal source list (via base) - attached areas

Input checks: Validation delegated to base AddSourceAt.

Multiplayer: may-desync, changes route portal data. Risk: medium (Changes route connectivity). Confidence of the reading: medium.

AttachAreas

Writes - appends unique player pointers to the vector at this+0x98..0xa8

Side effects - may grow the fixed vector (heap allocation on overflow)

Input checks: Skips areas that are not found or whose flag byte is zero; duplicates skipped.

Preconditions - called during portal setup - game thread

Multiplayer: safe-deterministic. Risk: low (internal protected helper building a cached list). Confidence of the reading: low.

Verified from the code - gets the editable map instance - iterates a 4-byte-id list at this+0x10 - dedups pointers into a fixed vector at this+0x98

Inferred - the pointer type is Player::Instance const* per the callee template; flag at +0xd81 probably means player is alive/valid

Open questions - meaning of the byte at +0xd81 - what the 4-byte ids are exactly (area ids vs plot indexes)

RemoveSourceAt

Arguments: iSourcePlot — source plot index to remove

Writes - Portal source list at +0x10..0x18 - field +0xa0

Side effects - AttachAreas called

Input checks: -1 rejected; returns false if not found.

Multiplayer: may-desync, changes route portal data. Risk: medium (Changes route connectivity). Confidence of the reading: high.