Portal Scripting¶
Cross-cutting reference for working in the Battlefield 6 Portal TypeScript runtime. Read this before starting any Portal mode — most of these pages document things that took hours of debugging to figure out, and the lessons apply to every mode.
Sections¶
-
Things that have actually broken in production. Console.log on PS5, smart punctuation crashes, CRLF line endings, AreaTrigger reliability, the SetScoreboardPlayerValues 6-arg cap, and more.
-
Specific Portal APIs that don't behave the way you'd expect.
mod.GetSpatialObjectlimitations,mod.Vectorcomponent requirements, WorldIcon ordering. -
Authoring map layouts in Godot, exporting to spatial JSON, the Z-axis sign flip, the
convert_ctf_spatial.pyObjId fixup, and the duplicate-ObjId silent failure. -
TypeScript bundle workflow, uploading to the Portal editor, testing iteration loop.
Why this section exists¶
Portal's editor and runtime have a number of constraints that aren't documented anywhere official:
- Console output behaves differently on PS5 vs. PC test sessions
- The TypeScript parser is finicky about specific characters
- Some APIs have undocumented argument limits that fail at runtime
- The Godot → spatial JSON pipeline has its own set of foot-guns
Every mode the 189th has shipped has tripped over at least three of these. This section is the running record so the next mode doesn't repeat them.