-- Where a batch of summons goes. -- Outside the free camera: ahead of the player's body, as it always was. In the free camera the body stands hidden where it -- was left and summons came out around it, whatever the camera looked at, into whatever stood next to the body. Now the batch -- comes out where the view points: its first row on the spot the view hits (or some way ahead when it hits nothing), on the -- ground there, turned the way the view looks. Companions still start by the body, which they follow. -- Either way a spot with a wall between it and the middle of the batch is pulled back to this side of the wall. local Spot={} local AIM_RANGE=8000 -- cm the view looks for something to stand on local AIM_EMPTY=1500 -- cm ahead of the camera when it hits nothing local AIM_BACK=100 -- cm from what the view hit, back toward the camera local FIRST_ROW=600 -- cm: arena_controller's first row of blue, red and no-team units, ahead of the origin local BODY=100 -- cm from the feet to the height a batch is worked out at, about a capsule's middle local WALL_Z=50 -- cm over that height a wall is looked for local WALL_GAP=120 -- cm kept from a wall local MIN_REACH=100 -- cm: a spot this close to the middle is not checked, nor pulled closer than this local CLEAR_START=60 -- cm from the middle the line starts, past the capsule of a body standing there local SLOPE=0.5 -- a surface whose normal has this much Z can be walked on: a hillside, not a wall local LINES=40 local function text(v)return v and string.format('%.0f,%.0f,%.0f',v.X,v.Y,v.Z) or '?' end function Spot.new(options) local log=options.log or function()end local self={} local center,lastBody local lines=0 local function say(line) if lines=SLOPE then return false end local reach=math.sqrt((hit.at.X-center.X)^2+(hit.at.Y-center.Y)^2) if reach>=length then return false end local keep=math.max(reach-WALL_GAP,math.min(MIN_REACH,reach*0.5)) local before=text(spot) spot.X,spot.Y=center.X+dx/length*keep,center.Y+dy/length*keep say(string.format('出生点被墙挡住 原=%s 墙在中心外 %.0fcm 改到=%s(离中心 %.0fcm)',before,reach,text(spot),keep)) return true end -- The middle of the batch being summoned: what a spot over a drop moves toward (on_ground.lua). function self:anchor()return center end return self end return Spot