Lobby 3d
This commit is contained in:
1 parent
fd5e92d0f5
commit
9f898c04dd
415 files changed
+6241617
-633464
No files matched your search
@@ -0,0 +1,16 @@
|
||||
-- (Server) посадить игрока на скамейку LobbyBench_1 и проверить, что он сидит лицом к фонтану (спиной к спинке)
|
||||
local p = game.Players:GetPlayers()[1]
|
||||
local bench = workspace.FishingMap.LobbyFix3:FindFirstChild("LobbyBench_1")
|
||||
local seat = bench and bench:FindFirstChildWhichIsA("Seat")
|
||||
if not seat then
|
||||
return "нет сиденья"
|
||||
end
|
||||
local hum = p.Character:FindFirstChildOfClass("Humanoid")
|
||||
p.Character:PivotTo(seat.CFrame + Vector3.new(0, 3, 0))
|
||||
task.wait(0.3)
|
||||
seat:Sit(hum)
|
||||
task.wait(1)
|
||||
local root = p.Character.HumanoidRootPart
|
||||
local toCenter = (Vector3.zero - root.Position) * Vector3.new(1, 0, 1)
|
||||
local facing = root.CFrame.LookVector:Dot(toCenter.Unit)
|
||||
return ("сидит: %s, лицом к фонтану: %.2f (1 = прямо к фонтану)"):format(tostring(seat.Occupant == hum), facing)
|
||||
@@ -0,0 +1,28 @@
|
||||
-- (Client) после правок №5: шаг обучения не ждёт таблички, портал в Мир 1 переносит, NPC в длинных юбках без видимых ног
|
||||
local P = game.Players.LocalPlayer
|
||||
local map = workspace.FishingMap
|
||||
local out = {}
|
||||
task.wait(2)
|
||||
local hint = ""
|
||||
for _, g in ipairs(P.PlayerGui.FishingUI:GetDescendants()) do
|
||||
if g:IsA("TextLabel") and g.Visible and (g.Text:find("табличку") or g.Text:find("портал")) then
|
||||
hint = g.Text
|
||||
end
|
||||
end
|
||||
table.insert(out, "шаг обучения: " .. tostring(P:GetAttribute("Tutorial")) .. ", подсказка: " .. hint)
|
||||
for _, n in ipairs({ "Бабушка Нюра", "Купчиха Злата", "Скупщица Зина" }) do
|
||||
local rig = map:FindFirstChild(n)
|
||||
local leg = rig and rig:FindFirstChild("RightLowerLeg")
|
||||
table.insert(out, n .. ": нога видна = " .. tostring(leg and leg.Transparency < 1))
|
||||
end
|
||||
local part = map.Portal_World1
|
||||
local pp = part:FindFirstChildWhichIsA("ProximityPrompt", true)
|
||||
P.Character:PivotTo(CFrame.new(part.Position.X, 4, part.Position.Z) + Vector3.new(part.Position.X, 0, part.Position.Z).Unit * 4)
|
||||
task.wait(1)
|
||||
pp:InputHoldBegin()
|
||||
task.wait(0.1)
|
||||
pp:InputHoldEnd()
|
||||
task.wait(4)
|
||||
local p = P.Character.HumanoidRootPart.Position
|
||||
table.insert(out, ("после портала Мира 1: (%.0f, %.0f, %.0f)"):format(p.X, p.Y, p.Z))
|
||||
return table.concat(out, "\n")
|
||||
@@ -0,0 +1,38 @@
|
||||
// Снимки HUD на ПК и в эмуляторе телефонов: node tools/mcp/hud-shots.js <prefix>
|
||||
// Для каждого устройства: Play у точки появления → HUD → окно «Сумка» → окно «Гильдия» → стоп.
|
||||
// Сохраняет <prefix>_<устройство>_{hud,bag,guild}.jpg
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const prefix = process.argv[2];
|
||||
const DEVICES = [['pc', null], ['iphone_se', 'iphone_7'], ['android', 'generic_handheld_720'],
|
||||
['iphone_14', 'iphone_14'], ['android_20x9', 'samsung_galaxy_a16'], ['tablet', 'samsung_galaxy_tab_a8']];
|
||||
const press = key => ({ tool: 'user_keyboard_input', args: { datamodel_type: 'Client', actions: [{ action: 'keyPress', key_code: key }] }, waitAfter: 1500 });
|
||||
const only = process.argv[3]; // pc | iphone_se | android — снять только это устройство
|
||||
fs.writeFileSync(path.join(os.tmpdir(), 'hud-stop.json'), JSON.stringify([{ tool: 'start_stop_play', args: { is_start: false }, waitAfter: 1500 }]));
|
||||
execFileSync('node', [path.join(__dirname, 'run.js'), path.join(os.tmpdir(), 'hud-stop.json')]);
|
||||
for (const [name, dev] of DEVICES.filter(d => !only || d[0] === only)) {
|
||||
const sim = dev
|
||||
? `local s = game:GetService("StudioDeviceSimulatorService") s:SetDeviceAsync("${dev}") task.wait(0.3) pcall(function() s:SetOrientationAsync(Enum.ScreenOrientation.LandscapeLeft) end) task.wait(0.3) return tostring(workspace.CurrentCamera.ViewportSize)`
|
||||
: `local s = game:GetService("StudioDeviceSimulatorService") pcall(function() s:StopSimulationAsync() end) task.wait(0.3) return tostring(workspace.CurrentCamera.ViewportSize)`;
|
||||
const steps = [
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: sim } },
|
||||
{ tool: 'start_stop_play', args: { is_start: true }, waitAfter: 22000 },
|
||||
{ tool: 'screen_capture', args: { capture_id: 'Hud' } },
|
||||
press('B'),
|
||||
{ tool: 'screen_capture', args: { capture_id: 'Bag' } },
|
||||
press('G'),
|
||||
{ tool: 'screen_capture', args: { capture_id: 'Guild' } },
|
||||
{ tool: 'get_console_output' },
|
||||
{ tool: 'start_stop_play', args: { is_start: false } },
|
||||
];
|
||||
const tmp = path.join(os.tmpdir(), 'hud-shots.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 });
|
||||
const kinds = ['hud', 'bag', 'guild'];
|
||||
let i = 0;
|
||||
for (const m of res.matchAll(/IMAGE (.+\.jpe?g)/g)) fs.renameSync(m[1].trim(), `${prefix}_${name}_${kinds[i++]}.jpg`);
|
||||
const errs = res.split('\n').filter(l => /error|Error|ERROR/.test(l) && !/TexturePack|not authorized|MaterialVariant|Kiosk/.test(l));
|
||||
console.log(name, res.match(/=== execute_luau\n(.+)/)?.[1] || '', 'снимков', i, errs.length ? '\n ' + errs.join('\n ') : '');
|
||||
}
|
||||
// вернуть обычный экран
|
||||
fs.writeFileSync(path.join(os.tmpdir(), 'hud-off.json'), JSON.stringify([{ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: 'pcall(function() game:GetService("StudioDeviceSimulatorService"):StopSimulationAsync() end) return 1' } }]));
|
||||
execFileSync('node', [path.join(__dirname, 'run.js'), path.join(os.tmpdir(), 'hud-off.json')]);
|
||||
@@ -0,0 +1,59 @@
|
||||
// Крупные планы голов NPC: node tools/mcp/npc-faces.js <suffix> "<Имя1>" "<Имя2>" …
|
||||
// Play → каждый NPC выводится на открытое место → снимки: спереди, сбоку, голова повёрнута на 60° (как при взгляде на игрока).
|
||||
// Сохраняет assets/reference/npc_check_<латиница>_<suffix>_{front,side,turn}.jpg
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const ROOT = path.join(__dirname, '..', '..');
|
||||
const [suffix, ...names] = process.argv.slice(2);
|
||||
const TR = { а:'a',б:'b',в:'v',г:'g',д:'d',е:'e',ё:'e',ж:'zh',з:'z',и:'i',й:'y',к:'k',л:'l',м:'m',н:'n',о:'o',п:'p',р:'r',с:'s',т:'t',у:'u',ф:'f',х:'h',ц:'c',ч:'ch',ш:'sh',щ:'sch',ъ:'',ы:'y',ь:'',э:'e',ю:'yu',я:'ya' };
|
||||
const slug = n => n.toLowerCase().split('').map(c => TR[c] ?? (/[a-z0-9]/.test(c) ? c : '_')).join('').replace(/_+/g, '_');
|
||||
const steps = [{ tool: 'start_stop_play', args: { is_start: true }, waitAfter: 20000 },
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Server', code: 'local c = game.Players:GetPlayers()[1].Character c:PivotTo(CFrame.new(0, 3, 2000)) c.HumanoidRootPart.Anchored = true return 1' } }];
|
||||
const shots = [];
|
||||
names.forEach((name, i) => {
|
||||
// NPC на пустое место высоко над картой, на невидимую плиту (у каждого своя)
|
||||
const X = 300 + i * 40;
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Server', code: `local rig = workspace.FishingMap:FindFirstChild(${JSON.stringify(name)})
|
||||
if not rig then return "нет" end
|
||||
local pad = Instance.new("Part") pad.Anchored = true pad.Size = Vector3.new(20, 1, 20) pad.CFrame = CFrame.new(${X}, 199.5, 0) pad.Color = Color3.fromRGB(120, 110, 100) pad.Parent = workspace
|
||||
rig.HumanoidRootPart.Anchored = true
|
||||
rig:PivotTo(CFrame.new(${X}, 200 + rig.Humanoid.HipHeight + rig.HumanoidRootPart.Size.Y / 2, 0))
|
||||
-- персонаж рядом, за спиной у камеры (иначе стриминг не прогрузит NPC)
|
||||
local pl = game.Players:GetPlayers()[1]
|
||||
pl.Character:PivotTo(CFrame.new(${X} + 6, 203, 14))
|
||||
pcall(function() pl:RequestStreamAroundAsync(Vector3.new(${X}, 200, 0), 10) end)
|
||||
return "ok"` }, waitAfter: 4000 });
|
||||
const cam = (dx, dz, turn) => `local RunService = game:GetService("RunService")
|
||||
local rig = workspace.FishingMap:FindFirstChild(${JSON.stringify(name)})
|
||||
local head = rig.Head
|
||||
pcall(function() RunService:UnbindFromRenderStep("ToolShot") end)
|
||||
local me = game.Players.LocalPlayer.Character
|
||||
RunService:BindToRenderStep("ToolShot", Enum.RenderPriority.Last.Value, function()
|
||||
for _, p in ipairs(me:GetDescendants()) do
|
||||
if p:IsA("BasePart") or p:IsA("Decal") then p.LocalTransparencyModifier = 1 end
|
||||
end
|
||||
local root = rig.HumanoidRootPart.CFrame
|
||||
local target = head.Position - Vector3.new(0, 0.6, 0)
|
||||
workspace.CurrentCamera.CFrame = CFrame.lookAt(target + root:VectorToWorldSpace(Vector3.new(${dx}, 0.4, ${dz})), target)
|
||||
workspace.CurrentCamera.FieldOfView = 40
|
||||
end)
|
||||
return "cam"`;
|
||||
for (const [k, dx, dz, turn] of [['front', 0.8, -6.5, 0], ['side', -6.5, -0.4, 0], ['turn', 1.5, -6.5, 60]]) {
|
||||
// поворот головы — на сервере (с клиента MCP не даёт менять суставы); 0 — вернуть прямо
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Server', code: `local rig = workspace.FishingMap:FindFirstChild(${JSON.stringify(name)})
|
||||
local neck = rig.Head:FindFirstChild("Neck")
|
||||
if neck and neck:IsA("Motor6D") then rig:SetAttribute("NeckC0", rig:GetAttribute("NeckC0") or neck.C0) neck.C0 = rig:GetAttribute("NeckC0") * CFrame.Angles(0, math.rad(${turn}), 0) end
|
||||
return 1` } });
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Client', code: cam(dx, dz, turn) }, waitAfter: 1500 });
|
||||
steps.push({ tool: 'screen_capture', args: { capture_id: 'Face' } });
|
||||
shots.push(path.join(ROOT, 'assets', 'reference', `npc_check_${slug(name)}_${suffix}_${k}.jpg`));
|
||||
}
|
||||
});
|
||||
steps.push({ tool: 'start_stop_play', args: { is_start: false } });
|
||||
const tmp = path.join(os.tmpdir(), 'npcfaces.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 });
|
||||
let i = 0;
|
||||
for (const m of res.matchAll(/IMAGE (.+\.jpe?g)/g)) fs.renameSync(m[1].trim(), shots[i++]);
|
||||
const lines = res.split('\n');
|
||||
lines.forEach((l, k) => { if (/ERROR/.test(l)) console.log(l + ' → ' + (lines[k + 1] || '').slice(0, 300)); });
|
||||
console.log(shots.slice(0, i).map(s => path.basename(s)).join('\n'));
|
||||
+12
-2
@@ -5,19 +5,29 @@ const fs = require('fs'), path = require('path'), os = require('os'), { execFile
|
||||
const [prefix, ...views] = process.argv.slice(2);
|
||||
const cam = (eye, target, fov) => `local RunService = game:GetService("RunService")
|
||||
local eye, target = Vector3.new(${eye}), Vector3.new(${target})
|
||||
-- персонаж — у точки съёмки (иначе стриминг не прогрузит место), но невидимый
|
||||
local me = game.Players.LocalPlayer.Character
|
||||
pcall(function() RunService:UnbindFromRenderStep("ToolShot") end)
|
||||
RunService:BindToRenderStep("ToolShot", Enum.RenderPriority.Last.Value, function()
|
||||
for _, p in ipairs(me:GetDescendants()) do
|
||||
if p:IsA("BasePart") or p:IsA("Decal") then p.LocalTransparencyModifier = 1 end
|
||||
end
|
||||
workspace.CurrentCamera.CFrame = CFrame.lookAt(eye, target)
|
||||
workspace.CurrentCamera.FieldOfView = ${fov || 60}
|
||||
end)
|
||||
return "cam"`;
|
||||
const steps = [
|
||||
{ tool: 'start_stop_play', args: { is_start: true }, waitAfter: 20000 },
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Server', code: 'local c = game.Players:GetPlayers()[1].Character c:PivotTo(CFrame.new(0, 3, 2000)) c.HumanoidRootPart.Anchored = true return 1' }, waitAfter: 1500 },
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Server', code: 'local p = game.Players:GetPlayers()[1] p:SetAttribute("Tutorial", 4) local c = p.Character c:PivotTo(CFrame.new(0, 3, 2000)) c.HumanoidRootPart.Anchored = true return 1' }, waitAfter: 1500 },
|
||||
];
|
||||
for (const v of views) {
|
||||
const [eye, target, fov] = v.split('|');
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Client', code: cam(eye, target, fov) }, waitAfter: 3000 });
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Server', code: `local p = game.Players:GetPlayers()[1]
|
||||
local t = Vector3.new(${target})
|
||||
p.Character:PivotTo(CFrame.new(t.X, math.max(t.Y, 3), t.Z))
|
||||
pcall(function() p:RequestStreamAroundAsync(t, 10) end)
|
||||
return 1` } });
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Client', code: cam(eye, target, fov) }, waitAfter: 3500 });
|
||||
steps.push({ tool: 'screen_capture', args: { capture_id: 'Shot' } });
|
||||
}
|
||||
steps.push({ tool: 'get_console_output' }, { tool: 'start_stop_play', args: { is_start: false } });
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// node tools/mcp/sync.js <пути от src/> … — записать исходники из src/ в открытый плейс через Studio MCP
|
||||
// (без Rojo). Новые скрипты создаются через multi_edit, существующие обновляются через execute_luau.
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const SRC = path.join(__dirname, '..', '..', 'src');
|
||||
const ROOTS = {
|
||||
'ReplicatedFirst': 'game.ReplicatedFirst', 'ReplicatedStorage': 'game.ReplicatedStorage',
|
||||
'ServerScriptService': 'game.ServerScriptService', 'StarterPlayer/StarterPlayerScripts': 'game.StarterPlayer.StarterPlayerScripts',
|
||||
};
|
||||
const steps = [];
|
||||
for (const rel of process.argv.slice(2)) {
|
||||
const norm = rel.replace(/\\/g, '/');
|
||||
const rootKey = Object.keys(ROOTS).find(k => norm.startsWith(k + '/'));
|
||||
if (!rootKey) throw new Error('неизвестная папка: ' + rel);
|
||||
const file = path.basename(norm);
|
||||
let name, cls;
|
||||
if (file.endsWith('.server.lua')) { name = file.slice(0, -11); cls = 'Script'; }
|
||||
else if (file.endsWith('.client.lua')) { name = file.slice(0, -11); cls = 'LocalScript'; }
|
||||
else { name = file.slice(0, -4); cls = 'ModuleScript'; }
|
||||
const src = fs.readFileSync(path.join(SRC, norm), 'utf8').replace(/^/, '');
|
||||
let lvl = 1; while (src.includes(']' + '='.repeat(lvl) + ']')) lvl++;
|
||||
const eq = '='.repeat(lvl);
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: `local s = ${ROOTS[rootKey]}:FindFirstChild(${JSON.stringify(name)})
|
||||
if not s or s.ClassName ~= ${JSON.stringify(cls)} then return ${JSON.stringify(name)} .. " НЕТ В ПЛЕЙСЕ" end
|
||||
local src = [${eq}[${src}]${eq}]
|
||||
local ok = pcall(function() game:GetService("ScriptEditorService"):UpdateSourceAsync(s, function() return src end) end)
|
||||
if not ok then s.Source = src end
|
||||
return ${JSON.stringify(name)} .. " ok " .. #s.Source` } });
|
||||
}
|
||||
const tmp = path.join(os.tmpdir(), 'fishing-sync-' + process.pid + '.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
process.stdout.write(execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 }));
|
||||
fs.unlinkSync(tmp);
|
||||
@@ -0,0 +1,42 @@
|
||||
// Снимки окон: node tools/mcp/window-shots.js <prefix> <pc|phone> <окно[:вкладка][@рыб]> ...
|
||||
// Например: node tools/mcp/window-shots.js assets/reference/ui2 phone bag:fish@0 bag:fish@7 bag:dex@7 worlds
|
||||
// Окна открываются атрибутом DevOpen (работает только в Studio), рыба в сумке — атрибутом DevFakeBag.
|
||||
// Сохраняет <prefix>_<окно>[_вкладка][_N]_<устройство>.jpg
|
||||
const fs = require('fs'), path = require('path'), os = require('os'), { execFileSync } = require('child_process');
|
||||
const [prefix, device, ...views] = process.argv.slice(2);
|
||||
const DEV = { pc: null, phone: 'iphone_7', android: 'generic_handheld_720' }[device];
|
||||
const run = steps => {
|
||||
const tmp = path.join(os.tmpdir(), 'win-shots-' + process.pid + '.json');
|
||||
fs.writeFileSync(tmp, JSON.stringify(steps));
|
||||
const res = execFileSync('node', [path.join(__dirname, 'run.js'), tmp], { encoding: 'utf8', maxBuffer: 1 << 26 });
|
||||
fs.unlinkSync(tmp);
|
||||
return res;
|
||||
};
|
||||
run([{ tool: 'start_stop_play', args: { is_start: false }, waitAfter: 1500 }]);
|
||||
const sim = DEV
|
||||
? `local s = game:GetService("StudioDeviceSimulatorService") s:SetDeviceAsync("${DEV}") task.wait(0.3) pcall(function() s:SetOrientationAsync(Enum.ScreenOrientation.LandscapeLeft) end) return 1`
|
||||
: `pcall(function() game:GetService("StudioDeviceSimulatorService"):StopSimulationAsync() end) return 1`;
|
||||
const steps = [
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: sim } },
|
||||
{ tool: 'start_stop_play', args: { is_start: true }, waitAfter: 20000 },
|
||||
// без ввода игровое окно Studio может не рисовать 3D (мир и превью моделей чёрные) — «будим» его клавишей
|
||||
{ tool: 'user_keyboard_input', args: { datamodel_type: 'Client', actions: [{ action: 'keyPress', key_code: 'RightShift' }] }, waitAfter: 1500 },
|
||||
{ tool: 'execute_luau', args: { datamodel_type: 'Server', code: 'local p = game.Players:GetPlayers()[1] p:SetAttribute("Tutorial", 4) return 1' }, waitAfter: 800 },
|
||||
{ tool: 'user_keyboard_input', args: { datamodel_type: 'Client', actions: [{ action: 'keyPress', key_code: 'RightShift' }] }, waitAfter: 1500 },
|
||||
];
|
||||
const names = [];
|
||||
for (const v of views) {
|
||||
const [win, n] = v.split('@');
|
||||
const fish = n === undefined ? 0 : Number(n);
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Server', code: `local p = game.Players:GetPlayers()[1]
|
||||
p:SetAttribute("DevOpen", "") p:SetAttribute("DevFakeBag", ${fish}) task.wait(0.2) p:SetAttribute("DevOpen", ${JSON.stringify(win)}) return 1` }, waitAfter: 2500 });
|
||||
steps.push({ tool: 'screen_capture', args: { capture_id: 'Win' } });
|
||||
names.push(win.replace(':', '_') + (n !== undefined && fish > 0 ? '_' + fish : ''));
|
||||
}
|
||||
steps.push({ tool: 'get_console_output' }, { tool: 'start_stop_play', args: { is_start: false } });
|
||||
steps.push({ tool: 'execute_luau', args: { datamodel_type: 'Edit', code: 'pcall(function() game:GetService("StudioDeviceSimulatorService"):StopSimulationAsync() end) return 1' } });
|
||||
const res = run(steps);
|
||||
let i = 0;
|
||||
for (const m of res.matchAll(/IMAGE (.+\.jpe?g)/g)) fs.renameSync(m[1].trim(), `${prefix}_${names[i++]}_${device}.jpg`);
|
||||
const errs = res.split('\n').filter(l => /error|Error|ERROR|Stack|attempt to/.test(l) && !/TexturePack|not authorized|MaterialVariant|LowPolyFlat|Kiosk/.test(l));
|
||||
console.log('снимков', i, errs.length ? '\n ' + errs.join('\n ') : 'ошибок нет');
|
||||
Reference in new issue
Block a user