-- 玩家可以穿过随从: the app switch (set_companion_passage). On (the default), a companion's capsule ignores the -- collision channel of the real player's capsule, so the player walks through companions instead of being blocked -- in a narrow place; enemies collide with companions as before, and hits are unchanged (they are traced against the -- body mesh's physics bodies, not the capsule). Off, as in the game. Saved in Runtime/companion-passage.tsv. -- Only the companion's own capsule is written (and its mount's): its response to one channel, with the value it had -- recorded first. The player's capsule is only read, for its object type. A companion that leaves the team, the -- switch going off and the mod unloading on the game thread put the recorded response back and read it again. -- The same call on a capsule (SetCollisionResponseToChannel) is what the free camera's hold uses on the player's. local U=require('ue_observe') local Passage={} local HEADER='CompanionPassageV1' local IGNORE=0 -- ECollisionResponse: Ignore 0, Overlap 1, Block 2 local LINES=24 -- apply / restore lines in a load local function call(o,m,...) if not U.valid(o)then return false end local a,n={...},select('#',...);local ok,value=pcall(function()return o[m](o,table.unpack(a,1,n))end) return ok,U.unwrap(value) end local function nameOf(o)local ok,n=call(o,'GetFullName');return ok and type(n)=='string'and n or nil end local function short(n)return n and(n:match('[%.:]([^%.:]+)$')or n)or'?'end -- options: path, log, io, members() -> the arena's member list, player() -> the real player pawn, -- mount(actor) -> the vehicle a companion rides, or nil. function Passage.new(options) local log=options.log or function()end local fs,clock=options.io or io,options.clock or os.clock local file=options.path..'/companion-passage.tsv' local self={on=true,alive=true,message=''} local records={} -- capsule address -> {capsule, name, channel, old} local lines,noChannel=0,false local function say(text)if lines