Lobby 3d
This commit is contained in:
1 parent
fd5e92d0f5
commit
9f898c04dd
415 files changed
+6241617
-633464
No files matched your search
@@ -19,9 +19,9 @@ function build(name, flowers) {
|
||||
for (const [y0, y1, h, c] of legF) m.box(`LegF_${t}`, c, [x - h, y0, -0.75 - h], [x + h, y1, -0.75 + h]);
|
||||
// задняя ножка поднимается в стойку спинки с наклоном назад
|
||||
for (const [y0, y1, h, c] of legF) m.box(`LegB_${t}`, c, [x - h, y0, 0.55 - h], [x + h, y1, 0.55 + h]);
|
||||
m.box(`BackPost_${t}`, 'walnut', [x - 0.14, 1.3, 0.41], [x + 0.14, 3.35, 0.69], { rot: [-10, 0, 0], pivot: [x, 1.3, 0.55] });
|
||||
m.box(`BackPostCap_${t}`, 'brass', [x - 0.18, 3.35, 0.37], [x + 0.18, 3.5, 0.73], { rot: [-10, 0, 0], pivot: [x, 1.3, 0.55] });
|
||||
m.box(`BackPostKnob_${t}`, 'brassDark', [x - 0.1, 3.5, 0.45], [x + 0.1, 3.65, 0.65], { rot: [-10, 0, 0], pivot: [x, 1.3, 0.55] });
|
||||
m.box(`BackPost_${t}`, 'walnut', [x - 0.14, 1.3, 0.41], [x + 0.14, 3.35, 0.69], { rot: [12, 0, 0], pivot: [x, 1.3, 0.55] });
|
||||
m.box(`BackPostCap_${t}`, 'brass', [x - 0.18, 3.35, 0.37], [x + 0.18, 3.5, 0.73], { rot: [12, 0, 0], pivot: [x, 1.3, 0.55] });
|
||||
m.box(`BackPostKnob_${t}`, 'brassDark', [x - 0.1, 3.5, 0.45], [x + 0.1, 3.65, 0.65], { rot: [12, 0, 0], pivot: [x, 1.3, 0.55] });
|
||||
// царга сбоку и проножка
|
||||
m.box(`SideRail_${t}`, 'oak2', [x - 0.1, 1.05, -0.75], [x + 0.1, 1.28, 0.55]);
|
||||
m.box(`Stretcher_${t}`, 'walnutDark', [x - 0.08, 0.3, -0.75], [x + 0.08, 0.42, 0.55]);
|
||||
@@ -52,7 +52,8 @@ function build(name, flowers) {
|
||||
|
||||
// ---------- Спинка: две рейки и резная доска с латунным медальоном
|
||||
m.group('Back');
|
||||
const bk = { rot: [-10, 0, 0], pivot: [0, 1.3, 0.55] };
|
||||
// спинка откинута назад (к +Z, от сидящего) на 12° вокруг заднего края сиденья
|
||||
const bk = { rot: [12, 0, 0], pivot: [0, 1.3, 0.55] };
|
||||
m.box('BackRail_Low', 'oak2', [-2.65, 1.85, 0.47], [2.65, 2.1, 0.63], bk);
|
||||
m.box('BackRail_Top', 'oak', [-2.75, 3.05, 0.45], [2.75, 3.35, 0.65], bk);
|
||||
m.box('BackRail_TopCrest', 'oak', [-1.2, 3.35, 0.47], [1.2, 3.5, 0.63], bk);
|
||||
@@ -64,7 +65,8 @@ function build(name, flowers) {
|
||||
}
|
||||
m.box('BackPanel', 'walnut', [-0.75, 2.1, 0.48], [0.75, 3.05, 0.62], bk);
|
||||
m.box('Medallion', 'brass', [-0.32, 2.38, 0.42], [0.32, 2.78, 0.48], bk);
|
||||
m.box('MedallionR', 'brassDark', [-0.22, 2.36, 0.4], [0.22, 2.8, 0.44], { rot: [-10, 0, 45], pivot: [0, 2.58, 0.44] });
|
||||
// ромб медальона: центр (0, 2.58, 0.42), повёрнутый вместе со спинкой (12° вокруг (0, 1.3, 0.55)) → (0, 2.579, 0.689)
|
||||
m.box('MedallionR', 'brassDark', [-0.22, 2.359, 0.669], [0.22, 2.799, 0.709], { rot: [12, 0, 45], pivot: [0, 2.579, 0.689] });
|
||||
for (const x of [-2.3, 2.3]) m.box('BackStrap', 'iron', [x - 0.1, 1.85, 0.44], [x + 0.1, 3.35, 0.47], bk);
|
||||
|
||||
if (flowers) {
|
||||
|
||||
@@ -0,0 +1,463 @@
|
||||
// Набор декора лобби в стиле лавок: все модели из кубов, одна общая палитра (одинаковые цвета в каждом файле).
|
||||
// Каждая модель — assets/props/decor_<name>.bbmodel (+ .obj, палитра). Низ на Y=0, центр X/Z в нуле, «лицо» в −Z.
|
||||
// node tools/bbshop/decor.js <scratch> [pack.png]
|
||||
const path = require('path');
|
||||
const { Model, fish, barrel, crate } = require('./lib');
|
||||
const DIR = path.resolve(__dirname, '../../assets/props');
|
||||
|
||||
const PALETTE = {
|
||||
wood: [160, 104, 62], wood2: [138, 88, 52], woodDark: [92, 58, 36], woodLight: [190, 140, 92],
|
||||
stone: [168, 164, 158], stoneLight: [198, 194, 186], stoneDark: [122, 118, 114],
|
||||
iron: [62, 62, 68], brass: [204, 158, 66], rope: [196, 168, 116],
|
||||
straw: [222, 186, 102], straw2: [196, 158, 80], strawLight: [240, 214, 140],
|
||||
leaf: [76, 140, 62], leaf2: [56, 110, 48], soil: [74, 52, 36],
|
||||
red: [204, 64, 60], yellow: [242, 202, 76], purple: [172, 108, 210], white: [244, 240, 230], blue: [86, 136, 206], orange: [236, 136, 52],
|
||||
hen: [240, 236, 226], henShade: [214, 206, 192], comb: [210, 44, 44], beak: [240, 168, 50], beakDark: [200, 120, 36],
|
||||
ginger: [226, 138, 62], gingerDark: [178, 96, 40], gray: [140, 140, 146], grayDark: [96, 96, 104], catLight: [244, 238, 226],
|
||||
pink: [232, 140, 150], eye: [120, 196, 90], black: [24, 24, 30], fishEye: [24, 24, 30],
|
||||
water: [70, 120, 150], cream: [238, 226, 196], teal: [52, 128, 140], cork: [196, 150, 96],
|
||||
goldfish: [244, 148, 36], goldfishLight: [255, 204, 112], goldfishFin: [248, 112, 44],
|
||||
koiWhite: [246, 244, 238], koiOrange: [240, 104, 40], koiFin: [250, 220, 200],
|
||||
carp: [176, 128, 60], carpBack: [118, 84, 40], carpBelly: [226, 196, 128], carpFin: [140, 94, 46],
|
||||
roach: [182, 194, 204], roachBack: [92, 114, 132], roachBelly: [240, 244, 246], roachFin: [216, 72, 60],
|
||||
};
|
||||
const MODELS = [];
|
||||
function model(name) {
|
||||
const m = new Model(name);
|
||||
for (const k in PALETTE) m.color(k, PALETTE[k]);
|
||||
MODELS.push(m);
|
||||
return m;
|
||||
}
|
||||
// куб по центру/полуразмерам с поворотом вокруг X относительно своего центра + общий поворот позы вокруг оси X в точке P
|
||||
function posed(m, parts, ang = 0, P = [0, 0, 0]) {
|
||||
const a = ang * Math.PI / 180;
|
||||
for (const [name, col, c, h, rx = 0, ry = 0] of parts) {
|
||||
const y = c[1] - P[1], z = c[2] - P[2];
|
||||
const cc = [c[0], P[1] + y * Math.cos(a) - z * Math.sin(a), P[2] + y * Math.sin(a) + z * Math.cos(a)];
|
||||
const tot = rx + ang;
|
||||
m.box(name, col, [cc[0] - h[0], cc[1] - h[1], cc[2] - h[2]], [cc[0] + h[0], cc[1] + h[1], cc[2] + h[2]], tot || ry ? { rot: [tot, ry, 0], pivot: cc } : {});
|
||||
}
|
||||
}
|
||||
// сплошной «круглый» блок: квадрат + квадрат под 45°
|
||||
function round(m, nm, col, cx, cz, y0, y1, r, col2) {
|
||||
const s = r * 0.83;
|
||||
m.box(nm, col, [cx - s, y0, cz - s], [cx + s, y1, cz + s]);
|
||||
m.box(nm + 'R', col2 || col, [cx - s, y0, cz - s], [cx + s, y1, cz + s], { rot: [0, 45, 0], pivot: [cx, 0, cz] });
|
||||
}
|
||||
// отрезок между двумя точками в плоскости XY (толщина t)
|
||||
function seg(m, nm, col, a, b, t, z = 0) {
|
||||
const cx = (a[0] + b[0]) / 2, cy = (a[1] + b[1]) / 2, len = Math.hypot(b[0] - a[0], b[1] - a[1]), ang = Math.atan2(b[1] - a[1], b[0] - a[0]) * 180 / Math.PI;
|
||||
m.box(nm, col, [cx - len / 2 - t / 2, cy - t / 2, z - t / 2], [cx + len / 2 + t / 2, cy + t / 2, z + t / 2], { rot: [0, 0, ang], pivot: [cx, cy, z] });
|
||||
}
|
||||
|
||||
// ================= 1) Курица: стоит и клюёт =================
|
||||
function chicken(name, peck) {
|
||||
const m = model(name);
|
||||
m.group('Legs');
|
||||
for (const s of [-1, 1]) {
|
||||
const x = s * 0.12;
|
||||
m.box('Leg', 'beak', [x - 0.035, 0.03, -0.035], [x + 0.035, 0.52, 0.035]);
|
||||
m.box('ToeF', 'beak', [x - 0.025, 0, -0.2], [x + 0.025, 0.04, 0.0]);
|
||||
m.box('ToeL', 'beak', [x - 0.025, 0, -0.17], [x + 0.025, 0.04, 0.0], { rot: [0, 35, 0], pivot: [x, 0, 0] });
|
||||
m.box('ToeR', 'beak', [x - 0.025, 0, -0.17], [x + 0.025, 0.04, 0.0], { rot: [0, -35, 0], pivot: [x, 0, 0] });
|
||||
m.box('ToeB', 'beak', [x - 0.02, 0, 0.0], [x + 0.02, 0.04, 0.09]);
|
||||
}
|
||||
m.group('Body');
|
||||
const parts = [
|
||||
['Body', 'hen', [0, 0.8, 0.05], [0.3, 0.24, 0.36]],
|
||||
['Breast', 'hen', [0, 0.74, -0.3], [0.25, 0.21, 0.1]],
|
||||
['Belly', 'henShade', [0, 0.58, 0.05], [0.24, 0.05, 0.28]],
|
||||
['Rear', 'hen', [0, 0.96, 0.4], [0.24, 0.2, 0.1]],
|
||||
['Tail1', 'hen', [0, 1.22, 0.5], [0.17, 0.2, 0.07], 25],
|
||||
['Tail2', 'henShade', [0, 1.36, 0.6], [0.11, 0.15, 0.05], 38],
|
||||
['WingL', 'henShade', [-0.31, 0.83, 0.1], [0.035, 0.15, 0.25], -8],
|
||||
['WingR', 'henShade', [0.31, 0.83, 0.1], [0.035, 0.15, 0.25], -8],
|
||||
['WingTipL', 'henShade', [-0.3, 0.74, 0.34], [0.03, 0.08, 0.06]],
|
||||
['WingTipR', 'henShade', [0.3, 0.74, 0.34], [0.03, 0.08, 0.06]],
|
||||
['Neck', 'hen', [0, 1.08, -0.3], [0.15, 0.14, 0.13]],
|
||||
['Head', 'hen', [0, 1.3, -0.36], [0.14, 0.13, 0.14]],
|
||||
['Beak', 'beak', [0, 1.29, -0.55], [0.05, 0.035, 0.06]],
|
||||
['BeakLow', 'beakDark', [0, 1.245, -0.52], [0.035, 0.02, 0.04]],
|
||||
['Wattle', 'comb', [0, 1.17, -0.48], [0.035, 0.06, 0.03]],
|
||||
['Comb1', 'comb', [0, 1.47, -0.44], [0.035, 0.05, 0.045]],
|
||||
['Comb2', 'comb', [0, 1.5, -0.35], [0.035, 0.07, 0.05]],
|
||||
['Comb3', 'comb', [0, 1.47, -0.26], [0.035, 0.05, 0.045]],
|
||||
['EyeL', 'black', [-0.145, 1.33, -0.42], [0.01, 0.03, 0.03]],
|
||||
['EyeR', 'black', [0.145, 1.33, -0.42], [0.01, 0.03, 0.03]],
|
||||
];
|
||||
posed(m, parts, peck ? -55 : 0, [0, 0.52, 0.12]);
|
||||
if (peck) for (const [x, z] of [[0.05, -0.75], [-0.1, -0.68], [0.12, -0.62]]) { m.group('Grain'); m.box('Grain', 'straw', [x - 0.03, 0, z - 0.03], [x + 0.03, 0.03, z + 0.03]); }
|
||||
}
|
||||
chicken('decor_chicken', false);
|
||||
chicken('decor_chicken_peck', true);
|
||||
|
||||
// ================= 2) Кот: сидит и лежит, рыжий и серый =================
|
||||
function catHead(m, c, fur, dark) {
|
||||
const [x, y, z] = c;
|
||||
m.box('Head', fur, [x - 0.21, y - 0.17, z - 0.17], [x + 0.21, y + 0.17, z + 0.17]);
|
||||
m.box('Cheeks', fur, [x - 0.25, y - 0.15, z - 0.12], [x + 0.25, y - 0.02, z + 0.08]);
|
||||
m.box('Muzzle', 'catLight', [x - 0.1, y - 0.16, z - 0.21], [x + 0.1, y - 0.04, z - 0.15]);
|
||||
m.box('Nose', 'pink', [x - 0.03, y - 0.06, z - 0.225], [x + 0.03, y - 0.02, z - 0.205]);
|
||||
for (const s of [-1, 1]) {
|
||||
m.box('Eye', 'eye', [x + s * 0.09 - 0.045, y, z - 0.18], [x + s * 0.09 + 0.045, y + 0.08, z - 0.165]);
|
||||
m.box('Pupil', 'black', [x + s * 0.09 - 0.012, y + 0.005, z - 0.185], [x + s * 0.09 + 0.012, y + 0.075, z - 0.172]);
|
||||
m.box('Ear', fur, [x + s * 0.13 - 0.08, y + 0.1, z - 0.04], [x + s * 0.13 + 0.08, y + 0.26, z + 0.04], { rot: [0, 0, 45], pivot: [x + s * 0.13, y + 0.18, z] });
|
||||
m.box('EarIn', 'pink', [x + s * 0.13 - 0.045, y + 0.14, z - 0.05], [x + s * 0.13 + 0.045, y + 0.23, z - 0.035], { rot: [0, 0, 45], pivot: [x + s * 0.13, y + 0.18, z] });
|
||||
}
|
||||
for (const dx of [-0.07, 0, 0.07]) m.box('HeadStripe', dark, [x + dx - 0.022, y + 0.17, z - 0.12], [x + dx + 0.022, y + 0.18, z + 0.1]);
|
||||
}
|
||||
function cat(name, pose, fur, dark) {
|
||||
const m = model(name);
|
||||
m.group('Cat');
|
||||
if (pose === 'sit') {
|
||||
m.box('Haunch', fur, [-0.29, 0, -0.05], [0.29, 0.5, 0.45]);
|
||||
posed(m, [['Torso', fur, [0, 0.62, 0.02], [0.21, 0.32, 0.19], 12], ['Chest', 'catLight', [0, 0.55, -0.16], [0.15, 0.22, 0.05], 8]]);
|
||||
for (const s of [-1, 1]) {
|
||||
m.box('FrontLeg', fur, [s * 0.1 - 0.06, 0.05, -0.28], [s * 0.1 + 0.06, 0.5, -0.16]);
|
||||
m.box('Paw', 'catLight', [s * 0.1 - 0.07, 0, -0.33], [s * 0.1 + 0.07, 0.07, -0.16]);
|
||||
m.box('HindPaw', 'catLight', [s * 0.22 - 0.07, 0, -0.14], [s * 0.22 + 0.07, 0.07, 0.06]);
|
||||
for (const y of [0.15, 0.3]) m.box('HaunchStripe', dark, [s * 0.29 - 0.01, y, 0.0], [s * 0.29 + 0.01, y + 0.05, 0.4]);
|
||||
}
|
||||
for (const y of [0.55, 0.72, 0.88]) posed(m, [['BackStripe', dark, [0, y, 0.215], [0.17, 0.025, 0.01], 12]], 0);
|
||||
catHead(m, [0, 1.08, -0.1], fur, dark);
|
||||
// хвост обвивает лапы
|
||||
m.box('Tail1', fur, [0.25, 0, 0.0], [0.37, 0.12, 0.45]);
|
||||
m.box('Tail2', fur, [0.18, 0, -0.32], [0.3, 0.12, 0.02], { rot: [0, -30, 0], pivot: [0.31, 0, 0.0] });
|
||||
m.box('TailTip', dark, [0.0, 0, -0.42], [0.22, 0.11, -0.3]);
|
||||
} else {
|
||||
m.box('Body', fur, [-0.24, 0, -0.25], [0.24, 0.4, 0.62]);
|
||||
m.box('Chest', 'catLight', [-0.17, 0.02, -0.29], [0.17, 0.3, -0.24]);
|
||||
for (const s of [-1, 1]) {
|
||||
m.box('Paw', 'catLight', [s * 0.1 - 0.065, 0, -0.55], [s * 0.1 + 0.065, 0.09, -0.24]);
|
||||
m.box('Hind', fur, [s * 0.24 - 0.05, 0, 0.25], [s * 0.24 + (s > 0 ? 0.05 : 0.05), 0.28, 0.58]);
|
||||
for (const z of [0.0, 0.2, 0.4]) m.box('SideStripe', dark, [s * 0.24 - 0.01, 0.12, z], [s * 0.24 + 0.01, 0.38, z + 0.06]);
|
||||
}
|
||||
for (const z of [-0.05, 0.15, 0.35, 0.52]) m.box('BackStripe', dark, [-0.17, 0.4, z], [0.17, 0.41, z + 0.06]);
|
||||
catHead(m, [0, 0.36, -0.36], fur, dark);
|
||||
m.box('Tail1', fur, [0.2, 0, 0.55], [0.32, 0.12, 0.95]);
|
||||
m.box('Tail2', fur, [0.32, 0, 0.75], [0.62, 0.12, 0.87]);
|
||||
m.box('TailTip', dark, [0.62, 0, 0.6], [0.74, 0.11, 0.87]);
|
||||
}
|
||||
}
|
||||
cat('decor_cat_sit_ginger', 'sit', 'ginger', 'gingerDark');
|
||||
cat('decor_cat_sit_gray', 'sit', 'gray', 'grayDark');
|
||||
cat('decor_cat_lie_ginger', 'lie', 'ginger', 'gingerDark');
|
||||
cat('decor_cat_lie_gray', 'lie', 'gray', 'grayDark');
|
||||
|
||||
// ================= 3) Клумба и кадка =================
|
||||
function flower(m, i, x, z, h, col, y0) {
|
||||
m.box(`Stem_${i}`, 'leaf2', [x - 0.03, y0, z - 0.03], [x + 0.03, h, z + 0.03]);
|
||||
const ly = y0 + (h - y0) * 0.45;
|
||||
m.box(`LeafA_${i}`, 'leaf', [x, ly, z - 0.04], [x + 0.2, ly + 0.07, z + 0.04], { rot: [0, 0, 30], pivot: [x, ly, z] });
|
||||
m.box(`LeafB_${i}`, 'leaf', [x - 0.18, ly + 0.12, z - 0.04], [x, ly + 0.19, z + 0.04], { rot: [0, 0, -30], pivot: [x, ly + 0.12, z] });
|
||||
const core = col === 'yellow' ? 'orange' : 'yellow';
|
||||
m.box(`Bud_${i}`, core, [x - 0.06, h, z - 0.06], [x + 0.06, h + 0.12, z + 0.06]);
|
||||
for (const [dx, dz] of [[1, 0], [-1, 0], [0, 1], [0, -1]]) m.box(`Petal_${i}`, col, [x + dx * 0.11 - 0.065, h - 0.01, z + dz * 0.11 - 0.065], [x + dx * 0.11 + 0.065, h + 0.1, z + dz * 0.11 + 0.065]);
|
||||
}
|
||||
{
|
||||
const m = model('decor_flowerbed');
|
||||
m.group('Box');
|
||||
const X = 1.6, Z = 0.65, H = 0.65;
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const y0 = i * 0.21, col = i % 2 ? 'wood2' : 'wood';
|
||||
m.box('PlankF', col, [-X, y0, -Z], [X, y0 + 0.2, -Z + 0.08]);
|
||||
m.box('PlankB', col, [-X, y0, Z - 0.08], [X, y0 + 0.2, Z]);
|
||||
m.box('PlankL', col, [-X, y0, -Z], [-X + 0.08, y0 + 0.2, Z]);
|
||||
m.box('PlankR', col, [X - 0.08, y0, -Z], [X, y0 + 0.2, Z]);
|
||||
}
|
||||
for (const [x, z] of [[-X, -Z], [X, -Z], [-X, Z], [X, Z]]) m.box('Post', 'woodDark', [x - 0.1, 0, z - 0.1], [x + 0.1, H + 0.1, z + 0.1]);
|
||||
m.box('RimF', 'woodDark', [-X, H - 0.03, -Z - 0.04], [X, H + 0.04, -Z + 0.1]);
|
||||
m.box('RimB', 'woodDark', [-X, H - 0.03, Z - 0.1], [X, H + 0.04, Z + 0.04]);
|
||||
for (const x of [-0.55, 0.55]) m.box('Strap', 'iron', [x - 0.06, 0.05, -Z - 0.02], [x + 0.06, H - 0.05, -Z + 0.01]);
|
||||
m.box('Soil', 'soil', [-X + 0.08, 0.1, -Z + 0.08], [X - 0.08, 0.6, Z - 0.08]);
|
||||
m.group('Flowers');
|
||||
const cols = ['red', 'yellow', 'purple', 'white', 'blue'];
|
||||
let i = 0;
|
||||
for (const [row, z] of [[0, 0.28], [1, -0.25]]) for (let k = 0; k < 7; k++) {
|
||||
const x = -1.3 + k * 0.43 + row * 0.2;
|
||||
if (x > 1.35) continue;
|
||||
const h = 0.6 + 0.55 + ((k * 7 + row * 3) % 5) * 0.09 - row * 0.12;
|
||||
flower(m, i, x, z, h, cols[(k + row * 2) % cols.length], 0.6); i++;
|
||||
}
|
||||
for (let k = 0; k < 6; k++) m.box('Bush_' + k, k % 2 ? 'leaf2' : 'leaf', [-1.35 + k * 0.52, 0.6, -0.5], [-1.1 + k * 0.52, 0.82, -0.32]);
|
||||
}
|
||||
{
|
||||
const m = model('decor_flowerpot');
|
||||
m.group('Pot');
|
||||
round(m, 'Tub', 'wood', 0, 0, 0, 0.9, 0.62, 'wood2');
|
||||
round(m, 'TubLip', 'woodDark', 0, 0, 0.9, 1.0, 0.7);
|
||||
for (const y of [0.12, 0.62]) round(m, 'Band', 'iron', 0, 0, y, y + 0.1, 0.66);
|
||||
round(m, 'Soil', 'soil', 0, 0, 0.98, 1.02, 0.56);
|
||||
m.group('Bush');
|
||||
[[0, 0, 0.42, 1.0, 1.75], [-0.25, -0.2, 0.3, 1.0, 1.55], [0.25, 0.22, 0.3, 1.0, 1.6], [0.22, -0.25, 0.26, 1.0, 1.45], [-0.25, 0.25, 0.27, 1.0, 1.5]].forEach(([x, z, r, a, b], k) =>
|
||||
round(m, 'Leaves_' + k, k % 2 ? 'leaf2' : 'leaf', x, z, a, b, r, k % 2 ? 'leaf' : 'leaf2'));
|
||||
[[-0.32, -0.32, 1.62, 'red'], [0.1, -0.4, 1.78, 'yellow'], [0.36, -0.1, 1.66, 'purple'], [-0.12, 0.12, 1.9, 'white'], [0.3, 0.32, 1.7, 'red']].forEach(([x, z, h, col], k) => flower(m, k, x, z, h, col, 1.3));
|
||||
}
|
||||
|
||||
// ================= 4) Колодец =================
|
||||
{
|
||||
const m = model('decor_well');
|
||||
m.group('Stone');
|
||||
const T = Math.tan(Math.PI / 8), A = 1.4;
|
||||
for (let k = 0; k < 8; k++) {
|
||||
const half = A * T + 0.03;
|
||||
for (let row = 0; row < 3; row++) {
|
||||
const off = row % 2 ? 0.1 : -0.1;
|
||||
m.box(`Wall_${k}_${row}`, (k + row) % 2 ? 'stone' : 'stoneLight', [-half + off, row * 0.33, A - 0.35], [half + off, row * 0.33 + 0.32, A], { rot: [0, k * 45, 0], pivot: [0, 0, 0] });
|
||||
}
|
||||
m.box('Cap_' + k, 'stoneDark', [-(A + 0.1) * T - 0.03, 0.99, A - 0.42], [(A + 0.1) * T + 0.03, 1.13, A + 0.1], { rot: [0, k * 45, 0], pivot: [0, 0, 0] });
|
||||
}
|
||||
round(m, 'Water', 'water', 0, 0, 0.5, 0.55, 1.12);
|
||||
[[1.7, -0.6], [-1.6, 0.9], [0.4, -1.7], [-1.0, -1.45]].forEach(([x, z], k) => m.box('Pebble_' + k, k % 2 ? 'stoneDark' : 'stone', [x - 0.15, 0, z - 0.12], [x + 0.15, 0.12, z + 0.12], { rot: [0, k * 30, 0], pivot: [x, 0, z] }));
|
||||
m.group('Frame');
|
||||
for (const s of [-1, 1]) {
|
||||
m.box('Post', 'wood', [s * 1.22 - 0.11, 0.9, -0.11], [s * 1.22 + 0.11, 3.35, 0.11]);
|
||||
m.box('PostBrace', 'woodDark', [s * 1.22 - 0.08, 0.95, -0.08], [s * 1.22 + 0.08, 1.4, 0.4], { rot: [-35, 0, 0], pivot: [s * 1.22, 1.0, 0] });
|
||||
}
|
||||
m.box('Beam', 'woodDark', [-1.45, 3.35, -0.12], [1.45, 3.5, 0.12]);
|
||||
// крыша-двускатная
|
||||
for (const s of [-1, 1]) {
|
||||
const o = { rot: [s * 35, 0, 0], pivot: [0, 3.95, 0] };
|
||||
m.box('Roof', 'wood2', [-1.75, 3.95, s > 0 ? 0 : -1.3], [1.75, 4.07, s > 0 ? 1.3 : 0], o);
|
||||
for (let r = 0; r < 3; r++) m.box('Shingle', r % 2 ? 'woodDark' : 'wood', [-1.78, 4.07, s > 0 ? 0.35 + r * 0.33 : -0.6 - r * 0.33], [1.78, 4.13, s > 0 ? 0.6 + r * 0.33 : -0.35 - r * 0.33], o);
|
||||
}
|
||||
m.box('Ridge', 'woodDark', [-1.8, 3.95, -0.1], [1.8, 4.12, 0.1]);
|
||||
for (const s of [-1, 1]) [[3.5, 3.65, 0.72], [3.65, 3.8, 0.48], [3.8, 3.93, 0.24]].forEach(([a, b, w]) => m.box('Gable', 'wood', [s * 1.32 - 0.05, a, -w], [s * 1.32 + 0.05, b, w]));
|
||||
m.group('Crank');
|
||||
m.box('Axle', 'woodDark', [-1.4, 2.48, -0.07], [1.4, 2.62, 0.07]);
|
||||
m.box('RopeCoil', 'rope', [-0.4, 2.44, -0.11], [0.4, 2.66, 0.11]);
|
||||
m.box('CrankArm', 'iron', [1.42, 2.15, -0.04], [1.48, 2.58, 0.04]);
|
||||
m.box('CrankHandle', 'woodDark', [1.48, 2.13, -0.05], [1.78, 2.23, 0.05]);
|
||||
m.box('Rope', 'rope', [-0.02, 1.62, -0.02], [0.02, 2.46, 0.02]);
|
||||
m.group('Bucket');
|
||||
round(m, 'Bucket', 'wood', 0, 0, 1.2, 1.55, 0.2, 'wood2');
|
||||
round(m, 'BucketBand', 'iron', 0, 0, 1.42, 1.48, 0.215);
|
||||
for (const s of [-1, 1]) m.box('Handle', 'iron', [s * 0.17 - 0.015, 1.5, -0.015], [s * 0.17 + 0.015, 1.65, 0.015]);
|
||||
m.box('HandleTop', 'iron', [-0.17, 1.62, -0.015], [0.17, 1.66, 0.015]);
|
||||
}
|
||||
|
||||
// ================= 5) Стог сена и вилы =================
|
||||
{
|
||||
const m = model('decor_haystack');
|
||||
m.group('Hay');
|
||||
// купол: 9 слоёв, каждый — 16-угольник из четырёх квадратов (0°, 22.5°, 45°, 67.5°)
|
||||
const Hh = 2.35, R = 1.4, cols = ['straw2', 'straw', 'strawLight', 'straw'];
|
||||
for (let k = 0; k < 9; k++) {
|
||||
const a = k * Hh / 9, b = a + Hh / 9 + 0.01, t = (a + b) / 2 / Hh, r = R * Math.sqrt(Math.max(0.04, 1 - t * t)) * (k === 0 ? 1.04 : 1), s = r * 0.92;
|
||||
[0, 22.5, 45, 67.5].forEach((ang, q) => m.box(`Layer_${k}_${q}`, cols[(k + q) % 4], [-s, a, -s], [s, b, s], ang ? { rot: [0, ang, 0], pivot: [0, 0, 0] } : {}));
|
||||
}
|
||||
round(m, 'Top', 'strawLight', 0, 0, Hh, Hh + 0.15, 0.3);
|
||||
[[1.2, 0.3, 0.2, 30, 20], [-1.15, 0.6, -0.4, -25, 60], [0.5, 1.2, -0.85, 40, -30], [-0.4, 1.6, 0.6, -35, 10], [0.9, 0.05, -1.3, 0, 70], [-1.4, 0.05, 0.8, 0, 20], [0.2, 2.1, 0.1, 30, 45]].forEach(([x, y, z, rz, ry], k) =>
|
||||
m.box('Straw_' + k, k % 2 ? 'strawLight' : 'straw2', [x - 0.3, y, z - 0.025], [x + 0.3, y + 0.05, z + 0.025], { rot: [0, ry, rz], pivot: [x, y, z] }));
|
||||
m.group('Pitchfork');
|
||||
const o = { rot: [0, 0, 18], pivot: [1.9, 0, -0.7] };
|
||||
m.box('Handle', 'wood', [1.87, 0, -0.73], [1.93, 2.5, -0.67], o);
|
||||
m.box('Ferrule', 'iron', [1.85, 2.5, -0.75], [1.95, 2.62, -0.65], o);
|
||||
m.box('Crossbar', 'iron', [1.68, 2.62, -0.72], [2.12, 2.68, -0.68], o);
|
||||
for (const dx of [-0.2, 0, 0.2]) m.box('Tine', 'iron', [1.9 + dx - 0.02, 2.62, -0.72], [1.9 + dx + 0.02, 3.15, -0.68], o);
|
||||
}
|
||||
|
||||
// ================= 6) Телега с бочками =================
|
||||
{
|
||||
const m = model('decor_cart');
|
||||
m.group('Bed');
|
||||
for (let i = 0; i < 6; i++) m.box('Floor_' + i, i % 2 ? 'wood2' : 'wood', [-0.9, 0.95, -1.3 + i * 0.435], [0.9, 1.1, -1.3 + i * 0.435 + 0.42]);
|
||||
for (const s of [-1, 1]) {
|
||||
for (const [y0, col] of [[1.1, 'wood2'], [1.32, 'wood']]) m.box('Side', col, [s * 0.9 - 0.05, y0, -1.3], [s * 0.9 + 0.05, y0 + 0.2, 1.3]);
|
||||
for (const z of [-1.25, 0, 1.25]) m.box('Stake', 'woodDark', [s * 0.9 - 0.07, 0.95, z - 0.06], [s * 0.9 + 0.07, 1.72, z + 0.06]);
|
||||
}
|
||||
m.box('Back', 'wood2', [-0.9, 1.1, 1.25], [0.9, 1.5, 1.32]);
|
||||
m.box('Front', 'wood2', [-0.9, 1.1, -1.32], [0.9, 1.5, -1.25]);
|
||||
m.box('Axle', 'iron', [-1.2, 0.68, 0.13], [1.2, 0.82, 0.27]);
|
||||
m.box('Bolster', 'woodDark', [-0.85, 0.82, 0.05], [0.85, 0.95, 0.35]);
|
||||
m.box('BolsterF', 'woodDark', [-0.85, 0.82, -1.0], [0.85, 0.95, -0.7]);
|
||||
m.group('Wheels');
|
||||
for (const s of [-1, 1]) {
|
||||
const x = s * 1.07, cy = 0.75, cz = 0.2, R = 0.75, T = Math.tan(Math.PI / 8);
|
||||
for (let k = 0; k < 8; k++) m.box('Rim_' + k, k % 2 ? 'woodDark' : 'wood2', [x - 0.07, cy + R - 0.13, cz - R * T - 0.02], [x + 0.07, cy + R, cz + R * T + 0.02], { rot: [k * 45, 0, 0], pivot: [x, cy, cz] });
|
||||
for (let k = 0; k < 8; k++) m.box('Tyre_' + k, 'iron', [x - 0.075, cy + R - 0.03, cz - R * T - 0.02], [x + 0.075, cy + R + 0.02, cz + R * T + 0.02], { rot: [k * 45 + 22.5, 0, 0], pivot: [x, cy, cz] });
|
||||
for (let k = 0; k < 4; k++) m.box('Spoke_' + k, 'wood', [x - 0.04, cy - R + 0.1, cz - 0.04], [x + 0.04, cy + R - 0.1, cz + 0.04], { rot: [k * 45, 0, 0], pivot: [x, cy, cz] });
|
||||
m.box('Hub', 'woodDark', [x - 0.12, cy - 0.13, cz - 0.13], [x + 0.12, cy + 0.13, cz + 0.13]);
|
||||
m.box('HubCap', 'iron', [x + s * 0.1 - 0.04, cy - 0.07, cz - 0.07], [x + s * 0.1 + 0.04, cy + 0.07, cz + 0.07]);
|
||||
}
|
||||
m.group('Shafts');
|
||||
const o = { rot: [-28, 0, 0], pivot: [0, 1.0, -1.2] };
|
||||
for (const s of [-1, 1]) m.box('Shaft', 'wood', [s * 0.45 - 0.06, 0.94, -2.95], [s * 0.45 + 0.06, 1.06, -1.0], o);
|
||||
m.box('ShaftBar', 'woodDark', [-0.5, 0.94, -2.6], [0.5, 1.06, -2.48], o);
|
||||
m.group('Cargo');
|
||||
barrel(m, 'BarrelA', -0.38, -0.65, 1.1, 1.0, 0.38, 'wood', 'wood2', 'iron', 'woodDark');
|
||||
barrel(m, 'BarrelB', 0.38, -0.55, 1.1, 0.85, 0.34, 'wood2', 'woodDark', 'iron', 'wood');
|
||||
barrel(m, 'BarrelC', 0.0, 0.55, 1.1, 1.05, 0.4, 'wood', 'wood2', 'iron', 'woodDark');
|
||||
m.box('Sack', 'straw2', [0.35, 1.1, 0.75], [0.8, 1.55, 1.2]);
|
||||
m.box('SackTop', 'straw2', [0.47, 1.55, 0.87], [0.68, 1.68, 1.08]);
|
||||
m.box('SackTie', 'rope', [0.45, 1.53, 0.85], [0.7, 1.58, 1.1]);
|
||||
}
|
||||
|
||||
// ================= 7) Сети на шестах и перевёрнутая лодка =================
|
||||
{
|
||||
const m = model('decor_nets');
|
||||
m.group('Poles');
|
||||
for (const x of [-3, 0, 3]) {
|
||||
m.box('Pole', 'woodDark', [x - 0.09, 0, -0.09], [x + 0.09, 3.8, 0.09]);
|
||||
m.box('PoleFoot', 'stoneDark', [x - 0.22, 0, -0.22], [x + 0.22, 0.2, 0.22]);
|
||||
m.box('PoleTop', 'wood', [x - 0.3, 3.55, -0.06], [x + 0.3, 3.65, 0.06]);
|
||||
}
|
||||
m.box('TopRope', 'rope', [-3, 3.42, -0.03], [3, 3.48, 0.03]);
|
||||
m.group('Net');
|
||||
for (const x0 of [-3, 0]) {
|
||||
const pts = [];
|
||||
for (let k = 0; k <= 7; k++) {
|
||||
const x = x0 + 0.2 + k * 0.371, t = (x - x0) / 3, yb = 1.15 - 0.45 * Math.sin(Math.PI * t);
|
||||
pts.push([x, yb]);
|
||||
m.box('NetV', 'rope', [x - 0.025, yb, -0.025], [x + 0.025, 3.45, 0.025]);
|
||||
}
|
||||
for (let y = 3.05; y > 1.2; y -= 0.38) m.box('NetH', 'rope', [x0 + 0.2, y, -0.025], [x0 + 2.8, y + 0.05, 0.025]);
|
||||
for (let k = 0; k < pts.length - 1; k++) seg(m, 'NetBottom', 'rope', pts[k], pts[k + 1], 0.05);
|
||||
pts.forEach(([x, y], k) => { if (k % 2) m.box('Sinker', 'iron', [x - 0.06, y - 0.12, -0.05], [x + 0.06, y, 0.05]); });
|
||||
for (let k = 0; k < 5; k++) { const x = x0 + 0.45 + k * 0.53; m.box('Float', k % 2 ? 'cream' : 'red', [x - 0.09, 3.33, -0.08], [x + 0.09, 3.53, 0.08]); }
|
||||
}
|
||||
fish(m, 'CaughtFish', [1.35, 2.2, -0.05], 0.75, { a: 'x', w: 'y', t: 'z', dir: -1, body: 'roach', belly: 'roachBelly', fin: 'roachFin' });
|
||||
m.group('Basket');
|
||||
round(m, 'Basket', 'straw2', -1.6, -0.9, 0, 0.45, 0.4, 'straw');
|
||||
round(m, 'BasketRim', 'woodDark', -1.6, -0.9, 0.45, 0.52, 0.43);
|
||||
m.box('BasketNet', 'rope', [-1.85, 0.5, -1.1], [-1.3, 0.62, -0.7]);
|
||||
}
|
||||
{
|
||||
const m = model('decor_boat');
|
||||
m.group('Hull');
|
||||
const N = 11, Lh = 2.1;
|
||||
for (let i = 0; i < N; i++) {
|
||||
const z0 = -Lh + i * (2 * Lh / N), z1 = z0 + 2 * Lh / N + 0.01, t = ((z0 + z1) / 2) / Lh;
|
||||
const f = Math.pow(Math.max(0, 1 - t * t), 0.6) * (t < 0 ? 1 - 0.15 * -t : 1);
|
||||
const hw = 0.85 * f + 0.06;
|
||||
m.box(`Strake1_${i}`, 'wood', [-hw, 0.25, z0], [hw, 0.52, z1]);
|
||||
m.box(`Paint_${i}`, 'teal', [-hw - 0.01, 0.52, z0], [hw + 0.01, 0.6, z1]);
|
||||
m.box(`Strake2_${i}`, 'wood2', [-hw * 0.85, 0.6, z0], [hw * 0.85, 0.82, z1]);
|
||||
m.box(`Strake3_${i}`, 'wood', [-hw * 0.55, 0.82, z0], [hw * 0.55, 0.97, z1]);
|
||||
m.box(`Gunwale_${i}`, 'woodDark', [-hw - 0.03, 0.22, z0], [hw + 0.03, 0.3, z1]);
|
||||
}
|
||||
m.box('Keel', 'woodDark', [-0.06, 0.97, -1.95], [0.06, 1.08, 1.85]);
|
||||
m.box('Stem', 'woodDark', [-0.06, 0.3, -2.18], [0.06, 1.05, -2.02]);
|
||||
m.group('Supports');
|
||||
for (const z of [-1.0, 1.0]) m.box('Log', 'wood2', [-1.1, 0, z - 0.14], [1.1, 0.25, z + 0.14]);
|
||||
m.group('Oars');
|
||||
for (const [x, ry] of [[1.45, 12], [1.75, -10]]) {
|
||||
const o = { rot: [0, ry, 0], pivot: [x, 0, 0] };
|
||||
m.box('OarShaft', 'woodLight', [x - 0.04, 0.02, -1.4], [x + 0.04, 0.1, 0.9], o);
|
||||
m.box('OarBlade', 'woodLight', [x - 0.14, 0.02, 0.9], [x + 0.14, 0.07, 1.6], o);
|
||||
m.box('OarGrip', 'woodDark', [x - 0.05, 0.02, -1.55], [x + 0.05, 0.11, -1.4], o);
|
||||
}
|
||||
}
|
||||
|
||||
// ================= 8) Указатель с тремя стрелками =================
|
||||
{
|
||||
const m = model('decor_signpost');
|
||||
m.group('Post');
|
||||
m.box('Post', 'wood', [-0.13, 0, -0.13], [0.13, 4.2, 0.13]);
|
||||
m.box('PostCap', 'woodDark', [-0.19, 4.2, -0.19], [0.19, 4.3, 0.19]);
|
||||
m.box('PostCap2', 'woodDark', [-0.1, 4.3, -0.1], [0.1, 4.42, 0.1]);
|
||||
m.box('Knob', 'brass', [-0.06, 4.42, -0.06], [0.06, 4.52, 0.06]);
|
||||
[[0.4, -0.3], [-0.35, 0.35], [0.1, 0.42], [-0.3, -0.35]].forEach(([x, z], k) => m.box('Stone_' + k, k % 2 ? 'stoneDark' : 'stone', [x - 0.2, 0, z - 0.17], [x + 0.2, 0.18, z + 0.17], { rot: [0, k * 35, 0], pivot: [x, 0, z] }));
|
||||
m.group('Arrows');
|
||||
[[1, 3.55, 0.17, 2.3, 'wood'], [-1, 2.95, 0.17, 2.1, 'woodLight'], [1, 2.35, 0.17, 1.8, 'wood2']].forEach(([dir, y, x0, x1, col], k) => {
|
||||
const lo = Math.min(dir * x0, dir * x1), hi = Math.max(dir * x0, dir * x1), tip = dir * x1;
|
||||
m.box(`Arrow${k + 1}_Face`, col, [lo, y - 0.22, -0.06], [hi, y + 0.22, 0.06]);
|
||||
m.box(`Arrow${k + 1}_Tip`, col, [tip - 0.155, y - 0.155, -0.06], [tip + 0.155, y + 0.155, 0.06], { rot: [0, 0, 45], pivot: [tip, y, 0] });
|
||||
m.box(`Arrow${k + 1}_EdgeT`, 'woodDark', [lo, y + 0.22, -0.07], [hi, y + 0.26, 0.07]);
|
||||
m.box(`Arrow${k + 1}_EdgeB`, 'woodDark', [lo, y - 0.26, -0.07], [hi, y - 0.22, 0.07]);
|
||||
m.box(`Arrow${k + 1}_Nail`, 'iron', [-0.04, y - 0.04, -0.17], [0.04, y + 0.04, -0.13]);
|
||||
});
|
||||
}
|
||||
|
||||
// ================= 9) Гирлянда флажков (8 студов) =================
|
||||
{
|
||||
const m = model('decor_bunting');
|
||||
m.group('Rope');
|
||||
const Y = 1.6, sag = 0.7, yAt = x => Y - sag * (1 - (x / 4) ** 2);
|
||||
for (let k = 0; k < 16; k++) { const x0 = -4 + k * 0.5, x1 = x0 + 0.5; seg(m, 'Rope_' + k, 'rope', [x0, yAt(x0)], [x1, yAt(x1)], 0.05); }
|
||||
for (const s of [-1, 1]) m.box('Ring', 'iron', [s * 4 - 0.07, Y - 0.07, -0.07], [s * 4 + 0.07, Y + 0.07, 0.07]);
|
||||
m.group('Flags');
|
||||
const cols = ['red', 'cream', 'blue', 'yellow', 'leaf'];
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const x = -3.6 + i * 0.8, top = yAt(x) - 0.02, col = cols[i % cols.length];
|
||||
[[0.25, 0.15], [0.18, 0.15], [0.11, 0.14], [0.05, 0.12]].reduce((y, [hw, hh]) => { m.box(`Flag${i}`, col, [x - hw, y - hh, -0.02], [x + hw, y, 0.02]); return y - hh; }, top);
|
||||
m.box(`FlagHem${i}`, 'woodDark', [x - 0.27, top - 0.03, -0.03], [x + 0.27, top + 0.01, 0.03]);
|
||||
}
|
||||
}
|
||||
|
||||
// ================= 10) Ящики и бочки =================
|
||||
{
|
||||
const m = model('decor_crates_barrels');
|
||||
m.group('Crates');
|
||||
crate(m, 'CrateA', -1.5, 0, -0.5, -0.3, 1.1, 0.6, 'wood', 'woodDark');
|
||||
crate(m, 'CrateB', -1.3, 1.1, -0.35, -0.5, 1.8, 0.45, 'wood2', 'woodDark');
|
||||
crate(m, 'CrateC', -0.2, 0, -1.1, 0.8, 0.75, -0.25, 'wood', 'woodDark', true);
|
||||
[[0.05, -0.9], [0.35, -0.85], [0.6, -0.55], [0.2, -0.5], [0.5, -0.95], [-0.02, -0.6]].forEach(([x, z], k) => m.box('Apple_' + k, k % 3 ? 'red' : 'yellow', [x - 0.11, 0.55, z - 0.11], [x + 0.11, 0.75, z + 0.11]));
|
||||
m.group('Barrels');
|
||||
barrel(m, 'Barrel1', 1.25, 0.25, 0, 1.3, 0.52, 'wood', 'wood2', 'iron', 'woodDark');
|
||||
barrel(m, 'Barrel2', 0.35, 0.75, 0, 1.05, 0.42, 'wood2', 'woodDark', 'iron', 'wood');
|
||||
m.box('Sack', 'straw2', [-0.25, 0, 0.0], [0.25, 0.6, 0.45]);
|
||||
m.box('SackTop', 'straw2', [-0.12, 0.6, 0.1], [0.12, 0.72, 0.35]);
|
||||
m.box('SackTie', 'rope', [-0.14, 0.58, 0.08], [0.14, 0.63, 0.37]);
|
||||
}
|
||||
|
||||
// ================= 11) Рыбки для фонтана (хвост — группа Tail) =================
|
||||
// Плывут в −Z, центр в нуле. Шарнир хвоста: z = +0.37·L (L — длина).
|
||||
function pond(name, L, body, belly, fin, extra) {
|
||||
const m = model(name);
|
||||
m.group('Body'); m.group('Tail'); m.cur = 'Body';
|
||||
fish(m, 'Fish', [0, 0, 0], L, { a: 'z', w: 'y', t: 'x', dir: -1, body, belly, fin });
|
||||
for (const c of m.cubes) if (/_Tail[AB]$/.test(c.name)) c.group = 'Tail';
|
||||
m.cur = 'Body';
|
||||
if (extra) extra(m, L);
|
||||
}
|
||||
pond('fish_gold', 1.3, 'goldfish', 'goldfishLight', 'goldfishFin', (m, L) => {
|
||||
m.cur = 'Tail';
|
||||
for (const s of [1, -1]) m.box('Fish_TailVeil', 'goldfishFin', [-0.012, -0.02 * L, 0.5 * L], [0.012, 0.02 * L, 0.78 * L], { rot: [s * 40, 0, 0], pivot: [0, 0, 0.37 * L] });
|
||||
m.cur = 'Body';
|
||||
for (const s of [-1, 1]) m.box('Fish_Pectoral', 'goldfishFin', [s * 0.09 * L - 0.01, -0.1 * L, -0.12 * L], [s * 0.09 * L + 0.01, -0.04 * L, 0.02 * L], { rot: [25, 0, 0], pivot: [0, -0.07 * L, -0.12 * L] });
|
||||
});
|
||||
pond('fish_koi', 1.6, 'koiWhite', 'koiWhite', 'koiFin', (m, L) => {
|
||||
for (const s of [-1, 1]) {
|
||||
m.box('Fish_PatchA', 'koiOrange', [s * 0.081 * L - 0.012, 0.0, -0.32 * L], [s * 0.081 * L + 0.012, 0.13 * L, -0.12 * L]);
|
||||
m.box('Fish_PatchB', 'koiOrange', [s * 0.075 * L - 0.012, -0.02 * L, 0.02 * L], [s * 0.075 * L + 0.012, 0.11 * L, 0.2 * L]);
|
||||
m.box('Fish_Spot', 'black', [s * 0.081 * L - 0.012, 0.05 * L, -0.08 * L], [s * 0.081 * L + 0.012, 0.1 * L, -0.03 * L]);
|
||||
}
|
||||
m.box('Fish_HeadPatch', 'koiOrange', [-0.06 * L, 0.11 * L, -0.4 * L], [0.06 * L, 0.125 * L, -0.26 * L]);
|
||||
});
|
||||
pond('fish_carp', 1.5, 'carp', 'carpBelly', 'carpFin', (m, L) => {
|
||||
m.box('Fish_Back', 'carpBack', [-0.05 * L, 0.13 * L, -0.25 * L], [0.05 * L, 0.165 * L, 0.12 * L]);
|
||||
for (const s of [-1, 1]) m.box('Fish_Barbel', 'carpFin', [s * 0.03 * L - 0.008, -0.05 * L, -0.53 * L], [s * 0.03 * L + 0.008, -0.03 * L, -0.42 * L], { rot: [-25, 0, 0], pivot: [0, -0.04 * L, -0.45 * L] });
|
||||
});
|
||||
pond('fish_roach', 1.2, 'roach', 'roachBelly', 'roachFin', (m, L) => {
|
||||
m.box('Fish_Back', 'roachBack', [-0.05 * L, 0.12 * L, -0.25 * L], [0.05 * L, 0.165 * L, 0.12 * L]);
|
||||
for (const s of [-1, 1]) m.box('Fish_EyeRing', 'roachFin', [s * 0.075 * L - 0.01, 0.015 * L, -0.385 * L], [s * 0.075 * L + 0.01, 0.075 * L, -0.335 * L]);
|
||||
for (const s of [-1, 1]) m.box('Fish_Pelvic', 'roachFin', [s * 0.05 * L - 0.01, -0.2 * L, -0.05 * L], [s * 0.05 * L + 0.01, -0.13 * L, 0.06 * L]);
|
||||
});
|
||||
|
||||
// ---------- запись и общий рендер
|
||||
for (const m of MODELS) m.write(DIR, process.argv[2]);
|
||||
if (process.argv[3]) {
|
||||
const { render } = require('./render');
|
||||
const rows = [
|
||||
['decor_well', 'decor_nets', 'decor_signpost', 'decor_haystack', 'decor_cart'],
|
||||
['decor_boat', 'decor_crates_barrels', 'decor_flowerbed', 'decor_flowerpot', 'decor_bunting'],
|
||||
['decor_chicken', 'decor_chicken_peck', 'decor_cat_sit_ginger', 'decor_cat_sit_gray', 'decor_cat_lie_ginger', 'decor_cat_lie_gray', 'fish_gold', 'fish_koi', 'fish_carp', 'fish_roach'],
|
||||
];
|
||||
const items = []; let z = 0;
|
||||
for (const row of rows) {
|
||||
let x = 0, depth = 0;
|
||||
for (const n of row) {
|
||||
const m = MODELS.find(q => q.name === n);
|
||||
let mn = 1e9, mx = -1e9, zn = 1e9, zx = -1e9;
|
||||
for (const c of m.cubes) { mn = Math.min(mn, c.from[0]); mx = Math.max(mx, c.to[0]); zn = Math.min(zn, c.from[2]); zx = Math.max(zx, c.to[2]); }
|
||||
const lift = n.startsWith('fish_') ? 0.6 : 0;
|
||||
items.push({ model: m, offset: [-(x - mn) - (mx - mn), lift, z - zn] });
|
||||
x += mx - mn + 0.9; depth = Math.max(depth, zx - zn);
|
||||
}
|
||||
z -= depth + 1.2;
|
||||
}
|
||||
// центрировать строки
|
||||
render(items, process.argv[3], { yaw: 25, pitch: 22, width: 1800, height: 1100 });
|
||||
console.log('pack render:', process.argv[3]);
|
||||
}
|
||||
@@ -0,0 +1,420 @@
|
||||
// Здание Гильдии рыбаков: двухэтажный дом. Низ каменный на фундаменте, верх фахверковый с выносом,
|
||||
// крутая черепичная крыша, слуховое окно, наружная каменная труба. Нижний этаж проходимый: зал 24×16.
|
||||
// Лицо в −Z, центр X/Z в нуле, низ на Y=0. node tools/bbshop/guild.js <scratch> [renderPrefix]
|
||||
const path = require('path');
|
||||
const { Model, fish, barrel, crate, lantern } = require('./lib');
|
||||
const m = new Model('lobby_guild_hall');
|
||||
const C = (k, rgb) => m.color(k, rgb);
|
||||
C('stone', [150, 146, 140]); C('stoneLight', [178, 174, 166]); C('stoneDark', [112, 108, 104]); C('stoneDeep', [86, 82, 80]);
|
||||
C('plaster', [232, 222, 198]); C('plasterShade', [214, 202, 176]); C('timber', [74, 48, 32]); C('timber2', [92, 60, 38]);
|
||||
C('wood', [150, 98, 58]); C('wood2', [128, 82, 48]); C('woodLight', [184, 136, 88]); C('floor', [124, 86, 54]); C('floor2', [108, 74, 46]);
|
||||
C('roof', [64, 70, 84]); C('roof2', [54, 58, 72]); C('roof3', [76, 82, 96]); C('iron', [56, 56, 62]); C('brass', [204, 158, 66]); C('gold', [228, 184, 74]);
|
||||
C('glow', [255, 206, 120]); C('fire', [255, 140, 50]); C('fireCore', [255, 220, 120]); C('blue', [44, 82, 150]); C('blueDark', [30, 56, 108]); C('cream', [238, 226, 196]);
|
||||
C('shutter', [66, 92, 118]); C('signFace', [44, 30, 26]); C('rug', [140, 46, 42]); C('rugBorder', [214, 168, 80]); C('leaf', [76, 140, 62]); C('leaf2', [56, 110, 48]);
|
||||
C('red', [204, 64, 60]); C('yellow', [242, 202, 76]); C('purple', [172, 108, 210]); C('white', [244, 240, 230]); C('rope', [196, 168, 116]); C('book1', [130, 40, 40]); C('book2', [40, 90, 70]);
|
||||
C('fishSilver', [168, 184, 196]); C('fishBelly', [228, 232, 222]); C('fishFin', [118, 138, 150]); C('fishEye', [24, 24, 30]); C('candle', [240, 232, 210]);
|
||||
|
||||
const box = (...a) => m.box(...a);
|
||||
const G = name => m.group(name);
|
||||
// ---------- размеры
|
||||
const GX = 13, GZ = 9, T = 1.0, F0 = 1.0, F1 = 9.0; // нижний этаж: наружные ±13 × ±9, пол 1.0, верх 9.0
|
||||
const UX = 13.8, UZ = 9.8, U0 = 9.6, U1 = 16.3; // верхний этаж с выносом
|
||||
const RIDGE = 24.5, SLOPE = (RIDGE - U1) / UZ, ANG = Math.atan(SLOPE) * 180 / Math.PI; // крыша
|
||||
const DOOR = 2.2, DOORH = 4.6; // проём: прямоугольник до 4.6 + полукруг r 2.2
|
||||
|
||||
// грань стены: n — ось нормали, s — знак наружу, p — плоскость, u — ось вдоль стены
|
||||
const FACE = {
|
||||
gf: { n: 2, s: -1, p: -GZ, u: 0 }, gb: { n: 2, s: 1, p: GZ, u: 0 }, gl: { n: 0, s: -1, p: -GX, u: 2 }, gr: { n: 0, s: 1, p: GX, u: 2 },
|
||||
uf: { n: 2, s: -1, p: -UZ, u: 0 }, ub: { n: 2, s: 1, p: UZ, u: 0 }, ul: { n: 0, s: -1, p: -UX, u: 2 }, ur: { n: 0, s: 1, p: UX, u: 2 },
|
||||
};
|
||||
function fb(name, col, f, u0, u1, y0, y1, d0, d1, o = {}) {
|
||||
const lo = [0, 0, 0], hi = [0, 0, 0];
|
||||
lo[f.u] = Math.min(u0, u1); hi[f.u] = Math.max(u0, u1); lo[1] = y0; hi[1] = y1;
|
||||
const a = f.p + f.s * d0, b = f.p + f.s * d1; lo[f.n] = Math.min(a, b); hi[f.n] = Math.max(a, b);
|
||||
return box(name, col, lo, hi, o);
|
||||
}
|
||||
// диагональ на грани (из (u0,y0) в (u1,y1)), толщина t, вынос d
|
||||
function brace(name, col, f, u0, y0, u1, y1, t, d0, d1) {
|
||||
const cu = (u0 + u1) / 2, cy = (y0 + y1) / 2, len = Math.hypot(u1 - u0, y1 - y0);
|
||||
const cn = f.p + f.s * (d0 + d1) / 2, hn = Math.abs(d1 - d0) / 2;
|
||||
if (f.u === 0) { const ang = Math.atan2(y1 - y0, u1 - u0) * 180 / Math.PI; box(name, col, [cu - len / 2, cy - t / 2, cn - hn], [cu + len / 2, cy + t / 2, cn + hn], { rot: [0, 0, ang], pivot: [cu, cy, cn] }); }
|
||||
else { const ang = Math.atan2(-(y1 - y0), u1 - u0) * 180 / Math.PI; box(name, col, [cn - hn, cy - t / 2, cu - len / 2], [cn + hn, cy + t / 2, cu + len / 2], { rot: [ang, 0, 0], pivot: [cn, cy, cu] }); }
|
||||
}
|
||||
// окно: стекло-свечение (WindowGlow), рама, переплёт, подоконник, перемычка, ставни, ящик с цветами
|
||||
function windowAt(f, uc, yc, w, h, o = {}) {
|
||||
const u0 = uc - w / 2, u1 = uc + w / 2, y0 = yc - h / 2, y1 = yc + h / 2, fr = o.frame || 'timber';
|
||||
fb('Window_Glow', 'glow', f, u0, u1, y0, y1, 0, 0.04, { group: 'WindowGlow' });
|
||||
if (o.inner) fb('Window_GlowIn', 'glow', f, u0, u1, y0, y1, -o.inner - 0.04, -o.inner, { group: 'WindowGlow' });
|
||||
fb('WinFrameT', fr, f, u0 - 0.15, u1 + 0.15, y1, y1 + 0.18, 0, 0.16); fb('WinFrameB', fr, f, u0 - 0.15, u1 + 0.15, y0 - 0.18, y0, 0, 0.16);
|
||||
fb('WinFrameL', fr, f, u0 - 0.15, u0, y0, y1, 0, 0.16); fb('WinFrameR', fr, f, u1, u1 + 0.15, y0, y1, 0, 0.16);
|
||||
fb('WinMullionV', fr, f, uc - 0.05, uc + 0.05, y0, y1, 0, 0.1); fb('WinMullionH', fr, f, u0, u1, yc + h * 0.12 - 0.05, yc + h * 0.12 + 0.05, 0, 0.1);
|
||||
for (const q of [0.25, 0.75]) fb('WinCame', fr, f, u0 + w * q - 0.025, u0 + w * q + 0.025, y0, y1, 0, 0.07);
|
||||
fb('WinSill', o.sill || 'stoneLight', f, u0 - 0.3, u1 + 0.3, y0 - 0.35, y0 - 0.15, 0, 0.32);
|
||||
fb('WinLintel', o.lintel || 'stoneLight', f, u0 - 0.35, u1 + 0.35, y1 + 0.18, y1 + 0.5, 0, 0.18);
|
||||
if (o.shutters) for (const sgn of [-1, 1]) {
|
||||
const a = sgn < 0 ? u0 - 0.15 - w * 0.5 : u1 + 0.15, b = a + w * 0.5;
|
||||
fb('Shutter', 'shutter', f, a, b, y0, y1, 0, 0.1);
|
||||
for (const yy of [y0 + 0.3, y1 - 0.4]) fb('ShutterStrap', 'iron', f, a + 0.05, b - 0.05, yy, yy + 0.1, 0.1, 0.13);
|
||||
}
|
||||
if (o.flowers) {
|
||||
const by = y0 - 0.35;
|
||||
fb('FlowerBox', 'wood2', f, u0 - 0.15, u1 + 0.15, by - 0.45, by, 0.05, 0.6);
|
||||
fb('FlowerBoxRim', 'timber', f, u0 - 0.2, u1 + 0.2, by - 0.05, by + 0.03, 0.02, 0.64);
|
||||
const n = Math.max(3, Math.round(w / 0.45));
|
||||
for (let i = 0; i < n; i++) {
|
||||
const uu = u0 + (i + 0.5) * w / n;
|
||||
fb('FlowerLeaves', i % 2 ? 'leaf' : 'leaf2', f, uu - 0.22, uu + 0.22, by, by + 0.3 + (i % 2) * 0.08, 0.15, 0.5);
|
||||
fb('Flower', ['red', 'yellow', 'purple', 'white'][i % 4], f, uu - 0.1, uu + 0.1, by + 0.32 + (i % 3) * 0.06, by + 0.48 + (i % 3) * 0.06, 0.24, 0.42);
|
||||
}
|
||||
}
|
||||
}
|
||||
// якорь с рыбой (плоско, в плоскости XY, лицом в −Z на глубине z)
|
||||
function anchor(nm, cx, cy, z, s, col, fishCols) {
|
||||
const zt = [z - 0.04, z + 0.04];
|
||||
box(nm + '_Shank', col, [cx - 0.07 * s, cy - 0.85 * s, zt[0]], [cx + 0.07 * s, cy + 0.75 * s, zt[1]]);
|
||||
box(nm + '_Stock', col, [cx - 0.5 * s, cy + 0.52 * s, zt[0]], [cx + 0.5 * s, cy + 0.64 * s, zt[1]]);
|
||||
box(nm + '_RingT', col, [cx - 0.17 * s, cy + 0.94 * s, zt[0]], [cx + 0.17 * s, cy + 1.02 * s, zt[1]]);
|
||||
for (const sg of [-1, 1]) box(nm + '_RingS', col, [cx + sg * 0.17 * s - 0.04 * s, cy + 0.75 * s, zt[0]], [cx + sg * 0.17 * s + 0.04 * s, cy + 1.02 * s, zt[1]]);
|
||||
for (const sg of [-1, 1]) {
|
||||
const px = cx, py = cy - 0.8 * s;
|
||||
box(nm + '_Arm', col, [px, py - 0.06 * s, zt[0]], [px + sg * 0.62 * s, py + 0.06 * s, zt[1]], { rot: [0, 0, sg * 38], pivot: [px, py, z] });
|
||||
const ex = px + sg * 0.62 * s * Math.cos(38 * Math.PI / 180), ey = py + 0.62 * s * Math.sin(38 * Math.PI / 180);
|
||||
box(nm + '_Fluke', col, [ex - 0.13 * s, ey - 0.13 * s, zt[0]], [ex + 0.13 * s, ey + 0.13 * s, zt[1]], { rot: [0, 0, 45], pivot: [ex, ey, z] });
|
||||
}
|
||||
box(nm + '_Crown', col, [cx - 0.12 * s, cy - 0.95 * s, zt[0]], [cx + 0.12 * s, cy - 0.78 * s, zt[1]]);
|
||||
if (fishCols) fish(m, nm + 'Fish', [cx, cy - 0.05 * s, z - 0.06], 1.5 * s, { a: 'x', w: 'y', t: 'z', dir: -1, ...fishCols });
|
||||
}
|
||||
|
||||
// ================= Фундамент и пол =================
|
||||
G('Foundation');
|
||||
box('Slab', 'stoneDeep', [-GX - 0.4, 0, -GZ - 0.4], [GX + 0.4, 0.85, GZ + 0.4]);
|
||||
{ // крупные камни по периметру
|
||||
let k = 0;
|
||||
for (const f of [FACE.gf, FACE.gb, FACE.gl, FACE.gr]) {
|
||||
const len = f.u === 0 ? GX + 0.4 : GZ + 0.4;
|
||||
for (let u = -len; u < len - 0.01; k++) {
|
||||
const w = [1.6, 2.2, 1.3, 1.9, 2.5][k % 5], u1 = Math.min(len, u + w);
|
||||
fb('FoundStone', k % 2 ? 'stoneDark' : 'stone', f, u, u1 - 0.06, 0.05, 0.95, 0.38, 0.55);
|
||||
u = u1;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < 8; i++) { const z = -GZ + T + i * 2.0; box('FloorPlank_' + i, i % 2 ? 'floor2' : 'floor', [-GX + T, 0.85, z], [GX - T, F0, z + 1.98]); }
|
||||
|
||||
// ================= Каменный нижний этаж =================
|
||||
G('StoneFloor');
|
||||
// задняя и боковые стены
|
||||
box('Wall_Back', 'stone', [-GX, F0, GZ - T], [GX, F1, GZ]);
|
||||
box('Wall_Left', 'stone', [-GX, F0, -GZ], [-GX + T, F1, GZ]);
|
||||
box('Wall_Right', 'stone', [GX - T, F0, -GZ], [GX, F1, GZ]);
|
||||
// фасад с арочным проёмом
|
||||
box('Wall_FrontL', 'stone', [-GX, F0, -GZ], [-DOOR, F1, -GZ + T]);
|
||||
box('Wall_FrontR', 'stone', [DOOR, F0, -GZ], [GX, F1, -GZ + T]);
|
||||
box('Wall_OverDoor', 'stone', [-DOOR, F0 + DOORH + DOOR, -GZ], [DOOR, F1, -GZ + T]);
|
||||
for (let y = F0 + DOORH; y < F0 + DOORH + DOOR - 0.01; y += 0.25) {
|
||||
const dy = Math.min(DOOR, y + 0.25 - (F0 + DOORH)), x = Math.sqrt(Math.max(0, DOOR * DOOR - dy * dy));
|
||||
for (const s of [-1, 1]) box('Spandrel', 'stone', [s < 0 ? -DOOR : x, y, -GZ], [s < 0 ? -x : DOOR, y + 0.26, -GZ + T]);
|
||||
}
|
||||
// кладка: тёмные швы-пояса, угловые камни
|
||||
for (const f of [FACE.gf, FACE.gb, FACE.gl, FACE.gr]) {
|
||||
const len = f.u === 0 ? GX : GZ;
|
||||
for (const y of [2.6, 4.4, 6.2, 8.0]) {
|
||||
if (f === FACE.gf) { fb('Course', 'stoneDark', f, -len, -DOOR - 0.9, y, y + 0.1, 0, 0.03); fb('Course', 'stoneDark', f, DOOR + 0.9, len, y, y + 0.1, 0, 0.03); }
|
||||
else fb('Course', 'stoneDark', f, -len, len, y, y + 0.1, 0, 0.03);
|
||||
}
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const y0 = F0 + i * 1.14, wq = i % 2 ? 0.7 : 1.2;
|
||||
for (const e of [-1, 1]) fb('Quoin', 'stoneLight', f, e < 0 ? -len : len - wq, e < 0 ? -len + wq : len, y0 + 0.04, y0 + 1.1, 0, 0.08);
|
||||
}
|
||||
}
|
||||
// арка двери: клинчатые камни, косяки
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const ang = (i + 0.5) * 20, col = i === 4 ? 'stoneLight' : i % 2 ? 'stone' : 'stoneLight';
|
||||
box('ArchStone_' + i, col, [DOOR, F0 + DOORH - 0.38, -GZ - 0.18], [DOOR + 0.85 + (i === 4 ? 0.3 : 0), F0 + DOORH + 0.38, -GZ + 0.05], { rot: [0, 0, ang], pivot: [0, F0 + DOORH, -GZ] });
|
||||
}
|
||||
for (let i = 0; i < 4; i++) for (const s of [-1, 1]) {
|
||||
const y0 = F0 + i * 1.15, w = i % 2 ? 0.55 : 0.85;
|
||||
box('Jamb', i % 2 ? 'stone' : 'stoneLight', [s < 0 ? -DOOR - w : DOOR, y0 + 0.03, -GZ - 0.18], [s < 0 ? -DOOR : DOOR + w, y0 + 1.12, -GZ + 0.05]);
|
||||
}
|
||||
|
||||
// ================= Двери: двустворчатые, открыты внутрь (тонкие — без коллизии) =================
|
||||
G('Door');
|
||||
for (const s of [-1, 1]) {
|
||||
const hx = s * DOOR, ang = s < 0 ? -72 : 72, o = { rot: [0, ang, 0], pivot: [hx, 0, -GZ + 0.3] };
|
||||
const x0 = Math.min(hx, hx - s * DOOR), x1 = Math.max(hx, hx - s * DOOR);
|
||||
for (let k = 0; k < 4; k++) { const a = x0 + k * DOOR / 4; box('DoorPlank', k % 2 ? 'wood2' : 'wood', [a + 0.01, F0, -GZ + 0.18], [a + DOOR / 4 - 0.01, F0 + DOORH + 0.9, -GZ + 0.42], o); }
|
||||
for (const y of [F0 + 0.8, F0 + 2.6, F0 + 4.4]) box('DoorStrap', 'iron', [x0 + 0.05, y, -GZ + 0.14], [x1 - 0.05, y + 0.18, -GZ + 0.18], o);
|
||||
box('DoorFrameEdge', 'iron', [s < 0 ? x1 - 0.12 : x0, F0, -GZ + 0.14], [s < 0 ? x1 : x0 + 0.12, F0 + DOORH + 0.9, -GZ + 0.18], o);
|
||||
box('DoorCarve', 'timber', [x0 + 0.45, F0 + 1.3, -GZ + 0.15], [x1 - 0.45, F0 + 2.3, -GZ + 0.18], o);
|
||||
box('DoorRing', 'brass', [s < 0 ? x1 - 0.45 : x0 + 0.25, F0 + 2.4, -GZ + 0.1], [s < 0 ? x1 - 0.25 : x0 + 0.45, F0 + 2.75, -GZ + 0.15], o);
|
||||
}
|
||||
|
||||
// ================= Крыльцо =================
|
||||
G('Porch');
|
||||
box('Step1', 'stone', [-3.6, 0, -GZ - 2.3], [3.6, 0.35, -GZ - 0.3]);
|
||||
box('Step2', 'stoneLight', [-3.3, 0.35, -GZ - 1.6], [3.3, 0.68, -GZ - 0.3]);
|
||||
box('Landing', 'stone', [-3.0, 0.68, -GZ - 0.9], [3.0, F0, -GZ + T]);
|
||||
for (const s of [-1, 1]) box('StepCheek', 'stoneDark', [s * 3.6 - (s < 0 ? 0 : 0.35), 0, -GZ - 2.3], [s * 3.6 + (s < 0 ? 0.35 : 0), 0.85, -GZ - 0.3]);
|
||||
|
||||
|
||||
// ================= Перекрытие с выносом и фахверковый второй этаж =================
|
||||
G('Jetty');
|
||||
box('FloorBand', 'timber', [-UX - 0.1, F1, -UZ - 0.1], [UX + 0.1, U0, UZ + 0.1]);
|
||||
for (let x = -12.6; x <= 12.7; x += 1.4) {
|
||||
box('JoistF', 'timber2', [x - 0.2, F1 - 0.4, -UZ], [x + 0.2, F1, -GZ]);
|
||||
box('JoistB', 'timber2', [x - 0.2, F1 - 0.4, GZ], [x + 0.2, F1, UZ]);
|
||||
}
|
||||
for (let z = -8.4; z <= 8.5; z += 1.4) for (const s of [-1, 1]) box('JoistS', 'timber2', [s < 0 ? -UX : GX, F1 - 0.4, z - 0.2], [s < 0 ? -GX : UX, F1, z + 0.2]);
|
||||
G('UpperFloor');
|
||||
box('UpperWall', 'plaster', [-UX, U0, -UZ], [UX, U1, UZ]);
|
||||
G('Timber');
|
||||
const UWIN = { uf: [[-11.6, 1.8], [-7.6, 1.8], [7.6, 1.8], [11.6, 1.8], [0, 2.4]], ub: [[-9, 1.8], [-3, 1.8], [3, 1.8], [9, 1.8]], ul: [[-5, 1.8], [4.5, 1.8]], ur: [[-5, 1.8], [6, 1.8]] };
|
||||
const STUDS = { uf: [-13.7, -9.6, -5.4, -2.2, 2.2, 5.4, 9.6, 13.7], ub: [-13.7, -6, 0, 6, 13.7], ul: [-9.7, -2, 1.8, 9.7], ur: [-9.7, -2, 3.5, 9.7] };
|
||||
for (const key of ['uf', 'ub', 'ul', 'ur']) {
|
||||
const f = FACE[key], len = f.u === 0 ? UX : UZ;
|
||||
fb('Sill', 'timber', f, -len, len, U0, U0 + 0.4, 0, 0.12);
|
||||
fb('TopPlate', 'timber', f, -len, len, U1 - 0.45, U1, 0, 0.12);
|
||||
for (const u of STUDS[key]) fb('Stud', 'timber', f, u - 0.17, u + 0.17, U0 + 0.4, U1 - 0.45, 0, 0.12);
|
||||
// средний ригель между стойками, кроме проёмов окон
|
||||
const st = STUDS[key];
|
||||
for (let i = 0; i < st.length - 1; i++) {
|
||||
const a = st[i] + 0.17, b = st[i + 1] - 0.17;
|
||||
const hasWin = UWIN[key].some(([c, w]) => c + w / 2 > a && c - w / 2 < b);
|
||||
if (!hasWin) {
|
||||
fb('Rail', 'timber', f, a, b, 12.75, 13.05, 0, 0.1);
|
||||
// косые подкосы в глухих панелях
|
||||
brace('Brace', 'timber', f, a + 0.1, U0 + 0.4, b - 0.1, 12.75, 0.28, 0, 0.1);
|
||||
brace('Brace', 'timber', f, a + 0.1, U1 - 0.45, b - 0.1, 13.05, 0.28, 0, 0.1);
|
||||
}
|
||||
}
|
||||
for (const [c, w] of UWIN[key]) if (!(key === 'uf' && c === 0)) windowAt(f, c, 13.2, w, 2.2, { frame: 'timber', sill: 'timber2', lintel: 'timber', flowers: key === 'uf' });
|
||||
}
|
||||
// дверь на балкон
|
||||
fb('BalconyDoor', 'wood2', FACE.uf, -1.1, 1.1, U0 + 0.35, 12.9, 0, 0.08);
|
||||
fb('BalconyDoorMid', 'timber', FACE.uf, -0.05, 0.05, U0 + 0.35, 12.9, 0.08, 0.12);
|
||||
fb('BalconyDoorGlow', 'glow', FACE.uf, -0.8, 0.8, 11.6, 12.6, 0.08, 0.1, { group: 'WindowGlow' });
|
||||
fb('BalconyDoorTop', 'timber', FACE.uf, -1.3, 1.3, 12.9, 13.2, 0, 0.14);
|
||||
|
||||
// ================= Балкон =================
|
||||
G('Balcony');
|
||||
const BZ = -UZ - 2.0;
|
||||
box('BalconyFloor', 'wood', [-4.5, U0, BZ], [4.5, U0 + 0.3, -UZ]);
|
||||
box('BalconyEdge', 'timber', [-4.6, U0 - 0.2, BZ - 0.1], [4.6, U0 + 0.05, BZ + 0.15]);
|
||||
for (const x of [-4.0, 4.0]) {
|
||||
const a = [F1 - 1.6, -GZ], b = [U0, BZ + 0.3], cy = (a[0] + b[0]) / 2, cz = (a[1] + b[1]) / 2, len = Math.hypot(b[0] - a[0], b[1] - a[1]);
|
||||
box('BalconyBracket', 'timber', [x - 0.15, cy - 0.15, cz - len / 2], [x + 0.15, cy + 0.15, cz + len / 2], { rot: [Math.atan2(-(b[0] - a[0]), b[1] - a[1]) * 180 / Math.PI, 0, 0], pivot: [x, cy, cz] });
|
||||
}
|
||||
for (let x = -4.4; x <= 4.41; x += 0.88) if (false) box('Baluster', 'woodLight', [x - 0.07, U0 + 0.3, BZ + 0.05], [x + 0.07, U0 + 1.35, BZ + 0.19]);
|
||||
for (let z = BZ + 0.6; z < -UZ; z += 0.6) for (const s of [-1, 1]) box('BalusterSide', 'woodLight', [s * 4.4 - 0.07, U0 + 0.3, z - 0.07], [s * 4.4 + 0.07, U0 + 1.35, z + 0.07]);
|
||||
box('RailFront', 'timber', [-4.55, U0 + 1.35, BZ], [4.55, U0 + 1.55, BZ + 0.25]);
|
||||
for (const s of [-1, 1]) box('RailSide', 'timber', [s * 4.45 - 0.1, U0 + 1.35, BZ], [s * 4.45 + 0.1, U0 + 1.55, -UZ]);
|
||||
for (const s of [-1, 1]) box('RailPost', 'timber', [s * 4.45 - 0.15, U0, BZ - 0.02], [s * 4.45 + 0.15, U0 + 1.75, BZ + 0.28]);
|
||||
// ================= Вывеска над дверью — передняя стенка балкона (пустая; SurfaceGui на Sign_Face) =================
|
||||
G('Sign');
|
||||
box('Sign_Back', 'timber', [-4.45, U0 + 0.3, BZ + 0.02], [4.45, U0 + 1.35, BZ + 0.2]);
|
||||
box('Sign_Face', 'signFace', [-4.1, U0 + 0.38, BZ - 0.1], [4.1, U0 + 1.27, BZ + 0.02]);
|
||||
for (const [a, b, c0, d0] of [[-4.45, 4.45, U0 + 1.27, U0 + 1.35], [-4.45, 4.45, U0 + 0.3, U0 + 0.38], [-4.45, -4.1, U0 + 0.38, U0 + 1.27], [4.1, 4.45, U0 + 0.38, U0 + 1.27]]) box('SignTrim', 'brass', [a, c0, BZ - 0.14], [b, d0, BZ + 0.02]);
|
||||
// герб над балконной дверью: синий щит с якорем и рыбой
|
||||
G('Crest');
|
||||
const CRZ = -UZ - 0.14;
|
||||
box('CrestBoard', 'blue', [-1.1, 13.4, CRZ - 0.12], [1.1, 15.0, CRZ]);
|
||||
box('CrestBoardTip', 'blue', [-0.7, 13.2, CRZ - 0.12], [0.7, 13.4, CRZ]);
|
||||
for (const [a, b, c0, d0] of [[-1.2, 1.2, 15.0, 15.14], [-1.2, -1.1, 13.3, 15.0], [1.1, 1.2, 13.3, 15.0]]) box('CrestTrim', 'gold', [a, c0, CRZ - 0.15], [b, d0, CRZ]);
|
||||
anchor('CrestAnchor', 0, 14.2, CRZ - 0.2, 0.68, 'gold', { body: 'fishSilver', belly: 'fishBelly', fin: 'fishFin' });
|
||||
|
||||
// ================= Знамёна гильдии под выносом =================
|
||||
G('Banners');
|
||||
for (const s of [-1, 1]) {
|
||||
const x = s * 9.8, z = -GZ - 0.5;
|
||||
box('BannerRod', 'iron', [x - 0.85, F1 - 0.55, z - 0.05], [x + 0.85, F1 - 0.45, z + 0.05]);
|
||||
for (const e of [-1, 1]) box('BannerRope', 'rope', [x + e * 0.75 - 0.02, F1 - 0.45, z - 0.02], [x + e * 0.75 + 0.02, F1, z + 0.02]);
|
||||
box('BannerCloth', 'blue', [x - 0.7, 5.0, z - 0.03], [x + 0.7, F1 - 0.5, z + 0.03]);
|
||||
box('BannerTailL', 'blue', [x - 0.7, 4.3, z - 0.03], [x - 0.08, 5.0, z + 0.03]);
|
||||
box('BannerTailR', 'blue', [x + 0.08, 4.3, z - 0.03], [x + 0.7, 5.0, z + 0.03]);
|
||||
for (const e of [-1, 1]) box('BannerBorder', 'cream', [x + e * 0.62 - 0.06, 4.3, z - 0.05], [x + e * 0.62 + 0.06, F1 - 0.5, z - 0.03]);
|
||||
box('BannerBorderT', 'cream', [x - 0.7, F1 - 0.75, z - 0.05], [x + 0.7, F1 - 0.62, z - 0.03]);
|
||||
anchor('BannerAnchor', x, 6.6, z - 0.08, 0.7, 'cream');
|
||||
}
|
||||
|
||||
// ================= Окна нижнего этажа =================
|
||||
G('Windows');
|
||||
for (const u of [-11.4, -7.8, 7.8, 11.4]) windowAt(FACE.gf, u, 4.6, 1.9, 2.6, { inner: T, flowers: true });
|
||||
for (const u of [-8, -2.5, 2.5, 8]) windowAt(FACE.gb, u, 4.6, 1.9, 2.6, { inner: T });
|
||||
for (const u of [-5, 5]) windowAt(FACE.gl, u, 4.6, 1.9, 2.6, { inner: T, shutters: true, flowers: true });
|
||||
windowAt(FACE.gr, -5, 4.6, 1.9, 2.6, { inner: T, shutters: true, flowers: true });
|
||||
windowAt(FACE.gr, 6.2, 4.6, 1.9, 2.6, { inner: T });
|
||||
|
||||
// ================= Крыша =================
|
||||
G('Roof');
|
||||
const LS = Math.hypot(UZ + 1.4, (UZ + 1.4) * SLOPE); // длина ската с карнизом
|
||||
for (const s of [-1, 1]) {
|
||||
const o = { rot: [s * ANG, 0, 0], pivot: [0, RIDGE, 0] };
|
||||
box('RoofDeck', 'timber', [-UX - 1.3, RIDGE - 0.35, s < 0 ? -LS : 0], [UX + 1.3, RIDGE, s < 0 ? 0 : LS], o);
|
||||
for (let k = 0; k < Math.ceil(LS / 0.9); k++) {
|
||||
const a = k * 0.9, b = Math.min(LS, a + 0.95), col = ['roof', 'roof2', 'roof3'][k % 3];
|
||||
box('Shingles', col, [-UX - 1.35, RIDGE + 0.02 - k * 0.0, s < 0 ? -b : a], [UX + 1.35, RIDGE + 0.2, s < 0 ? -a : b], o);
|
||||
for (let x = -UX - 1.0 + (k % 2) * 0.9; x < UX + 1.0; x += 1.8) box('ShingleGap', 'roof2', [x, RIDGE + 0.2, s < 0 ? -b + 0.1 : a + 0.1], [x + 0.08, RIDGE + 0.23, s < 0 ? -a : b - 0.1], o);
|
||||
}
|
||||
for (const e of [-1, 1]) box('BargeBoard', 'timber', [e * (UX + 1.35) - 0.12, RIDGE - 0.55, s < 0 ? -LS : 0], [e * (UX + 1.35) + 0.12, RIDGE + 0.25, s < 0 ? 0 : LS], o);
|
||||
box('Fascia', 'timber', [-UX - 1.35, RIDGE - 0.6, s < 0 ? -LS : LS - 0.15], [UX + 1.35, RIDGE + 0.2, s < 0 ? -LS + 0.15 : LS], o);
|
||||
}
|
||||
box('RidgeCap', 'roof2', [-UX - 1.4, RIDGE - 0.1, -0.35], [UX + 1.4, RIDGE + 0.45, 0.35]);
|
||||
for (const e of [-1, 1]) box('RidgeFinial', 'timber', [e * (UX + 1.35) - 0.15, RIDGE + 0.2, -0.15], [e * (UX + 1.35) + 0.15, RIDGE + 1.0, 0.15]);
|
||||
// фронтоны (боковые треугольники)
|
||||
G('Gables');
|
||||
for (const e of [-1, 1]) {
|
||||
for (let y = U1; y < RIDGE - 0.2; y += 0.5) {
|
||||
const zw = (RIDGE - (y + 0.5)) / SLOPE;
|
||||
box('Gable', 'plaster', [e < 0 ? -UX : UX - 0.5, y, -zw], [e < 0 ? -UX + 0.5 : UX, y + 0.51, zw]);
|
||||
}
|
||||
const f = e < 0 ? FACE.ul : FACE.ur, xo = e < 0 ? -UX : UX;
|
||||
fb('GableKing', 'timber', f, -0.18, 0.18, U1, RIDGE - 0.3, 0, 0.12);
|
||||
fb('GableCollar', 'timber', f, -(RIDGE - 19.6) / SLOPE, (RIDGE - 19.6) / SLOPE, 19.3, 19.6, 0, 0.12);
|
||||
brace('GableBrace', 'timber', f, -5.5, U1 + 0.1, -0.2, 19.3, 0.28, 0, 0.12);
|
||||
brace('GableBrace', 'timber', f, 5.5, U1 + 0.1, 0.2, 19.3, 0.28, 0, 0.12);
|
||||
windowAt(f, -2.2, 17.8, 1.2, 1.6, { frame: 'timber', sill: 'timber2', lintel: 'timber' });
|
||||
windowAt(f, 2.2, 17.8, 1.2, 1.6, { frame: 'timber', sill: 'timber2', lintel: 'timber' });
|
||||
}
|
||||
// слуховое окно на переднем скате
|
||||
G('Dormer');
|
||||
const DZ0 = -8.0, DZ1 = -2.0, DW = 2.3, DY1 = 19.6, DR = 21.6;
|
||||
box('DormerWall', 'plaster', [-DW, U1 - 0.3, DZ0], [DW, DY1, DZ1]);
|
||||
for (let y = DY1; y < DR - 0.2; y += 0.4) { const xw = (DR - (y + 0.4)) / Math.tan(40 * Math.PI / 180); box('DormerGable', 'plaster', [-xw, y, DZ0], [xw, y + 0.41, DZ1]); }
|
||||
const DF = { n: 2, s: -1, p: DZ0, u: 0 };
|
||||
windowAt(DF, 0, 18.1, 1.6, 1.9, { frame: 'timber', sill: 'timber2', lintel: 'timber', flowers: true });
|
||||
for (const s of [-1, 1]) {
|
||||
fb('DormerPost', 'timber', DF, s * DW - 0.15, s * DW + 0.15, U1 - 0.3, DY1, 0, 0.12);
|
||||
const o = { rot: [0, 0, s * -40], pivot: [0, DR, 0] };
|
||||
box('DormerRoof', 'roof', [s < 0 ? -3.5 : 0, DR - 0.3, DZ0 - 0.5], [s < 0 ? 0 : 3.5, DR, DZ1 + 0.5], o);
|
||||
for (let k = 0; k < 4; k++) box('DormerShingle', ['roof2', 'roof3'][k % 2], [s < 0 ? -0.9 * (k + 1) : 0.9 * k, DR, DZ0 - 0.55], [s < 0 ? -0.9 * k : 0.9 * (k + 1), DR + 0.15, DZ1 + 0.5], o);
|
||||
}
|
||||
box('DormerRidge', 'roof2', [-0.25, DR - 0.1, DZ0 - 0.55], [0.25, DR + 0.25, DZ1 + 0.5]);
|
||||
|
||||
// ================= Каменная труба (на правом фронтоне) =================
|
||||
G('Chimney');
|
||||
box('ChimneyBase', 'stone', [GX, 0, 0.6], [UX + 1.9, F1, 3.8]);
|
||||
box('ChimneyShaft', 'stone', [UX, F1, 1.0], [UX + 1.6, 26.0, 3.4]);
|
||||
for (let y = 1.0; y < 26; y += 1.2) box('ChimneyCourse', y % 2.4 < 1.2 ? 'stoneDark' : 'stoneLight', [UX - 0.02 + (y < F1 ? -0.2 : 0), y, (y < F1 ? 0.58 : 0.98)], [UX + (y < F1 ? 1.92 : 1.62), y + 0.12, (y < F1 ? 3.82 : 3.42)]);
|
||||
box('ChimneyCap', 'stoneDark', [UX - 0.2, 26.0, 0.8], [UX + 1.8, 26.4, 3.6]);
|
||||
box('ChimneyTop', 'stoneDeep', [UX + 0.25, 26.4, 1.25], [UX + 1.35, 26.9, 3.15]);
|
||||
|
||||
// ================= Фонари у двери =================
|
||||
G('Lantern_L'); lantern(m, 'L', -3.15, 5.4, -GZ - 0.35, -1, { iron: 'iron', glow: 'glow', brass: 'brass' });
|
||||
G('Lantern_R'); lantern(m, 'R', 3.15, 5.4, -GZ - 0.35, 1, { iron: 'iron', glow: 'glow', brass: 'brass' });
|
||||
|
||||
// ================= Доска заказов (слева от крыльца, пустая поверхность OrderBoard_Face) =================
|
||||
G('OrderBoard');
|
||||
{
|
||||
const x0 = -6.9, x1 = -4.6, z = -GZ - 1.4;
|
||||
for (const x of [x0 - 0.1, x1 + 0.1]) box('OBPost', 'timber', [x - 0.13, 0, z - 0.13], [x + 0.13, 4.3, z + 0.13]);
|
||||
box('OrderBoard_Face', 'woodLight', [x0, 1.5, z - 0.08], [x1, 3.7, z + 0.06]);
|
||||
for (const [a, b] of [[1.4, 1.5], [3.7, 3.8]]) box('OBTrim', 'timber', [x0 - 0.1, a, z - 0.1], [x1 + 0.1, b, z + 0.08]);
|
||||
for (const s of [-1, 1]) box('OBRoof', 'roof', [x0 - 0.45, 4.25, s < 0 ? z - 0.8 : z], [x1 + 0.45, 4.37, s < 0 ? z : z + 0.8], { rot: [s * 30, 0, 0], pivot: [0, 4.6, z] });
|
||||
box('OBRidge', 'roof2', [x0 - 0.5, 4.5, z - 0.12], [x1 + 0.5, 4.68, z + 0.12]);
|
||||
}
|
||||
|
||||
// ================= Бочки и ящики у стены, сети и вёсла на левой стене =================
|
||||
G('Props');
|
||||
barrel(m, 'BarrelA', 5.0, -GZ - 0.85, 0.85, 1.5, 0.6, 'wood', 'wood2', 'iron', 'timber');
|
||||
barrel(m, 'BarrelB', 6.4, -GZ - 0.75, 0.85, 1.2, 0.5, 'wood2', 'timber', 'iron', 'wood');
|
||||
crate(m, 'CrateA', 9.3, 0.85, -GZ - 1.7, 10.9, 2.2, -GZ - 0.2, 'wood', 'timber');
|
||||
crate(m, 'CrateB', 9.5, 2.2, -GZ - 1.45, 10.6, 3.1, -GZ - 0.4, 'wood2', 'timber', true);
|
||||
crate(m, 'CrateC', -12.8, 0.85, -GZ - 1.6, -11.2, 2.1, -GZ - 0.2, 'wood', 'timber');
|
||||
G('WallNets');
|
||||
{
|
||||
const f = FACE.gl;
|
||||
for (let u = -2.2; u <= 2.21; u += 0.45) fb('NetV', 'rope', f, u - 0.03, u + 0.03, 2.4, 7.4 - Math.abs(u) * 0.25, 0.02, 0.07);
|
||||
for (let y = 2.6; y < 7.0; y += 0.45) fb('NetH', 'rope', f, -2.2, 2.2, y - 0.03, y + 0.03, 0.02, 0.07);
|
||||
for (const u of [-2.4, 0, 2.4]) fb('NetPeg', 'timber', f, u - 0.1, u + 0.1, 7.3, 7.6, 0, 0.3);
|
||||
for (let i = 0; i < 4; i++) fb('NetFloat', i % 2 ? 'cream' : 'red', f, -1.6 + i * 1.05 - 0.12, -1.6 + i * 1.05 + 0.12, 7.0, 7.3, 0.05, 0.2);
|
||||
// скрещённые вёсла
|
||||
for (const sg of [-1, 1]) {
|
||||
const cx = -GX - 0.25, cy = 5.0, cz = 6.2;
|
||||
box('OarShaft', 'woodLight', [cx - 0.05, cy - 0.05, cz - 2.0], [cx + 0.05, cy + 0.05, cz + 1.4], { rot: [sg * 40, 0, 0], pivot: [cx, cy, cz] });
|
||||
box('OarBlade', 'woodLight', [cx - 0.04, cy - 0.22, cz + 1.4], [cx + 0.04, cy + 0.22, cz + 2.3], { rot: [sg * 40, 0, 0], pivot: [cx, cy, cz] });
|
||||
}
|
||||
}
|
||||
|
||||
// ================= Интерьер зала =================
|
||||
const IX = GX - T, IZ = GZ - T; // внутренние грани: x ±12, z ±8
|
||||
G('Interior');
|
||||
for (let x = -9; x <= 9; x += 3) box('CeilingBeam', 'timber', [x - 0.25, F1 - 0.55, -IZ], [x + 0.25, F1, IZ]);
|
||||
box('CeilingBoards', 'wood2', [-IX, F1 - 0.08, -IZ], [IX, F1, IZ]);
|
||||
box('Wainscot', 'wood2', [-IX, F0, IZ - 0.12], [IX, 2.6, IZ]);
|
||||
// ковёр
|
||||
box('Rug', 'rug', [-4, F0, -5], [4, F0 + 0.04, 3]);
|
||||
for (const [a, b, c, d] of [[-4, 4, -5, -4.6], [-4, 4, 2.6, 3], [-4, -3.6, -5, 3], [3.6, 4, -5, 3]]) box('RugBorder', 'rugBorder', [a, F0 + 0.04, c], [b, F0 + 0.06, d]);
|
||||
box('RugCenter', 'blue', [-1.4, F0 + 0.04, -2.4], [1.4, F0 + 0.06, 0.4]);
|
||||
// стол-кафедра главы
|
||||
box('Desk_Top', 'wood', [-2.6, 2.25, 3.6], [2.6, 2.45, 5.0]);
|
||||
box('Desk_Front', 'timber2', [-2.5, F0, 3.6], [2.5, 2.25, 3.8]);
|
||||
for (const s of [-1, 1]) box('Desk_Side', 'timber2', [s * 2.5 - (s < 0 ? 0 : 0.25), F0, 3.6], [s * 2.5 + (s < 0 ? 0.25 : 0), 2.25, 5.0]);
|
||||
box('Desk_Carve', 'brass', [-1.0, 1.5, 3.55], [1.0, 1.9, 3.6]);
|
||||
box('Lectern', 'timber2', [-0.5, 2.45, 4.3], [0.5, 2.75, 4.9], { rot: [-20, 0, 0], pivot: [0, 2.45, 4.6] });
|
||||
box('Book', 'book1', [-0.42, 2.75, 4.25], [0.42, 2.83, 4.85], { rot: [-20, 0, 0], pivot: [0, 2.45, 4.6] });
|
||||
box('BookPages', 'cream', [-0.38, 2.83, 4.3], [0.38, 2.86, 4.8], { rot: [-20, 0, 0], pivot: [0, 2.45, 4.6] });
|
||||
box('Inkpot', 'iron', [1.5, 2.45, 4.1], [1.75, 2.65, 4.35]);
|
||||
box('Quill', 'white', [1.6, 2.65, 4.2], [1.64, 3.05, 4.24], { rot: [0, 0, -15], pivot: [1.62, 2.65, 4.22] });
|
||||
box('Candle_Glow', 'candle', [-1.9, 2.45, 4.2], [-1.75, 2.85, 4.35]);
|
||||
box('Chair_Seat', 'wood', [-0.7, 2.0, 5.6], [0.7, 2.15, 6.8]);
|
||||
box('Chair_Back', 'timber2', [-0.7, 2.15, 6.65], [0.7, 4.0, 6.85]);
|
||||
for (const [x, z] of [[-0.6, 5.7], [0.6, 5.7], [-0.6, 6.7], [0.6, 6.7]]) box('Chair_Leg', 'timber2', [x - 0.08, F0, z - 0.08], [x + 0.08, 2.0, z + 0.08]);
|
||||
G('ElderSpot');
|
||||
box('ElderSpot', 'rugBorder', [-0.5, F0, 5.0], [0.5, F0 + 0.05, 6.0]);
|
||||
G('Interior');
|
||||
// полки на задней стене
|
||||
for (let k = 0; k < 4; k++) {
|
||||
const y = 2.0 + k * 1.3;
|
||||
box('Shelf', 'wood', [-11.5, y, IZ - 0.9], [-6.0, y + 0.12, IZ]);
|
||||
for (let i = 0; i < 7; i++) {
|
||||
const x = -11.2 + i * 0.75 + (k % 2) * 0.2;
|
||||
if ((i + k) % 4 === 3) box('ShelfJar', 'stoneLight', [x - 0.2, y + 0.12, IZ - 0.6], [x + 0.2, y + 0.6, IZ - 0.2]);
|
||||
else box('ShelfBook', ['book1', 'book2', 'woodLight', 'blue'][(i + k) % 4], [x - 0.12, y + 0.12, IZ - 0.75], [x + 0.12, y + 0.85 - (i % 3) * 0.1, IZ - 0.15]);
|
||||
}
|
||||
}
|
||||
for (const x of [-11.6, -5.9]) box('ShelfSide', 'timber2', [x - 0.1, F0, IZ - 0.95], [x + 0.1, 7.1, IZ]);
|
||||
// трофейная рыба на табличке
|
||||
box('TrophyPlaque', 'timber2', [5.6, 4.6, IZ - 0.15], [10.4, 6.6, IZ]);
|
||||
box('TrophyPlaqueTrim', 'brass', [5.5, 4.5, IZ - 0.1], [10.5, 6.7, IZ - 0.02]);
|
||||
fish(m, 'TrophyFish', [8.0, 5.6, IZ - 0.35], 4.0, { a: 'x', w: 'y', t: 'z', dir: -1, body: 'fishSilver', belly: 'fishBelly', fin: 'fishFin' });
|
||||
// длинный стол со скамьями
|
||||
box('Table_Top', 'wood', [-10.5, 2.3, -4.2], [-5.5, 2.5, -1.8]);
|
||||
for (const [x, z] of [[-10.2, -3.9], [-5.8, -3.9], [-10.2, -2.1], [-5.8, -2.1]]) box('Table_Leg', 'timber2', [x - 0.12, F0, z - 0.12], [x + 0.12, 2.3, z + 0.12]);
|
||||
for (const z of [-5.1, -0.9]) { box('Bench', 'wood2', [-10.3, 1.75, z - 0.35], [-5.7, 1.9, z + 0.35]); for (const x of [-10, -6]) box('BenchLeg', 'timber2', [x - 0.1, F0, z - 0.25], [x + 0.1, 1.75, z + 0.25]); }
|
||||
box('Mug', 'woodLight', [-8.6, 2.5, -3.3], [-8.3, 2.85, -3.0]);
|
||||
box('Map', 'cream', [-7.6, 2.5, -3.6], [-6.4, 2.52, -2.6]);
|
||||
// камин у правой стены
|
||||
G('Fireplace');
|
||||
box('Hearth', 'stoneDark', [IX - 1.6, F0, 0.4], [IX, F0 + 0.2, 4.0]);
|
||||
box('FireSurround', 'stone', [IX - 0.9, F0, 0.6], [IX, 5.6, 3.8]);
|
||||
box('FireOpening', 'stoneDeep', [IX - 0.95, F0 + 0.2, 1.3], [IX - 0.1, 3.4, 3.1]);
|
||||
box('Mantel', 'timber', [IX - 1.3, 4.0, 0.4], [IX, 4.3, 4.0]);
|
||||
box('Logs', 'wood2', [IX - 0.85, F0 + 0.2, 1.6], [IX - 0.3, F0 + 0.5, 2.8]);
|
||||
G('FireGlow');
|
||||
box('Fire_Glow', 'fire', [IX - 0.8, F0 + 0.5, 1.7], [IX - 0.35, 2.4, 2.7]);
|
||||
box('FireCore_Glow', 'fireCore', [IX - 0.7, F0 + 0.5, 1.95], [IX - 0.45, 1.9, 2.45]);
|
||||
G('Fireplace');
|
||||
box('MantelCandle_Glow', 'candle', [IX - 0.8, 4.3, 0.8], [IX - 0.6, 4.75, 1.0]);
|
||||
box('MantelCandle2_Glow', 'candle', [IX - 0.8, 4.3, 3.2], [IX - 0.6, 4.65, 3.4]);
|
||||
box('MantelJar', 'stoneLight', [IX - 0.85, 4.3, 1.8], [IX - 0.45, 4.9, 2.4]);
|
||||
// люстра-колесо
|
||||
G('Chandelier');
|
||||
const CY = 6.8, CZ = -1.2;
|
||||
for (const r of [0, 90]) box('ChWheel', 'timber', [-1.4, CY, CZ - 0.08], [1.4, CY + 0.16, CZ + 0.08], { rot: [0, r, 0], pivot: [0, CY, CZ] });
|
||||
for (const r of [45, 135]) box('ChWheel', 'timber', [-1.4, CY, CZ - 0.08], [1.4, CY + 0.16, CZ + 0.08], { rot: [0, r, 0], pivot: [0, CY, CZ] });
|
||||
box('ChChain', 'iron', [-0.03, CY + 0.16, CZ - 0.03], [0.03, F1 - 0.55, CZ + 0.03]);
|
||||
for (let k = 0; k < 8; k++) { const a = k * Math.PI / 4, x = Math.cos(a) * 1.35, z = CZ + Math.sin(a) * 1.35; box('ChCandle_Glow', 'candle', [x - 0.07, CY + 0.16, z - 0.07], [x + 0.07, CY + 0.5, z + 0.07]); }
|
||||
|
||||
m.write(path.resolve(__dirname, '../../assets/props'), process.argv[2]);
|
||||
|
||||
// ---------- снимки своим рендером
|
||||
if (process.argv[3]) {
|
||||
const { render } = require('./render');
|
||||
const pre = process.argv[3];
|
||||
render([{ model: m }], pre + 'front.png', { yaw: 0, pitch: 6, width: 1600, height: 1200 });
|
||||
render([{ model: m }], pre + '34.png', { yaw: 35, pitch: 20, width: 1600, height: 1200 });
|
||||
const keep = new Set(['Foundation', 'StoneFloor', 'Door', 'Porch', 'Interior', 'ElderSpot', 'Fireplace', 'FireGlow', 'Chandelier', 'Windows', 'WindowGlow', 'Props', 'OrderBoard', 'Lantern_L', 'Lantern_R', 'WallNets', 'Sign']);
|
||||
const cut = { cubes: m.cubes.filter(c => keep.has(c.group) && !(c.group === 'Interior' && /Ceiling/.test(c.name)) && Math.max(c.from[1], c.to[1]) < F1 + 0.01), colors: m.colors, colorIdx: m.colorIdx };
|
||||
render([{ model: cut }], pre + 'hall.png', { yaw: 20, pitch: 62, width: 1600, height: 1200 });
|
||||
console.log('renders:', pre + '{front,34,hall}.png');
|
||||
}
|
||||
+3
-1
@@ -8,7 +8,7 @@ const PX = 16;
|
||||
const r3 = v => Math.round(v * 1000) / 1000;
|
||||
|
||||
class Model {
|
||||
constructor(name) { this.name = name; this.colors = []; this.colorIdx = {}; this.groups = []; this.cubes = []; this.cur = null; }
|
||||
constructor(name) { Model.all.push(this); this.name = name; this.colors = []; this.colorIdx = {}; this.groups = []; this.cubes = []; this.cur = null; }
|
||||
color(key, rgb) { if (!(key in this.colorIdx)) { this.colorIdx[key] = this.colors.length; this.colors.push(rgb); } return key; }
|
||||
group(name, parent = null) { if (!this.groups.find(g => g.name === name)) this.groups.push({ name, parent, uuid: crypto.randomUUID() }); this.cur = name; return name; }
|
||||
// box(имя, цвет, [x0,y0,z0], [x1,y1,z1], {rot:[x,y,z], pivot:[x,y,z]}) в студах
|
||||
@@ -108,6 +108,8 @@ class Model {
|
||||
}
|
||||
}
|
||||
|
||||
Model.all = []; // все модели, созданные в этом процессе (для рендера)
|
||||
|
||||
// ---------- общие детали ----------
|
||||
const AX = { x: 0, y: 1, z: 2 };
|
||||
// Рыба-силуэт: ось длины a (голова в сторону dir), ширина w, толщина t. L — длина в студах.
|
||||
|
||||
@@ -98,7 +98,7 @@ function build([name, cMain, cDark, cLight]) {
|
||||
}
|
||||
// знаки на камнях арки
|
||||
for (const i of [1, 3, 5, 7]) {
|
||||
const a = (90 - (i + 0.5) * 180 / N) * Math.PI / 180, r = (RI + RO) / 2, x = Math.cos(a) * r, y = CY + Math.sin(a) * r;
|
||||
const a = ((i + 0.5) * 180 / N) * Math.PI / 180, r = (RI + RO) / 2, x = Math.cos(a) * r, y = CY + Math.sin(a) * r;
|
||||
m.box('ArchSign_' + i, 'crystal', [x - 0.16, y - 0.16, -1.36], [x + 0.16, y + 0.16, -1.3], { rot: [0, 0, 45], pivot: [x, y, -1.33] });
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// Превью любого генератора без Blockbench: node tools/bbshop/preview.js <generator.js> <out.png> [scratch] [yaw] [pitch]
|
||||
// Генератор пересобирает свои файлы как обычно; все его модели рисуются в ряд.
|
||||
const path = require('path');
|
||||
const [gen, out, scratch = require('os').tmpdir(), yaw = 30, pitch = 25] = process.argv.slice(2);
|
||||
process.argv[2] = scratch;
|
||||
const { Model } = require('./lib');
|
||||
const { render } = require('./render');
|
||||
require(path.resolve(gen));
|
||||
let x = 0; const items = [];
|
||||
for (const m of Model.all) {
|
||||
let mn = 1e9, mx = -1e9; for (const c of m.cubes) { mn = Math.min(mn, c.from[0]); mx = Math.max(mx, c.to[0]); }
|
||||
items.push({ model: m, offset: [x - mn, 0, 0] }); x += mx - mn + 1.5;
|
||||
}
|
||||
render(items, out, { yaw: +yaw, pitch: +pitch });
|
||||
console.log('preview:', out);
|
||||
@@ -0,0 +1,95 @@
|
||||
// Простой рендер моделей из кубов в PNG (без Blockbench): ортографическая камера спереди-справа-сверху,
|
||||
// плоское освещение, z-буфер, сглаживание 2×. Повороты кубов как в lib (Rz·Ry·Rx вокруг pivot).
|
||||
const fs = require('fs');
|
||||
const zlib = require('zlib');
|
||||
|
||||
function corners(c) {
|
||||
const d2r = Math.PI / 180, [ax, ay, az] = c.rot.map(a => a * d2r), p0 = c.pivot, out = [];
|
||||
for (let i = 0; i < 8; i++) {
|
||||
let x = (i & 4 ? c.to[0] : c.from[0]) - p0[0], y = (i & 2 ? c.to[1] : c.from[1]) - p0[1], z = (i & 1 ? c.to[2] : c.from[2]) - p0[2];
|
||||
[y, z] = [y * Math.cos(ax) - z * Math.sin(ax), y * Math.sin(ax) + z * Math.cos(ax)];
|
||||
[x, z] = [x * Math.cos(ay) + z * Math.sin(ay), -x * Math.sin(ay) + z * Math.cos(ay)];
|
||||
[x, y] = [x * Math.cos(az) - y * Math.sin(az), x * Math.sin(az) + y * Math.cos(az)];
|
||||
out.push([x + p0[0], y + p0[1], z + p0[2]]);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
const FACES = [[0, 1, 3, 2], [4, 6, 7, 5], [0, 4, 5, 1], [2, 3, 7, 6], [0, 2, 6, 4], [1, 5, 7, 3]];
|
||||
const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]], dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
||||
const cross = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
|
||||
const norm = a => { const l = Math.hypot(...a) || 1; return a.map(v => v / l); };
|
||||
|
||||
function encodePng(W, H, rgb) {
|
||||
const raw = Buffer.alloc((W * 3 + 1) * H);
|
||||
for (let y = 0; y < H; y++) { raw[y * (W * 3 + 1)] = 0; rgb.copy(raw, y * (W * 3 + 1) + 1, y * W * 3, (y + 1) * W * 3); }
|
||||
const crcT = []; for (let n = 0; n < 256; n++) { let c = n; for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; crcT[n] = c >>> 0; }
|
||||
const crc = b => { let c = 0xffffffff; for (const x of b) c = crcT[(c ^ x) & 255] ^ (c >>> 8); return (c ^ 0xffffffff) >>> 0; };
|
||||
const chunk = (t, d) => { const l = Buffer.alloc(4); l.writeUInt32BE(d.length); const td = Buffer.concat([Buffer.from(t), d]); const cb = Buffer.alloc(4); cb.writeUInt32BE(crc(td)); return Buffer.concat([l, td, cb]); };
|
||||
const ihdr = Buffer.alloc(13); ihdr.writeUInt32BE(W, 0); ihdr.writeUInt32BE(H, 4); ihdr[8] = 8; ihdr[9] = 2;
|
||||
return Buffer.concat([Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]), chunk('IHDR', ihdr), chunk('IDAT', zlib.deflateSync(raw)), chunk('IEND', Buffer.alloc(0))]);
|
||||
}
|
||||
|
||||
// items: [{ model, offset:[x,y,z] }]; opts: { yaw, pitch, width, height, ground }
|
||||
function render(items, file, opts = {}) {
|
||||
const yaw = (opts.yaw ?? 30) * Math.PI / 180, pitch = (opts.pitch ?? 25) * Math.PI / 180, SS = 2;
|
||||
const W = (opts.width || 1600), H = (opts.height || 1000), w = W * SS, h = H * SS;
|
||||
const f = norm([-Math.sin(yaw) * Math.cos(pitch), -Math.sin(pitch), Math.cos(yaw) * Math.cos(pitch)]);
|
||||
const r = norm(cross(f, [0, 1, 0])), u = cross(r, f), L = norm([-0.45, 1, -0.6]);
|
||||
const tris = [];
|
||||
for (const { model, offset = [0, 0, 0] } of items) {
|
||||
for (const c of model.cubes) {
|
||||
const P = corners(c).map(p => [p[0] + offset[0], p[1] + offset[1], p[2] + offset[2]]);
|
||||
const ctr = P.reduce((a, p) => [a[0] + p[0] / 8, a[1] + p[1] / 8, a[2] + p[2] / 8], [0, 0, 0]);
|
||||
const rgb = model.colors[model.colorIdx[c.col]];
|
||||
for (const F of FACES) {
|
||||
const q = F.map(i => P[i]);
|
||||
let n = norm(cross(sub(q[1], q[0]), sub(q[2], q[0])));
|
||||
const fc = q.reduce((a, p) => [a[0] + p[0] / 4, a[1] + p[1] / 4, a[2] + p[2] / 4], [0, 0, 0]);
|
||||
if (dot(n, sub(fc, ctr)) < 0) n = n.map(v => -v);
|
||||
if (dot(n, f) >= 0) continue;
|
||||
const s = 0.58 + 0.42 * Math.max(0, dot(n, L)) + (n[1] > 0.5 ? 0.04 : 0);
|
||||
const col = rgb.map(v => Math.min(255, v * s));
|
||||
const pr = q.map(p => [dot(p, r), dot(p, u), dot(p, f)]);
|
||||
tris.push([pr[0], pr[1], pr[2], col], [pr[0], pr[2], pr[3], col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
// вписать в кадр
|
||||
let mnx = 1e9, mxx = -1e9, mny = 1e9, mxy = -1e9;
|
||||
for (const t of tris) for (let k = 0; k < 3; k++) { mnx = Math.min(mnx, t[k][0]); mxx = Math.max(mxx, t[k][0]); mny = Math.min(mny, t[k][1]); mxy = Math.max(mxy, t[k][1]); }
|
||||
const sc = Math.min((w * 0.92) / (mxx - mnx), (h * 0.9) / (mxy - mny)), ox = w / 2 - sc * (mnx + mxx) / 2, oy = h / 2 + sc * (mny + mxy) / 2;
|
||||
const zb = new Float32Array(w * h).fill(1e9), img = Buffer.alloc(w * h * 3);
|
||||
for (let y = 0; y < h; y++) { const g = 236 - 30 * y / h; for (let x = 0; x < w; x++) { const i = (y * w + x) * 3; img[i] = g; img[i + 1] = g + 2; img[i + 2] = g + 6; } }
|
||||
for (const [a, b, c, col] of tris) {
|
||||
const A = [ox + a[0] * sc, oy - a[1] * sc, a[2]], B = [ox + b[0] * sc, oy - b[1] * sc, b[2]], Cc = [ox + c[0] * sc, oy - c[1] * sc, c[2]];
|
||||
const area = (B[0] - A[0]) * (Cc[1] - A[1]) - (B[1] - A[1]) * (Cc[0] - A[0]);
|
||||
if (Math.abs(area) < 1e-9) continue;
|
||||
const x0 = Math.max(0, Math.floor(Math.min(A[0], B[0], Cc[0]))), x1 = Math.min(w - 1, Math.ceil(Math.max(A[0], B[0], Cc[0])));
|
||||
const y0 = Math.max(0, Math.floor(Math.min(A[1], B[1], Cc[1]))), y1 = Math.min(h - 1, Math.ceil(Math.max(A[1], B[1], Cc[1])));
|
||||
for (let y = y0; y <= y1; y++) for (let x = x0; x <= x1; x++) {
|
||||
const px = x + 0.5, py = y + 0.5;
|
||||
const w0 = ((B[0] - px) * (Cc[1] - py) - (B[1] - py) * (Cc[0] - px)) / area;
|
||||
const w1 = ((Cc[0] - px) * (A[1] - py) - (Cc[1] - py) * (A[0] - px)) / area;
|
||||
const w2 = 1 - w0 - w1;
|
||||
if (w0 < -1e-6 || w1 < -1e-6 || w2 < -1e-6) continue;
|
||||
const z = w0 * A[2] + w1 * B[2] + w2 * Cc[2], i = y * w + x;
|
||||
if (z < zb[i]) { zb[i] = z; img[i * 3] = col[0]; img[i * 3 + 1] = col[1]; img[i * 3 + 2] = col[2]; }
|
||||
}
|
||||
}
|
||||
// контур по скачку глубины — читаемость силуэтов
|
||||
const out = Buffer.alloc(W * H * 3);
|
||||
for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
|
||||
let s0 = 0, s1 = 0, s2 = 0, edge = false;
|
||||
for (let dy = 0; dy < SS; dy++) for (let dx = 0; dx < SS; dx++) {
|
||||
const X = x * SS + dx, Y = y * SS + dy, i = Y * w + X;
|
||||
s0 += img[i * 3]; s1 += img[i * 3 + 1]; s2 += img[i * 3 + 2];
|
||||
if (X + 1 < w && Math.abs(zb[i] - zb[i + 1]) > 0.35) edge = true;
|
||||
if (Y + 1 < h && Math.abs(zb[i] - zb[i + w]) > 0.35) edge = true;
|
||||
}
|
||||
const k = edge ? 0.55 : 1, o = (y * W + x) * 3;
|
||||
out[o] = s0 / 4 * k; out[o + 1] = s1 / 4 * k; out[o + 2] = s2 / 4 * k;
|
||||
}
|
||||
fs.writeFileSync(file, encodePng(W, H, out));
|
||||
}
|
||||
|
||||
module.exports = { render };
|
||||
@@ -0,0 +1,12 @@
|
||||
// Собирает Luau-файл для Studio: модель lobby_guild_hall (bbmodel-to-luau.js) + tools/build-guild-hall2.lua.
|
||||
// node tools/build-guild-hall2.js <out.lua>
|
||||
const fs = require('fs'), path = require('path'), { execFileSync } = require('child_process');
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const out = process.argv[2] || path.join(ROOT, 'tools', 'guild-hall2-full.lua');
|
||||
const lua = path.join(ROOT, 'tools', 'lobby-models', 'lobby_guild_hall.lua');
|
||||
execFileSync('node', [path.join(__dirname, 'bbmodel-to-luau.js'), path.join(ROOT, 'assets', 'props', 'lobby_guild_hall.bbmodel'),
|
||||
path.join(ROOT, 'assets', 'props', 'lobby_guild_hall_palette.png'), lua, 'lobby_guild_hall'], { stdio: 'inherit' });
|
||||
const code = '-- СГЕНЕРИРОВАНО tools/build-guild-hall2.js\nlocal BUILD = {}\nBUILD.hall = (function()\n'
|
||||
+ fs.readFileSync(lua, 'utf8') + '\nend)()\n' + fs.readFileSync(path.join(__dirname, 'build-guild-hall2.lua'), 'utf8');
|
||||
fs.writeFileSync(out, code, 'utf8');
|
||||
console.log('->', out, (code.length / 1024).toFixed(0) + ' KB');
|
||||
@@ -0,0 +1,282 @@
|
||||
-- Двухэтажное здание Гильдии рыбаков вместо двора гильдии и двух домиков на севере лобби.
|
||||
-- Собирается tools/build-guild-hall2.js (модель assets/props/lobby_guild_hall.bbmodel + этот код), запускать в Edit.
|
||||
-- Повторный запуск пересобирает только FishingMap.GuildHall; старое лежит в ServerStorage.Backup (не удаляется).
|
||||
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
assert(map, "Нет Workspace.FishingMap")
|
||||
local V = Vector3.new
|
||||
local SCALE = 1.25 -- модель в Blockbench рассчитана на дверь 5.5 стада; ×1.25 — свободно проходит персонаж
|
||||
local CENTER = V(0, 0, -58) -- середина севера лобби, между портальной площадью и скалами
|
||||
local TITLE_FONT = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
|
||||
local GOLD_TEXT = Color3.fromRGB(255, 214, 120)
|
||||
|
||||
---------------------------------------------------------------- 1) старое — в ServerStorage.Backup
|
||||
|
||||
local backup = game.ServerStorage:FindFirstChild("Backup") or Instance.new("Folder")
|
||||
backup.Name = "Backup"
|
||||
backup.Parent = game.ServerStorage
|
||||
local oldElder -- место Ворона из старого двора (с атрибутами внешности) — переедет в зал
|
||||
local function stash(obj, name)
|
||||
if obj and obj.Parent ~= backup then
|
||||
obj.Name = name or obj.Name
|
||||
obj.Parent = backup
|
||||
end
|
||||
end
|
||||
local oldHall = map:FindFirstChild("GuildHall")
|
||||
if oldHall and not oldHall:GetAttribute("GuildHall2") then
|
||||
for _, d in ipairs(oldHall:GetDescendants()) do
|
||||
if d:IsA("BasePart") and d:GetAttribute("GuildElder") then
|
||||
oldElder = d
|
||||
end
|
||||
end
|
||||
stash(oldHall, "GuildYard_old")
|
||||
elseif oldHall then
|
||||
oldHall:Destroy() -- пересборка нового здания
|
||||
end
|
||||
oldElder = oldElder or (backup:FindFirstChild("GuildYard_old") and (function()
|
||||
for _, d in ipairs(backup.GuildYard_old:GetDescendants()) do
|
||||
if d:IsA("BasePart") and d:GetAttribute("GuildElder") then
|
||||
return d
|
||||
end
|
||||
end
|
||||
end)())
|
||||
assert(oldElder, "Не найдено место Старейшины Ворона (GuildElder) в старом дворе")
|
||||
stash(workspace:FindFirstChild("GuildHouse"), "GuildHouse_old")
|
||||
-- левый домик — безымянная Workspace.Model того же размера слева от прохода
|
||||
for _, c in ipairs(workspace:GetChildren()) do
|
||||
if c:IsA("Model") and c.Name == "Model" then
|
||||
local cf, size = c:GetBoundingBox()
|
||||
if cf.X < -10 and cf.X > -40 and cf.Z < -40 and cf.Z > -70 and size.X > 30 then
|
||||
stash(c, "LeftHouse_old")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- 2) здание
|
||||
|
||||
local hall = Instance.new("Folder")
|
||||
hall.Name = "GuildHall"
|
||||
hall:SetAttribute("GuildHall2", true)
|
||||
hall.Parent = map
|
||||
local model = BUILD.hall(hall)
|
||||
model.Name = "GuildHallBuilding"
|
||||
model:ScaleTo(SCALE)
|
||||
|
||||
-- всё мелкое, что стоит на месте здания (камни и кусты из набора домиков), тоже в архив
|
||||
local HALF = V(21, 0, 19) -- полуразмер участка с запасом
|
||||
for _, c in ipairs(workspace:GetChildren()) do
|
||||
if (c:IsA("Model") or c:IsA("BasePart")) and c ~= workspace.Terrain then
|
||||
local p = c:IsA("Model") and c:GetBoundingBox().Position or c.Position
|
||||
if math.abs(p.X - CENTER.X) < HALF.X and math.abs(p.Z - CENTER.Z) < HALF.Z and p.Y < 30 then
|
||||
stash(c, c.Name .. "_old")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- высота земли посередине участка
|
||||
local params = RaycastParams.new()
|
||||
params.FilterType = Enum.RaycastFilterType.Exclude
|
||||
params.FilterDescendantsInstances = { hall }
|
||||
local hit = workspace:Raycast(CENTER + V(0, 60, 0), V(0, -120, 0), params)
|
||||
local groundY = hit and hit.Position.Y or 1.02
|
||||
-- фасад модели смотрит в −Z; разворот на 180°, чтобы фасад смотрел на площадь (+Z)
|
||||
model:PivotTo(CFrame.new(CENTER.X, groundY, CENTER.Z) * CFrame.Angles(0, math.pi, 0))
|
||||
|
||||
---------------------------------------------------------------- 3) материалы, коллизии, тени
|
||||
|
||||
local NO_COLLIDE_GROUPS = {
|
||||
Door = true, Banners = true, WallNets = true, Sign = true, Crest = true, Lantern_L = true, Lantern_R = true,
|
||||
Chandelier = true, FireGlow = true, ElderSpot = true, Balcony = false,
|
||||
}
|
||||
local NO_COLLIDE_NAMES = { Rug = true, RugBorder = true, RugCenter = true, Flower = true, FlowerLeaves = true, Shutter = true, ShutterStrap = true }
|
||||
local parts, collide, glow = 0, 0, 0
|
||||
for _, p in ipairs(model:GetDescendants()) do
|
||||
if p:IsA("BasePart") then
|
||||
parts += 1
|
||||
p.Anchored = true
|
||||
local group = p.Parent and p.Parent.Name or ""
|
||||
local s = { p.Size.X, p.Size.Y, p.Size.Z }
|
||||
table.sort(s)
|
||||
-- «палки» и мелочь (средний размер < 1 стада) — без столкновений и лучей; совсем мелкое — без теней
|
||||
local solid = s[2] >= 1 and not NO_COLLIDE_GROUPS[group] and not NO_COLLIDE_NAMES[p.Name]
|
||||
if p.Name:find("Window_Glow") then
|
||||
solid = true -- стекло: в окно не пролезть
|
||||
end
|
||||
p.CanCollide = solid
|
||||
p.CanQuery = solid
|
||||
p.CanTouch = false
|
||||
p.CastShadow = s[3] >= 2.5
|
||||
if solid then
|
||||
collide += 1
|
||||
end
|
||||
if p.Name:find("_Glow") then
|
||||
p.Material = Enum.Material.Neon
|
||||
p.CastShadow = false
|
||||
glow += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
local base = model.PrimaryPart
|
||||
if base then
|
||||
base.CanCollide, base.CanQuery, base.Transparency = false, false, 1
|
||||
end
|
||||
|
||||
local function find(groupName, partName)
|
||||
local g = model:FindFirstChild(groupName, true)
|
||||
if not g then
|
||||
return nil
|
||||
end
|
||||
if not partName then
|
||||
return g
|
||||
end
|
||||
for _, d in ipairs(g:GetDescendants()) do
|
||||
if d:IsA("BasePart") and d.Name == partName then
|
||||
return d
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function light(part, range, brightness, color, shadows)
|
||||
if not part then
|
||||
return
|
||||
end
|
||||
local l = Instance.new("PointLight")
|
||||
l.Range, l.Brightness, l.Color, l.Shadows = range, brightness, color, shadows or false
|
||||
l.Parent = part
|
||||
return l
|
||||
end
|
||||
|
||||
-- свет в зале: люстра (под колесом), камин, свеча на кафедре — горят и днём (AlwaysLit: Ambience их не гасит);
|
||||
-- фонари у двери гаснут днём, как остальные фонари лобби
|
||||
local function alwaysLit(part)
|
||||
if part then
|
||||
part:SetAttribute("AlwaysLit", true)
|
||||
end
|
||||
return part
|
||||
end
|
||||
for _, g in ipairs({ "Chandelier", "Fireplace", "FireGlow", "Interior" }) do
|
||||
for _, d in ipairs((find(g) or Instance.new("Folder")):GetDescendants()) do
|
||||
if d:IsA("BasePart") and d.Name:find("_Glow") then
|
||||
alwaysLit(d)
|
||||
end
|
||||
end
|
||||
end
|
||||
local chand = alwaysLit(find("Chandelier", "ChCandle_Glow"))
|
||||
light(chand, 28, 0.9, Color3.fromRGB(255, 222, 180), true)
|
||||
light(alwaysLit(find("FireGlow", "Fire_Glow")), 16, 1.2, Color3.fromRGB(255, 160, 90))
|
||||
light(alwaysLit(find("Interior", "Candle_Glow")), 10, 0.6, Color3.fromRGB(255, 214, 170))
|
||||
-- рассеянный свет под потолком зала (невидимые детали): днём снаружи ярко, без него зал кажется пещерой
|
||||
for _, x in ipairs({ -7, 7 }) do
|
||||
local f = Instance.new("Part")
|
||||
f.Name = "HallFill"
|
||||
f.Size = V(0.4, 0.4, 0.4)
|
||||
f.Transparency, f.Anchored, f.CanCollide, f.CanQuery, f.CanTouch, f.CastShadow = 1, true, false, false, false, false
|
||||
f.CFrame = model:GetPivot() * CFrame.new(x * SCALE, 7.6 * SCALE, 1.5 * SCALE)
|
||||
f.Parent = model
|
||||
light(f, 20, 0.45, Color3.fromRGB(255, 240, 220))
|
||||
end
|
||||
light(find("Lantern_L", "LanternL_Glow"), 14, 1, Color3.fromRGB(255, 205, 150))
|
||||
for _, d in ipairs((find("Lantern_R") or model):GetDescendants()) do
|
||||
if d:IsA("BasePart") and d.Name:find("_Glow") then
|
||||
light(d, 14, 1, Color3.fromRGB(255, 205, 150))
|
||||
end
|
||||
end
|
||||
-- огонь в камине
|
||||
local fire = find("FireGlow", "FireCore_Glow")
|
||||
if fire then
|
||||
local f = Instance.new("Fire")
|
||||
f.Size, f.Heat = 3, 4
|
||||
f.Color, f.SecondaryColor = Color3.fromRGB(255, 150, 60), Color3.fromRGB(200, 60, 20)
|
||||
f.Parent = fire
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- 4) вывеска, доска заказов, Ворон
|
||||
|
||||
local function surfaceGui(part, face)
|
||||
local sg = Instance.new("SurfaceGui")
|
||||
sg.Face = face
|
||||
sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
sg.PixelsPerStud = 50
|
||||
sg.LightInfluence = 0
|
||||
sg.Parent = part
|
||||
return sg
|
||||
end
|
||||
local function label(parent, props)
|
||||
local t = Instance.new("TextLabel")
|
||||
t.BackgroundTransparency = 1
|
||||
t.FontFace = TITLE_FONT
|
||||
t.TextScaled = true
|
||||
t.TextColor3 = GOLD_TEXT
|
||||
t.TextStrokeTransparency = 0.35
|
||||
t.TextStrokeColor3 = Color3.fromRGB(40, 28, 20)
|
||||
for k, v in pairs(props) do
|
||||
t[k] = v
|
||||
end
|
||||
t.Parent = parent
|
||||
return t
|
||||
end
|
||||
|
||||
-- вывеска над дверью (лицевая грань модели — Front, после разворота она смотрит на площадь)
|
||||
local signFace = find("Sign", "Sign_Face")
|
||||
assert(signFace, "Нет Sign_Face в модели")
|
||||
local sg = surfaceGui(signFace, Enum.NormalId.Front)
|
||||
label(sg, { Size = UDim2.fromScale(0.94, 0.86), Position = UDim2.fromScale(0.03, 0.07), Text = "⚓ ГИЛЬДИЯ РЫБАКОВ" })
|
||||
local bb = Instance.new("BillboardGui")
|
||||
bb.Size = UDim2.fromOffset(320, 56)
|
||||
bb.StudsOffsetWorldSpace = V(0, 12, 0)
|
||||
bb.MaxDistance = 160
|
||||
bb.LightInfluence = 0
|
||||
bb.Parent = signFace
|
||||
label(bb, { Size = UDim2.fromScale(1, 1), Text = "⚔ Гильдия рыбаков", TextStrokeTransparency = 0.15 })
|
||||
|
||||
-- доска заказов у входа: грань — поверхность с заголовком и приколотыми заказами
|
||||
local board = find("OrderBoard", "OrderBoard_Face")
|
||||
assert(board, "Нет OrderBoard_Face в модели")
|
||||
board.CanCollide, board.CanQuery = true, true
|
||||
board:SetAttribute("OrderBoard", true)
|
||||
local bsg = surfaceGui(board, Enum.NormalId.Front)
|
||||
label(bsg, { Size = UDim2.fromScale(0.9, 0.2), Position = UDim2.fromScale(0.05, 0.03), Text = "📜 ДОСКА ЗАКАЗОВ" })
|
||||
local rng = Random.new(7)
|
||||
for i = 1, 6 do
|
||||
local note = Instance.new("Frame")
|
||||
note.Size = UDim2.fromScale(0.26, 0.3)
|
||||
note.Position = UDim2.fromScale(0.06 + ((i - 1) % 3) * 0.31, 0.27 + math.floor((i - 1) / 3) * 0.36)
|
||||
note.Rotation = rng:NextNumber(-7, 7)
|
||||
note.BackgroundColor3 = Color3.fromRGB(236, 220, 180):Lerp(Color3.fromRGB(200, 170, 120), rng:NextNumber(0, 0.4))
|
||||
note.BorderSizePixel = 0
|
||||
note.Parent = bsg
|
||||
local pin = Instance.new("Frame")
|
||||
pin.Size = UDim2.fromScale(0.16, 0.12)
|
||||
pin.Position = UDim2.fromScale(0.42, -0.04)
|
||||
pin.BackgroundColor3 = (i % 2 == 0) and Color3.fromRGB(150, 40, 35) or Color3.fromRGB(214, 160, 70)
|
||||
pin.BorderSizePixel = 0
|
||||
pin.Parent = note
|
||||
Instance.new("UICorner", pin).CornerRadius = UDim.new(1, 0)
|
||||
for l = 1, 3 do
|
||||
local line = Instance.new("Frame")
|
||||
line.Size = UDim2.fromScale(0.7, 0.05)
|
||||
line.Position = UDim2.fromScale(0.15, 0.25 + l * 0.17)
|
||||
line.BackgroundColor3 = Color3.fromRGB(110, 80, 50)
|
||||
line.BorderSizePixel = 0
|
||||
line.Parent = note
|
||||
end
|
||||
end
|
||||
local pp = Instance.new("ProximityPrompt")
|
||||
pp.ActionText, pp.ObjectText = "Заказы гильдии", "Доска заказов"
|
||||
pp.HoldDuration, pp.MaxActivationDistance, pp.RequiresLineOfSight = 0, 12, false
|
||||
pp:SetAttribute("Action", "Orders")
|
||||
pp.Parent = board
|
||||
|
||||
-- Старейшина Ворон — за кафедрой в глубине зала, лицом к двери
|
||||
local spot = find("ElderSpot", "ElderSpot")
|
||||
assert(spot, "Нет ElderSpot в модели")
|
||||
local elder = oldElder:Clone()
|
||||
local top = spot.Position + V(0, spot.Size.Y / 2, 0)
|
||||
local look = -spot.CFrame.LookVector -- фасад модели смотрел в −Z, после разворота «вперёд» — к двери
|
||||
look = V(look.X, 0, look.Z).Unit
|
||||
-- старое место стояло центром на 3 стада выше пола (ноги на +0.5)
|
||||
elder.CFrame = CFrame.lookAt(top + V(0, 2.9, 0), top + V(0, 2.9, 0) + (-look))
|
||||
elder.Parent = hall
|
||||
spot.Transparency = 1
|
||||
|
||||
return ("Гильдия: деталей %d, с коллизией %d, светящихся %d; земля Y=%.2f; Ворон в %s"):format(parts, collide, glow, groundY, tostring(elder.Position))
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,318 @@
|
||||
// Набор иконок HUD в стиле игры: плоские фигуры с объёмом (светлый верх, тёмный низ), тёмная обводка
|
||||
// и золотой блик. Рисуется без внешних библиотек: свой растеризатор с 4× сглаживанием и PNG-кодировщик.
|
||||
// node tools/icons/make-icons.js → assets/icons/<имя>.png (128×128) и assets/reference/icons_sheet.png
|
||||
const fs = require('fs'), path = require('path'), zlib = require('zlib');
|
||||
const ROOT = path.join(__dirname, '..', '..');
|
||||
const OUT = path.join(ROOT, 'assets', 'icons');
|
||||
fs.mkdirSync(OUT, { recursive: true });
|
||||
|
||||
const S = 128, SS = 4, N = S * SS; // итоговый размер, сглаживание
|
||||
const OUTLINE = [40, 26, 18]; // тёмная обводка (тёмное дерево)
|
||||
|
||||
// ---------- PNG
|
||||
function crc32(buf) {
|
||||
let c, crc = 0xffffffff;
|
||||
for (let n = 0; n < buf.length; n++) {
|
||||
c = (crc ^ buf[n]) & 0xff;
|
||||
for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
||||
crc = (crc >>> 8) ^ c;
|
||||
}
|
||||
return (crc ^ 0xffffffff) >>> 0;
|
||||
}
|
||||
function chunk(type, data) {
|
||||
const len = Buffer.alloc(4); len.writeUInt32BE(data.length);
|
||||
const td = Buffer.concat([Buffer.from(type, 'ascii'), data]);
|
||||
const crc = Buffer.alloc(4); crc.writeUInt32BE(crc32(td));
|
||||
return Buffer.concat([len, td, crc]);
|
||||
}
|
||||
function png(w, h, rgba) {
|
||||
const raw = Buffer.alloc((w * 4 + 1) * h);
|
||||
for (let y = 0; y < h; y++) { raw[y * (w * 4 + 1)] = 0; rgba.copy(raw, y * (w * 4 + 1) + 1, y * w * 4, (y + 1) * w * 4); }
|
||||
const ihdr = Buffer.alloc(13); ihdr.writeUInt32BE(w, 0); ihdr.writeUInt32BE(h, 4); ihdr[8] = 8; ihdr[9] = 6;
|
||||
return Buffer.concat([Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]), chunk('IHDR', ihdr), chunk('IDAT', zlib.deflateSync(raw, { level: 9 })), chunk('IEND', Buffer.alloc(0))]);
|
||||
}
|
||||
|
||||
// ---------- холст: фигуры в координатах 0..128 (как итоговая иконка), рисуются в 512×512
|
||||
class Canvas {
|
||||
constructor() { this.c = new Float32Array(N * N * 4); }
|
||||
// заливка по функции inside(x, y) в координатах 0..128; color — [r,g,b]; shade — объём сверху вниз
|
||||
fill(inside, color, opt = {}) {
|
||||
const [x0, y0, x1, y1] = (opt.box || [0, 0, S, S]).map(v => Math.max(0, Math.min(N, Math.round(v * SS))));
|
||||
const top = opt.top ?? 0, bot = opt.bot ?? 128, shade = opt.shade ?? 0.28, a = opt.alpha ?? 1;
|
||||
for (let py = y0; py < y1; py++) for (let px = x0; px < x1; px++) {
|
||||
const x = (px + 0.5) / SS, y = (py + 0.5) / SS;
|
||||
if (!inside(x, y)) continue;
|
||||
const t = Math.max(0, Math.min(1, (y - top) / Math.max(1, bot - top)));
|
||||
const k = 1 + shade * (0.5 - t) * 2; // светлее сверху, темнее снизу
|
||||
const i = (py * N + px) * 4;
|
||||
for (let j = 0; j < 3; j++) this.c[i + j] = this.c[i + j] * (1 - a) + Math.min(255, color[j] * k) * a;
|
||||
this.c[i + 3] = Math.max(this.c[i + 3], a);
|
||||
}
|
||||
}
|
||||
// результат 128×128 с обводкой: под фигурами — тёмный силуэт, расширенный на w пикселей
|
||||
render(w = 5) {
|
||||
const R = w * SS, alpha = new Uint8Array(N * N);
|
||||
for (let i = 0; i < N * N; i++) alpha[i] = this.c[i * 4 + 3] > 0.5 ? 1 : 0;
|
||||
// расширение силуэта: сначала по X, потом по Y (квадратное, со скруглёнными углами через расстояние)
|
||||
const dil = new Uint8Array(N * N);
|
||||
const offs = [];
|
||||
for (let dy = -R; dy <= R; dy++) for (let dx = -R; dx <= R; dx++) if (dx * dx + dy * dy <= R * R) offs.push([dx, dy]);
|
||||
// быстрая версия: для каждой закрашенной точки края ставим диск (только по контуру)
|
||||
for (let y = 0; y < N; y++) for (let x = 0; x < N; x++) {
|
||||
if (!alpha[y * N + x]) continue;
|
||||
const edge = x === 0 || y === 0 || x === N - 1 || y === N - 1 || !alpha[y * N + x - 1] || !alpha[y * N + x + 1] || !alpha[(y - 1) * N + x] || !alpha[(y + 1) * N + x];
|
||||
dil[y * N + x] = 1;
|
||||
if (!edge) continue;
|
||||
for (const [dx, dy] of offs) { const X = x + dx, Y = y + dy; if (X >= 0 && Y >= 0 && X < N && Y < N) dil[Y * N + X] = 1; }
|
||||
}
|
||||
const out = Buffer.alloc(S * S * 4);
|
||||
for (let y = 0; y < S; y++) for (let x = 0; x < S; x++) {
|
||||
let r = 0, g = 0, b = 0, a = 0;
|
||||
for (let sy = 0; sy < SS; sy++) for (let sx = 0; sx < SS; sx++) {
|
||||
const i = (y * SS + sy) * N + (x * SS + sx);
|
||||
if (this.c[i * 4 + 3] > 0) { const aa = this.c[i * 4 + 3]; r += this.c[i * 4] * aa + OUTLINE[0] * (1 - aa); g += this.c[i * 4 + 1] * aa + OUTLINE[1] * (1 - aa); b += this.c[i * 4 + 2] * aa + OUTLINE[2] * (1 - aa); a += 1; }
|
||||
else if (dil[i]) { r += OUTLINE[0]; g += OUTLINE[1]; b += OUTLINE[2]; a += 1; }
|
||||
}
|
||||
const n = SS * SS, o = (y * S + x) * 4;
|
||||
if (a) { out[o] = r / a; out[o + 1] = g / a; out[o + 2] = b / a; out[o + 3] = Math.round(255 * a / n); }
|
||||
}
|
||||
return out;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- примитивы (возвращают inside-функции)
|
||||
const circle = (cx, cy, r) => (x, y) => (x - cx) ** 2 + (y - cy) ** 2 <= r * r;
|
||||
const ellipse = (cx, cy, rx, ry, rot = 0) => (x, y) => {
|
||||
const c = Math.cos(rot), s = Math.sin(rot), dx = x - cx, dy = y - cy;
|
||||
const u = dx * c + dy * s, v = -dx * s + dy * c;
|
||||
return (u / rx) ** 2 + (v / ry) ** 2 <= 1;
|
||||
};
|
||||
const rect = (x0, y0, x1, y1, r = 0) => (x, y) => {
|
||||
if (x < x0 || x > x1 || y < y0 || y > y1) return false;
|
||||
if (!r) return true;
|
||||
const cx = Math.max(x0 + r, Math.min(x1 - r, x)), cy = Math.max(y0 + r, Math.min(y1 - r, y));
|
||||
return (x - cx) ** 2 + (y - cy) ** 2 <= r * r;
|
||||
};
|
||||
const poly = pts => (x, y) => {
|
||||
let inside = false;
|
||||
for (let i = 0, j = pts.length - 1; i < pts.length; j = i++) {
|
||||
const [xi, yi] = pts[i], [xj, yj] = pts[j];
|
||||
if ((yi > y) !== (yj > y) && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) inside = !inside;
|
||||
}
|
||||
return inside;
|
||||
};
|
||||
const line = (x0, y0, x1, y1, w) => (x, y) => {
|
||||
const dx = x1 - x0, dy = y1 - y0, l2 = dx * dx + dy * dy;
|
||||
const t = Math.max(0, Math.min(1, ((x - x0) * dx + (y - y0) * dy) / l2));
|
||||
return (x - x0 - t * dx) ** 2 + (y - y0 - t * dy) ** 2 <= (w / 2) ** 2;
|
||||
};
|
||||
const ring = (cx, cy, r0, r1) => (x, y) => { const d = (x - cx) ** 2 + (y - cy) ** 2; return d <= r1 * r1 && d >= r0 * r0; };
|
||||
const and = (a, b) => (x, y) => a(x, y) && b(x, y);
|
||||
const not = a => (x, y) => !a(x, y);
|
||||
const star = (cx, cy, r0, r1, n = 5, rot = -Math.PI / 2) => {
|
||||
const pts = [];
|
||||
for (let i = 0; i < n * 2; i++) { const r = i % 2 ? r0 : r1, a = rot + i * Math.PI / n; pts.push([cx + Math.cos(a) * r, cy + Math.sin(a) * r]); }
|
||||
return poly(pts);
|
||||
};
|
||||
|
||||
// ---------- палитра игры
|
||||
const C = {
|
||||
wood: [122, 82, 50], woodD: [80, 52, 32], leather: [150, 92, 52], gold: [222, 172, 82], goldL: [255, 218, 120],
|
||||
crimson: [170, 46, 40], forest: [70, 126, 66], leaf: [96, 170, 80], parch: [236, 220, 180], silver: [210, 216, 224],
|
||||
steel: [150, 160, 172], pearl: [240, 232, 244], blue: [76, 146, 210], sky: [130, 196, 240], fish: [236, 152, 64],
|
||||
fishB: [255, 196, 96], purple: [150, 96, 210], pink: [232, 120, 150], white: [250, 248, 240], grey: [150, 150, 158],
|
||||
dark: [60, 56, 64], cloud: [226, 232, 240], yellow: [255, 206, 70], red: [214, 66, 56], teal: [70, 180, 170],
|
||||
};
|
||||
const shine = (cv, inside) => cv.fill(inside, [255, 255, 255], { alpha: 0.35, shade: 0 }); // белый блик
|
||||
|
||||
const ICONS = {
|
||||
bag(cv) { // кожаная сумка с клапаном и пряжкой
|
||||
cv.fill(rect(26, 46, 102, 112, 14), C.leather, { top: 46, bot: 112 });
|
||||
cv.fill(ring(64, 46, 18, 26), C.woodD);
|
||||
cv.fill(and(rect(24, 40, 104, 74, 12), (x, y) => y < 74), C.woodD, { top: 40, bot: 74 });
|
||||
cv.fill(rect(55, 62, 73, 82, 4), C.gold, { top: 62, bot: 82 });
|
||||
cv.fill(rect(60, 67, 68, 77, 2), C.woodD, { shade: 0 });
|
||||
shine(cv, rect(32, 80, 40, 104, 4));
|
||||
},
|
||||
fish(cv) { // рыба с хвостом
|
||||
cv.fill(poly([[86, 64], [116, 40], [110, 64], [116, 88]]), C.fish, { top: 40, bot: 88 });
|
||||
cv.fill(ellipse(58, 64, 40, 24), C.fish, { top: 40, bot: 88 });
|
||||
cv.fill(poly([[46, 42], [70, 30], [74, 46]]), C.fishB);
|
||||
cv.fill(circle(34, 58, 6), C.white, { shade: 0 }); cv.fill(circle(35, 59, 3.2), C.dark, { shade: 0 });
|
||||
cv.fill(line(54, 48, 54, 80, 3), C.woodD, { shade: 0 });
|
||||
shine(cv, ellipse(50, 50, 18, 5, -0.15));
|
||||
},
|
||||
book(cv) { // коллекция: книга с закладкой
|
||||
cv.fill(rect(22, 22, 106, 106, 8), C.crimson, { top: 22, bot: 106 });
|
||||
cv.fill(rect(32, 22, 106, 98, 6), C.parch, { top: 22, bot: 98, shade: 0.12 });
|
||||
cv.fill(rect(22, 22, 36, 106, 6), [130, 34, 30]);
|
||||
cv.fill(poly([[84, 22], [96, 22], [96, 56], [90, 50], [84, 56]]), C.gold);
|
||||
for (const y of [44, 58, 72]) cv.fill(rect(46, y, 78, y + 4, 2), [170, 150, 116], { shade: 0 });
|
||||
},
|
||||
map(cv) { // свёрнутая карта мира
|
||||
cv.fill(poly([[18, 30], [48, 22], [80, 32], [110, 24], [110, 98], [80, 106], [48, 96], [18, 104]]), C.parch, { top: 22, bot: 106, shade: 0.15 });
|
||||
cv.fill(poly([[48, 22], [80, 32], [80, 106], [48, 96]]), [214, 196, 152], { top: 22, bot: 106 });
|
||||
cv.fill(ellipse(40, 62, 14, 18), C.leaf); cv.fill(ellipse(88, 56, 12, 10), C.leaf);
|
||||
cv.fill(line(52, 84, 76, 70, 4), C.crimson, { shade: 0 });
|
||||
cv.fill(line(84, 74, 96, 86, 5), C.crimson, { shade: 0 }); cv.fill(line(96, 74, 84, 86, 5), C.crimson, { shade: 0 });
|
||||
},
|
||||
scroll(cv) { // задания: свиток
|
||||
cv.fill(rect(28, 26, 100, 102, 4), C.parch, { top: 26, bot: 102, shade: 0.15 });
|
||||
cv.fill(rect(20, 18, 108, 34, 8), C.wood, { top: 18, bot: 34 });
|
||||
cv.fill(rect(20, 94, 108, 110, 8), C.wood, { top: 94, bot: 110 });
|
||||
for (const y of [46, 60, 74]) cv.fill(rect(40, y, 88, y + 5, 2), [150, 120, 84], { shade: 0 });
|
||||
cv.fill(circle(84, 82, 10), C.crimson);
|
||||
},
|
||||
crystal(cv) { // донат: кристалл
|
||||
cv.fill(poly([[64, 12], [104, 46], [64, 118], [24, 46]]), C.purple, { top: 12, bot: 118 });
|
||||
cv.fill(poly([[64, 12], [104, 46], [64, 46]]), [196, 150, 250]);
|
||||
cv.fill(poly([[64, 46], [104, 46], [64, 118]]), [116, 70, 176]);
|
||||
cv.fill(poly([[44, 46], [64, 46], [64, 118]]), [176, 126, 236]);
|
||||
shine(cv, poly([[44, 30], [56, 22], [50, 42]]));
|
||||
},
|
||||
horn(cv) { // звук: рог
|
||||
cv.fill(poly([[24, 76], [96, 30], [108, 40], [112, 70], [104, 96], [40, 92]]), C.parch, { top: 30, bot: 96, shade: 0.2 });
|
||||
cv.fill(ellipse(104, 64, 10, 34), C.gold, { top: 30, bot: 98 });
|
||||
cv.fill(ellipse(104, 64, 5, 26), C.woodD, { shade: 0 });
|
||||
cv.fill(rect(16, 70, 34, 96, 6), C.gold);
|
||||
for (const x of [52, 74]) cv.fill(line(x, 50 + (74 - x) * 0.25, x + 4, 92, 6), C.woodD, { shade: 0 });
|
||||
},
|
||||
guild(cv) { // гильдия: щит и скрещённые мечи
|
||||
cv.fill(line(24, 24, 104, 104, 9), C.silver); cv.fill(line(104, 24, 24, 104, 9), C.silver);
|
||||
for (const [a, b] of [[[30, 98], [18, 110]], [[98, 98], [110, 110]]]) cv.fill(line(a[0], a[1], b[0], b[1], 10), C.woodD);
|
||||
cv.fill(line(22, 92, 36, 106, 6), C.gold); cv.fill(line(106, 92, 92, 106, 6), C.gold);
|
||||
cv.fill(poly([[64, 30], [96, 40], [92, 80], [64, 104], [36, 80], [32, 40]]), C.crimson, { top: 30, bot: 104 });
|
||||
cv.fill(poly([[64, 40], [86, 47], [83, 76], [64, 93], [45, 76], [42, 47]]), C.gold, { top: 40, bot: 93 });
|
||||
cv.fill(poly([[64, 48], [76, 60], [64, 84], [52, 60]]), C.crimson);
|
||||
},
|
||||
coin(cv) { // серебро
|
||||
cv.fill(circle(64, 66, 46), [160, 168, 180]);
|
||||
cv.fill(circle(64, 62, 46), C.silver, { top: 16, bot: 108 });
|
||||
cv.fill(ring(64, 62, 30, 35), [176, 184, 196], { shade: 0 });
|
||||
cv.fill(star(64, 62, 10, 22, 5), [176, 184, 196], { shade: 0 });
|
||||
shine(cv, ellipse(46, 40, 14, 6, -0.6));
|
||||
},
|
||||
pearl(cv) { // жемчуг в раковине
|
||||
cv.fill(poly([[16, 76], [64, 112], [112, 76], [100, 100], [28, 100]]), C.pink, { top: 76, bot: 112 });
|
||||
cv.fill(ellipse(64, 84, 48, 22), [240, 170, 186], { top: 62, bot: 106 });
|
||||
for (const x of [40, 64, 88]) cv.fill(line(64, 104, x, 66, 3), [210, 130, 150], { shade: 0 });
|
||||
cv.fill(circle(64, 56, 26), C.pearl, { top: 30, bot: 82 });
|
||||
shine(cv, circle(54, 46, 8));
|
||||
},
|
||||
seal(cv) { // печать гильдии: сургуч с лентами
|
||||
cv.fill(poly([[48, 80], [36, 120], [52, 110], [60, 120], [64, 84]]), C.crimson);
|
||||
cv.fill(poly([[80, 80], [92, 120], [76, 110], [68, 120], [64, 84]]), [140, 36, 32]);
|
||||
const blob = [];
|
||||
for (let i = 0; i < 24; i++) { const a = i / 24 * Math.PI * 2, r = 40 + (i % 2 ? 4 : 0); blob.push([64 + Math.cos(a) * r, 56 + Math.sin(a) * r]); }
|
||||
cv.fill(poly(blob), C.crimson, { top: 14, bot: 98 });
|
||||
cv.fill(ring(64, 56, 24, 28), [130, 30, 28], { shade: 0 });
|
||||
cv.fill(poly([[64, 40], [74, 52], [70, 70], [58, 70], [54, 52]]), C.gold); // якорь-стрелка
|
||||
},
|
||||
clover(cv) { // удача
|
||||
for (const [x, y] of [[44, 44], [84, 44], [44, 82], [84, 82]]) cv.fill(circle(x, y, 22), C.leaf, { top: y - 22, bot: y + 22 });
|
||||
cv.fill(line(66, 66, 92, 116, 9), C.forest);
|
||||
for (const [x, y] of [[40, 40], [80, 40], [40, 78], [80, 78]]) shine(cv, circle(x, y, 6));
|
||||
},
|
||||
xp(cv) { // опыт: звезда
|
||||
cv.fill(star(64, 66, 22, 54), C.yellow, { top: 12, bot: 118 });
|
||||
cv.fill(star(64, 66, 12, 30), C.goldL, { shade: 0 });
|
||||
shine(cv, ellipse(48, 46, 8, 4, -0.5));
|
||||
},
|
||||
level(cv) { // уровень: ромб-значок
|
||||
cv.fill(poly([[64, 10], [118, 64], [64, 118], [10, 64]]), C.gold, { top: 10, bot: 118 });
|
||||
cv.fill(poly([[64, 26], [102, 64], [64, 102], [26, 64]]), [196, 140, 60], { top: 26, bot: 102 });
|
||||
cv.fill(poly([[64, 40], [76, 64], [64, 88], [52, 64]]), C.goldL);
|
||||
},
|
||||
rod(cv) { // удочка с катушкой и поплавком
|
||||
cv.fill(line(24, 112, 106, 18, 7), C.wood);
|
||||
cv.fill(line(24, 112, 44, 88, 10), C.woodD);
|
||||
cv.fill(circle(44, 92, 11), C.steel); cv.fill(circle(44, 92, 4), C.dark, { shade: 0 });
|
||||
cv.fill(line(106, 18, 106, 84, 2), C.white, { shade: 0 });
|
||||
cv.fill(circle(106, 92, 9), C.red); cv.fill(and(circle(106, 92, 9), (x, y) => y > 92), C.white);
|
||||
},
|
||||
worm(cv) { // наживка: червь
|
||||
const pts = [[22, 92], [42, 70], [64, 84], [86, 64], [104, 46]];
|
||||
for (let i = 0; i < pts.length - 1; i++) cv.fill(line(pts[i][0], pts[i][1], pts[i + 1][0], pts[i + 1][1], 20), [214, 120, 140], { top: 30, bot: 110 });
|
||||
for (const [x, y] of [[36, 78], [54, 76], [74, 74], [92, 58]]) cv.fill(line(x - 5, y - 6, x + 5, y + 6, 3), [176, 86, 106], { shade: 0 });
|
||||
cv.fill(circle(106, 42, 3), C.dark, { shade: 0 });
|
||||
},
|
||||
sun(cv) {
|
||||
for (let i = 0; i < 8; i++) { const a = i * Math.PI / 4; cv.fill(line(64 + Math.cos(a) * 36, 64 + Math.sin(a) * 36, 64 + Math.cos(a) * 54, 64 + Math.sin(a) * 54, 9), C.yellow); }
|
||||
cv.fill(circle(64, 64, 28), C.yellow, { top: 36, bot: 92 }); shine(cv, circle(54, 54, 8));
|
||||
},
|
||||
cloud(cv) {
|
||||
for (const [x, y, r] of [[44, 74, 22], [70, 62, 28], [94, 76, 20]]) cv.fill(circle(x, y, r), C.cloud, { top: 34, bot: 98 });
|
||||
cv.fill(rect(26, 74, 112, 96, 10), C.cloud, { top: 34, bot: 98 });
|
||||
},
|
||||
rain(cv) {
|
||||
for (const [x, y] of [[44, 98], [66, 106], [88, 98]]) cv.fill(poly([[x, y - 12], [x + 6, y + 2], [x - 6, y + 2]]), C.blue), cv.fill(circle(x, y + 2, 6), C.blue);
|
||||
for (const [x, y, r] of [[44, 56, 20], [68, 46, 26], [92, 58, 18]]) cv.fill(circle(x, y, r), [196, 206, 220], { top: 20, bot: 80 });
|
||||
cv.fill(rect(26, 56, 108, 78, 10), [196, 206, 220], { top: 20, bot: 80 });
|
||||
},
|
||||
storm(cv) {
|
||||
for (const [x, y, r] of [[44, 50, 20], [68, 40, 26], [92, 52, 18]]) cv.fill(circle(x, y, r), [130, 136, 156], { top: 14, bot: 74 });
|
||||
cv.fill(rect(26, 50, 108, 72, 10), [130, 136, 156], { top: 14, bot: 74 });
|
||||
cv.fill(poly([[70, 70], [52, 98], [64, 98], [54, 122], [82, 88], [68, 88], [80, 70]]), C.yellow);
|
||||
},
|
||||
fog(cv) {
|
||||
for (const [y, x0, x1] of [[40, 26, 96], [62, 18, 110], [84, 32, 104], [104, 22, 90]]) cv.fill(rect(x0, y - 7, x1, y + 7, 7), C.cloud, { shade: 0.15 });
|
||||
},
|
||||
moon(cv) {
|
||||
cv.fill(and(circle(62, 64, 44), not(circle(84, 52, 38))), [240, 226, 160], { top: 20, bot: 108 });
|
||||
for (const [x, y] of [[96, 30], [104, 70], [86, 100]]) cv.fill(star(x, y, 3, 8, 4, 0), C.white, { shade: 0 });
|
||||
},
|
||||
lock(cv) {
|
||||
cv.fill(ring(64, 54, 18, 28), C.steel, { top: 26, bot: 82 });
|
||||
cv.fill(rect(30, 54, 98, 112, 10), C.gold, { top: 54, bot: 112 });
|
||||
cv.fill(circle(64, 78, 9), C.woodD, { shade: 0 }); cv.fill(rect(60, 80, 68, 98, 2), C.woodD, { shade: 0 });
|
||||
},
|
||||
gift(cv) {
|
||||
cv.fill(rect(22, 54, 106, 112, 6), C.crimson, { top: 54, bot: 112 });
|
||||
cv.fill(rect(16, 40, 112, 60, 6), [196, 60, 52], { top: 40, bot: 60 });
|
||||
cv.fill(rect(56, 40, 72, 112, 2), C.gold);
|
||||
cv.fill(ellipse(48, 32, 16, 10, 0.4), C.gold); cv.fill(ellipse(80, 32, 16, 10, -0.4), C.gold);
|
||||
},
|
||||
chest(cv) { // сундук (ежедневная награда, донат-наборы)
|
||||
cv.fill(rect(18, 56, 110, 110, 6), C.wood, { top: 56, bot: 110 });
|
||||
cv.fill(rect(18, 30, 110, 62, 16), C.woodD, { top: 30, bot: 62 });
|
||||
for (const x of [30, 92]) cv.fill(rect(x, 30, x + 8, 110, 2), C.gold);
|
||||
cv.fill(rect(54, 54, 74, 76, 4), C.gold); cv.fill(circle(64, 64, 3.5), C.woodD, { shade: 0 });
|
||||
},
|
||||
trap(cv) { // ловушка-вентерь (плетёная корзина)
|
||||
cv.fill(poly([[24, 40], [104, 40], [92, 110], [36, 110]]), [196, 150, 84], { top: 40, bot: 110 });
|
||||
for (const y of [56, 74, 92]) cv.fill(rect(26, y, 102, y + 5, 2), [150, 108, 56], { shade: 0 });
|
||||
for (const x of [46, 64, 82]) cv.fill(line(x, 40, x - (x - 64) * 0.2, 110, 4), [150, 108, 56], { shade: 0 });
|
||||
cv.fill(ellipse(64, 40, 42, 10), [150, 108, 56]); cv.fill(ellipse(64, 40, 32, 6), C.woodD, { shade: 0 });
|
||||
},
|
||||
target(cv) { // цели
|
||||
cv.fill(circle(64, 64, 48), C.parch, { top: 16, bot: 112 });
|
||||
cv.fill(ring(64, 64, 28, 38), C.crimson, { shade: 0 }); cv.fill(circle(64, 64, 14), C.crimson);
|
||||
cv.fill(line(64, 64, 110, 18, 6), C.wood); cv.fill(poly([[100, 14], [116, 12], [114, 28]]), C.gold);
|
||||
},
|
||||
gear(cv) { // настройки
|
||||
const teeth = [];
|
||||
for (let i = 0; i < 16; i++) { const a = i / 16 * Math.PI * 2, r = i % 2 ? 40 : 52; teeth.push([64 + Math.cos(a) * r, 64 + Math.sin(a) * r]); }
|
||||
cv.fill(poly(teeth), C.steel, { top: 12, bot: 116 });
|
||||
cv.fill(circle(64, 64, 16), C.woodD, { shade: 0 });
|
||||
},
|
||||
};
|
||||
|
||||
// ---------- запись иконок и превью-листа
|
||||
const names = Object.keys(ICONS);
|
||||
const sheetCols = 7, cell = 160, rows = Math.ceil(names.length / sheetCols);
|
||||
const SW = sheetCols * cell, SH = rows * cell;
|
||||
const sheet = Buffer.alloc(SW * SH * 4);
|
||||
for (let i = 0; i < SW * SH; i++) { sheet[i * 4] = 52; sheet[i * 4 + 1] = 36; sheet[i * 4 + 2] = 24; sheet[i * 4 + 3] = 255; } // фон — тёмное дерево
|
||||
names.forEach((name, k) => {
|
||||
const cv = new Canvas();
|
||||
ICONS[name](cv);
|
||||
const img = cv.render();
|
||||
fs.writeFileSync(path.join(OUT, name + '.png'), png(S, S, img));
|
||||
const ox = (k % sheetCols) * cell + 16, oy = Math.floor(k / sheetCols) * cell + 16;
|
||||
for (let y = 0; y < S; y++) for (let x = 0; x < S; x++) {
|
||||
const s = (y * S + x) * 4, d = ((oy + y) * SW + ox + x) * 4, a = img[s + 3] / 255;
|
||||
for (let j = 0; j < 3; j++) sheet[d + j] = sheet[d + j] * (1 - a) + img[s + j] * a;
|
||||
}
|
||||
});
|
||||
fs.writeFileSync(path.join(ROOT, 'assets', 'reference', 'icons_sheet.png'), png(SW, SH, sheet));
|
||||
console.log('icons:', names.length, names.join(' '));
|
||||
@@ -0,0 +1,14 @@
|
||||
// Собирает Luau-файл для Studio: модели скамеек (bbmodel-to-luau.js) + tools/lobby-benches.lua.
|
||||
// node tools/lobby-benches.js <out.lua>
|
||||
const fs = require('fs'), path = require('path'), { execFileSync } = require('child_process');
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const out = process.argv[2] || path.join(ROOT, 'tools', 'lobby-benches-full.lua');
|
||||
let code = '-- СГЕНЕРИРОВАНО tools/lobby-benches.js\nlocal BUILD = {}\n';
|
||||
for (const [key, file] of Object.entries({ bench: 'lobby_bench', bench_flowers: 'lobby_bench_flowers' })) {
|
||||
const lua = path.join(ROOT, 'tools', 'lobby-models', file + '.lua');
|
||||
execFileSync('node', [path.join(__dirname, 'bbmodel-to-luau.js'), path.join(ROOT, 'assets', 'props', file + '.bbmodel'),
|
||||
path.join(ROOT, 'assets', 'props', file + '_palette.png'), lua, file], { stdio: 'inherit' });
|
||||
code += `BUILD.${key} = (function()\n${fs.readFileSync(lua, 'utf8')}\nend)()\n`;
|
||||
}
|
||||
fs.writeFileSync(out, code + fs.readFileSync(path.join(__dirname, 'lobby-benches.lua'), 'utf8'), 'utf8');
|
||||
console.log('->', out);
|
||||
@@ -0,0 +1,37 @@
|
||||
-- Пересборка скамеек лобби по свежим моделям (node tools/lobby-benches.js <out.lua>, выполнить в Studio, Ctrl+S).
|
||||
-- Каждая скамейка LobbyFix3.LobbyBench_N заменяется новой на том же месте, сиденьем к фонтану (−Z модели к центру),
|
||||
-- спинкой наружу. Невидимое Seat ставится на доски, лицом к фонтану. Отменяет разворот из lobby-fix6.
|
||||
|
||||
local map = workspace.FishingMap
|
||||
local SCALE = 1.2
|
||||
local holder = map:FindFirstChild("LobbyFix3")
|
||||
assert(holder, "нет FishingMap.LobbyFix3")
|
||||
local n = 0
|
||||
for _, old in ipairs(holder:GetChildren()) do
|
||||
local i = old:IsA("Model") and tonumber(old.Name:match("^LobbyBench_(%d+)$"))
|
||||
if i then
|
||||
local p = old:GetPivot().Position
|
||||
local seat = old:FindFirstChildWhichIsA("Seat")
|
||||
if seat then
|
||||
seat.Parent = nil
|
||||
end
|
||||
local at = Vector3.new(p.X, p.Y, p.Z)
|
||||
local cf = CFrame.lookAt(at, Vector3.new(0, at.Y, 0)) -- сиденьем к фонтану
|
||||
old:Destroy()
|
||||
local m = (i % 2 == 1 and BUILD.bench or BUILD.bench_flowers)(holder)
|
||||
m.Name = "LobbyBench_" .. i
|
||||
m:ScaleTo(SCALE)
|
||||
m:PivotTo(cf)
|
||||
for _, d in ipairs(m:GetDescendants()) do
|
||||
if d:IsA("BasePart") then
|
||||
d.Anchored = true
|
||||
end
|
||||
end
|
||||
if seat then
|
||||
seat.CFrame = cf * CFrame.new(0, 1.55 * SCALE, -0.27 * SCALE)
|
||||
seat.Parent = m
|
||||
end
|
||||
n += 1
|
||||
end
|
||||
end
|
||||
return "скамеек пересобрано: " .. n
|
||||
@@ -0,0 +1,127 @@
|
||||
-- Правки лобби №5 (Studio, режим редактирования; один раз — повторный запуск ничего не делает), потом Ctrl+S.
|
||||
-- 1) Фонтан ×1.75; его высокие фонари и старые фонари вокруг прежнего фонтана → ServerStorage.Backup.LobbyFix5.
|
||||
-- 2) Порталы отъезжают от центра так, чтобы между чашей и аркой было ≥ 7 studs, и опускаются на мостовую:
|
||||
-- старая модель портала (проём, частицы), триггер Portal_WorldN, новая арка, маркер GuidePortal — всё вместе.
|
||||
-- Тёмные подставки-звёзды старых порталов → Backup. Надписи миров — крупно над аркой.
|
||||
-- 3) Табличка «Как играть» со столбами и маркером GuideBoard → Backup (шаг обучения убран в FishingClient).
|
||||
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
local map = workspace.FishingMap
|
||||
local FLOOR = 1
|
||||
local GAP = 7
|
||||
local backup = ServerStorage:FindFirstChild("Backup") or Instance.new("Folder")
|
||||
backup.Name = "Backup"
|
||||
backup.Parent = ServerStorage
|
||||
if backup:FindFirstChild("LobbyFix5") then
|
||||
return "уже сделано (ServerStorage.Backup.LobbyFix5 есть)"
|
||||
end
|
||||
local store = Instance.new("Folder")
|
||||
store.Name = "LobbyFix5"
|
||||
store.Parent = backup
|
||||
local report = {}
|
||||
local function flat(v)
|
||||
return Vector3.new(v.X, 0, v.Z)
|
||||
end
|
||||
local function move(o, delta)
|
||||
if o:IsA("Model") then
|
||||
o:PivotTo(o:GetPivot() + delta)
|
||||
elseif o:IsA("BasePart") then
|
||||
o.CFrame = o.CFrame + delta
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- 3. табличка
|
||||
|
||||
for _, c in ipairs(map:GetChildren()) do
|
||||
if c:IsA("BasePart") and (c:GetAttribute("GuideTarget") == "Board" or c.Name == "GuideBoard" or (c:GetAttribute("Fix2Orig") ~= nil and c.Size.Y > 6 and c.Size.X < 1.5)) then
|
||||
c.Parent = store
|
||||
end
|
||||
end
|
||||
table.insert(report, "табличка и маркер → Backup")
|
||||
|
||||
---------------------------------------------------------------- 1. фонтан
|
||||
|
||||
local fix3 = map:FindFirstChild("LobbyFix3")
|
||||
local fountain = fix3 and fix3:FindFirstChild("LobbyFountain")
|
||||
assert(fountain, "нет LobbyFix3.LobbyFountain")
|
||||
fountain:ScaleTo(fountain:GetScale() * 1.75)
|
||||
for i = 1, 4 do
|
||||
local l = fountain:FindFirstChild("Lantern_" .. i)
|
||||
if l then
|
||||
l.Parent = store
|
||||
end
|
||||
end
|
||||
local fcf, fsize = fountain:GetBoundingBox()
|
||||
local fr = math.max(fsize.X, fsize.Z) / 2
|
||||
-- старые фонари у прежнего фонтана (Workspace, в радиусе 16) — теперь стояли бы в чаше
|
||||
for _, c in ipairs(workspace:GetChildren()) do
|
||||
if c:IsA("BasePart") and flat(c.Position).Magnitude < 16 and c.Position.Y > 4 and c.Position.Y < 13 and c.Size.Magnitude < 10 then
|
||||
c.Parent = store
|
||||
end
|
||||
end
|
||||
table.insert(report, ("фонтан: ширина %.1f"):format(fr * 2))
|
||||
|
||||
---------------------------------------------------------------- 2. порталы
|
||||
|
||||
for _, id in ipairs({ "World1", "World2", "World3", "World4" }) do
|
||||
local old = map:FindFirstChild("PortalModel_" .. id)
|
||||
local trigger = map:FindFirstChild("Portal_" .. id)
|
||||
local arch = map:FindFirstChild("PortalArch_" .. id)
|
||||
if not (old and trigger and arch) then
|
||||
table.insert(report, id .. ": нет частей портала, пропуск")
|
||||
continue
|
||||
end
|
||||
-- подставки-звёзды → Backup
|
||||
for _, p in ipairs(old:GetDescendants()) do
|
||||
if p:IsA("BasePart") and p.Size.X > 11 and p.Size.Z > 11 then
|
||||
p.Parent = store
|
||||
end
|
||||
end
|
||||
local acf, asize = arch:GetBoundingBox()
|
||||
local dir = flat(arch:GetPivot().Position).Unit
|
||||
local cur = flat(arch:GetPivot().Position).Magnitude
|
||||
local want = fr + GAP + math.max(asize.X, asize.Z) / 2 * 0.6 -- полуглубина арки по радиусу (≈4 studs)
|
||||
local delta = dir * math.max(0, want - cur) + Vector3.new(0, FLOOR - arch:GetPivot().Position.Y, 0)
|
||||
for _, o in ipairs({ old, trigger, arch }) do
|
||||
move(o, delta)
|
||||
end
|
||||
if id == "World1" then
|
||||
local g = map:FindFirstChild("GuidePortal")
|
||||
if g then
|
||||
move(g, Vector3.new(delta.X, 0, delta.Z))
|
||||
end
|
||||
end
|
||||
-- надпись мира: крупно над аркой (размер в studs — одинаково читается с любого расстояния)
|
||||
local top = acf.Position.Y + asize.Y / 2 + delta.Y
|
||||
for _, root in ipairs({ trigger, old }) do
|
||||
for _, bb in ipairs(root:GetDescendants()) do
|
||||
if bb:IsA("BillboardGui") then
|
||||
local host = bb.Adornee or bb.Parent
|
||||
local y = host:IsA("BasePart") and host.Position.Y or top
|
||||
bb.Size = UDim2.fromScale(16, 3.2)
|
||||
bb.StudsOffset = Vector3.new(0, top + 2.2 - y, 0)
|
||||
bb.MaxDistance = 220
|
||||
for _, t in ipairs(bb:GetDescendants()) do
|
||||
if t:IsA("TextLabel") then
|
||||
t.TextScaled = true
|
||||
t.TextStrokeTransparency = 0.1
|
||||
t.FontFace = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
table.insert(report, ("%s: радиус %.1f → %.1f"):format(id, cur, flat(arch:GetPivot().Position).Magnitude))
|
||||
end
|
||||
|
||||
-- проверка зазора: между фонтаном и арками
|
||||
local overlap = OverlapParams.new()
|
||||
overlap.FilterType = Enum.RaycastFilterType.Include
|
||||
local arches = {}
|
||||
for _, id in ipairs({ "World1", "World2", "World3", "World4" }) do
|
||||
table.insert(arches, map:FindFirstChild("PortalArch_" .. id))
|
||||
end
|
||||
overlap.FilterDescendantsInstances = arches
|
||||
local hits = workspace:GetPartBoundsInBox(fcf, fsize + Vector3.new(GAP * 2 - 1, 0, GAP * 2 - 1), overlap)
|
||||
table.insert(report, "арок ближе " .. GAP .. " studs к фонтану: " .. #hits .. " деталей")
|
||||
return table.concat(report, "\n")
|
||||
@@ -0,0 +1,427 @@
|
||||
-- Правки лобби №6 (Studio, режим редактирования, потом Ctrl+S). Повторный запуск безопасен:
|
||||
-- порталы ставятся на точные места, скамейки разворачиваются только один раз, антураж пересобирается.
|
||||
-- 1) Порталы — ровным крестом вокруг фонтана: озеро на юге (к точке появления), остров на востоке, фьорд на севере,
|
||||
-- вулкан на западе; все на одном радиусе, на мостовой, проходом наружу.
|
||||
-- 2) Статичная рыбка в фонтане → Backup (плавающих рыбок делает FountainFish.client.lua).
|
||||
-- 3) Скамейки — сиденьем к фонтану, спинкой наружу; невидимое сиденье развёрнуто вместе с ними.
|
||||
-- 4) Антураж: колодец, повозка с бочками, стог с курами, сушащиеся сети с лодкой и вёслами, указатель у дорожки,
|
||||
-- гирлянды флажков между фонарями вокруг площади, кошки. Папка FishingMap.LobbyAmbience.
|
||||
-- 5) Надписи: порталы — название и строкой ниже требования (ур. · ранг), одинаковый размер; замок Вулкана убран
|
||||
-- в подпись; все тексты лобби — Merriweather (у FredokaOne нет кириллицы); «Ежедневная награда» в одну строку.
|
||||
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local map = workspace.FishingMap
|
||||
local FLOOR = 1
|
||||
local PORTAL_R = 24.5
|
||||
local FONT = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
|
||||
local FONT_BODY = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Bold)
|
||||
local report = {}
|
||||
|
||||
local backup = ServerStorage:FindFirstChild("Backup") or Instance.new("Folder")
|
||||
backup.Name = "Backup"
|
||||
backup.Parent = ServerStorage
|
||||
local store = backup:FindFirstChild("LobbyFix6") or Instance.new("Folder")
|
||||
store.Name = "LobbyFix6"
|
||||
store.Parent = backup
|
||||
|
||||
local copy = ReplicatedStorage.FishConfig:Clone()
|
||||
copy.Parent = ReplicatedStorage
|
||||
local Config = require(copy)
|
||||
copy:Destroy()
|
||||
|
||||
local function flat(v)
|
||||
return Vector3.new(v.X, 0, v.Z)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- 1. порталы
|
||||
|
||||
local PORTALS = { World1 = Vector3.new(0, 0, 1), World2 = Vector3.new(1, 0, 0), World3 = Vector3.new(0, 0, -1), World4 = Vector3.new(-1, 0, 0) }
|
||||
for id, dir in pairs(PORTALS) do
|
||||
local arch = map:FindFirstChild("PortalArch_" .. id)
|
||||
local old = map:FindFirstChild("PortalModel_" .. id)
|
||||
local trigger = map:FindFirstChild("Portal_" .. id)
|
||||
if arch and old and trigger then
|
||||
local at = dir * PORTAL_R + Vector3.new(0, FLOOR, 0)
|
||||
local target = CFrame.lookAt(at, at + dir)
|
||||
local T = target * arch:GetPivot():Inverse()
|
||||
for _, o in ipairs({ arch, old }) do
|
||||
o:PivotTo(T * o:GetPivot())
|
||||
end
|
||||
trigger.CFrame = T * trigger.CFrame
|
||||
if id == "World1" then
|
||||
local g = map:FindFirstChild("GuidePortal")
|
||||
if g then
|
||||
g.CFrame = CFrame.new(flat((T * g.CFrame).Position) + Vector3.new(0, g.Position.Y, 0))
|
||||
end
|
||||
end
|
||||
-- подпись: название крупно, строкой ниже — требования
|
||||
local w = Config.Find(Config.Worlds, id)
|
||||
local rank = Config.Guild and Config.Guild.worldRank[id]
|
||||
local need = {}
|
||||
if w.soon then
|
||||
table.insert(need, "🔒 скоро")
|
||||
end
|
||||
if w.level > 1 then
|
||||
table.insert(need, "ур. " .. w.level)
|
||||
end
|
||||
if rank then
|
||||
table.insert(need, "ранг " .. Config.Guild.ranks[rank].id)
|
||||
end
|
||||
local sub = #need > 0 and table.concat(need, " · ") or "открыт для всех"
|
||||
for _, bb in ipairs(trigger:GetChildren()) do
|
||||
if bb:IsA("BillboardGui") then
|
||||
bb:Destroy()
|
||||
end
|
||||
end
|
||||
local _, asize = arch:GetBoundingBox()
|
||||
local bb = Instance.new("BillboardGui")
|
||||
bb.Name = "PortalLabel"
|
||||
bb.Size = UDim2.fromScale(14, 3.6)
|
||||
bb.StudsOffsetWorldSpace = Vector3.new(0, FLOOR + asize.Y + 2.4 - trigger.Position.Y, 0)
|
||||
bb.MaxDistance = 220
|
||||
bb.LightInfluence = 0
|
||||
bb.Parent = trigger
|
||||
local function line(text, y, h, color)
|
||||
local t = Instance.new("TextLabel")
|
||||
t.BackgroundTransparency = 1
|
||||
t.Position = UDim2.fromScale(0, y)
|
||||
t.Size = UDim2.fromScale(1, h)
|
||||
t.FontFace = y == 0 and FONT or FONT_BODY
|
||||
t.TextScaled = true
|
||||
t.TextColor3 = color
|
||||
t.TextStrokeTransparency = 0.15
|
||||
t.TextStrokeColor3 = Color3.fromRGB(30, 22, 16)
|
||||
t.Text = text
|
||||
t.Parent = bb
|
||||
end
|
||||
line(w.icon .. " " .. w.name, 0, 0.62, w.color:Lerp(Color3.new(1, 1, 1), 0.35))
|
||||
line(sub, 0.64, 0.36, Color3.fromRGB(236, 220, 180))
|
||||
end
|
||||
end
|
||||
table.insert(report, "порталы: крест на радиусе " .. PORTAL_R)
|
||||
|
||||
---------------------------------------------------------------- 2. рыбка из фонтана
|
||||
|
||||
local fountain = map:FindFirstChild("LobbyFix3") and map.LobbyFix3:FindFirstChild("LobbyFountain")
|
||||
if fountain then
|
||||
for _, c in ipairs(fountain:GetChildren()) do
|
||||
if c:IsA("Model") and c.Name == "Золотая рыбка" then
|
||||
c.Parent = store
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- 3. скамейки
|
||||
|
||||
for _, m in ipairs(map:FindFirstChild("LobbyFix3") and map.LobbyFix3:GetChildren() or {}) do
|
||||
if m:IsA("Model") and m.Name:find("^LobbyBench_") and not m:GetAttribute("Fix6Flipped") then
|
||||
local seat = m:FindFirstChildWhichIsA("Seat")
|
||||
local seatCF = seat and seat.CFrame
|
||||
m:PivotTo(m:GetPivot() * CFrame.Angles(0, math.pi, 0))
|
||||
if seat then
|
||||
-- сиденье над досками, лицом к фонтану (как и сидящий человек)
|
||||
local p = seat.Position
|
||||
seat.CFrame = CFrame.lookAt(p, Vector3.new(0, p.Y, 0))
|
||||
end
|
||||
m:SetAttribute("Fix6Flipped", true)
|
||||
end
|
||||
end
|
||||
table.insert(report, "скамейки развернуты")
|
||||
|
||||
---------------------------------------------------------------- 5. шрифты и подписи лобби
|
||||
|
||||
local fixed = 0
|
||||
for _, c in ipairs(map:GetChildren()) do
|
||||
local p = c:IsA("Model") and c:GetPivot().Position or (c:IsA("BasePart") and c.Position)
|
||||
if p and flat(p).Magnitude < 110 then
|
||||
for _, d in ipairs(c:GetDescendants()) do
|
||||
if d:IsA("TextLabel") and (d:FindFirstAncestorWhichIsA("SurfaceGui") or d:FindFirstAncestorWhichIsA("BillboardGui")) then
|
||||
local f = d.FontFace.Family
|
||||
-- 🪙 Roblox не рисует (квадратик)
|
||||
if d.Text:find("🪙") then
|
||||
d.Text = d.Text:gsub("🪙", "👑")
|
||||
end
|
||||
if not f:find("Merriweather") then
|
||||
d.FontFace = (d.Name == "PlayerName" or d.Name == "Value" or d.Name == "Rank") and FONT_BODY or FONT
|
||||
fixed += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
local chest = map:FindFirstChild("DailyChestPrompt")
|
||||
local chestBB = chest and chest:FindFirstChildOfClass("BillboardGui")
|
||||
if chestBB then
|
||||
chestBB.Size = UDim2.fromScale(12, 1.8)
|
||||
local t = chestBB:FindFirstChildWhichIsA("TextLabel", true)
|
||||
if t then
|
||||
t.TextWrapped = false
|
||||
t.TextScaled = true
|
||||
end
|
||||
end
|
||||
table.insert(report, "шрифт заменён у " .. fixed .. " надписей")
|
||||
|
||||
---------------------------------------------------------------- 4. антураж
|
||||
|
||||
local amb = map:FindFirstChild("LobbyAmbience")
|
||||
if amb then
|
||||
amb:Destroy()
|
||||
end
|
||||
amb = Instance.new("Folder")
|
||||
amb.Name = "LobbyAmbience"
|
||||
amb.Parent = map
|
||||
local rng = Random.new(2026)
|
||||
local group
|
||||
local function G(name)
|
||||
group = Instance.new("Model")
|
||||
group.Name = name
|
||||
group.Parent = amb
|
||||
return group
|
||||
end
|
||||
local function P(props)
|
||||
local p = Instance.new(props.Class or "Part")
|
||||
p.Anchored = true
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
p.Material = Enum.Material.SmoothPlastic
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Class" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.Parent = group
|
||||
return p
|
||||
end
|
||||
local function cyl(cf, h, d, color, props)
|
||||
local t = { Shape = Enum.PartType.Cylinder, Size = Vector3.new(h, d, d), CFrame = cf * CFrame.Angles(0, 0, math.rad(90)), Color = color }
|
||||
for k, v in pairs(props or {}) do
|
||||
t[k] = v
|
||||
end
|
||||
return P(t)
|
||||
end
|
||||
local WOOD, DARK, STONE = Color3.fromRGB(122, 82, 50), Color3.fromRGB(78, 52, 34), Color3.fromRGB(132, 126, 120)
|
||||
local IRON, HAY = Color3.fromRGB(56, 54, 58), Color3.fromRGB(214, 182, 96)
|
||||
local function at(x, z, yaw)
|
||||
return CFrame.new(x, FLOOR, z) * CFrame.Angles(0, math.rad(yaw or 0), 0)
|
||||
end
|
||||
local function barrel(cf)
|
||||
cyl(cf * CFrame.new(0, 1.6, 0), 3.2, 2.6, WOOD:Lerp(DARK, rng:NextNumber(0, 0.4)))
|
||||
cyl(cf * CFrame.new(0, 0.7, 0), 0.25, 2.72, IRON)
|
||||
cyl(cf * CFrame.new(0, 2.5, 0), 0.25, 2.72, IRON)
|
||||
end
|
||||
local function crate(cf, s)
|
||||
s = s or 2.6
|
||||
P({ Size = Vector3.new(s, s * 0.9, s), CFrame = cf * CFrame.new(0, s * 0.45, 0), Color = Color3.fromRGB(150, 104, 62) })
|
||||
P({ Size = Vector3.new(s + 0.1, 0.25, s + 0.1), CFrame = cf * CFrame.new(0, s * 0.85, 0), Color = DARK })
|
||||
end
|
||||
local function tub(cf)
|
||||
cyl(cf * CFrame.new(0, 0.7, 0), 1.4, 2.2, WOOD)
|
||||
cyl(cf * CFrame.new(0, 1.42, 0), 0.1, 1.9, Color3.fromRGB(70, 52, 36), { Material = Enum.Material.Ground })
|
||||
local colors = { Color3.fromRGB(230, 90, 90), Color3.fromRGB(250, 210, 90), Color3.fromRGB(240, 240, 240), Color3.fromRGB(180, 110, 220) }
|
||||
for i = 1, 5 do
|
||||
local a = i / 5 * math.pi * 2
|
||||
P({ Shape = Enum.PartType.Ball, Size = Vector3.new(0.6, 0.6, 0.6), CFrame = cf * CFrame.new(math.cos(a) * 0.55, 1.75, math.sin(a) * 0.55), Color = colors[(i % #colors) + 1], CanCollide = false })
|
||||
end
|
||||
P({ Shape = Enum.PartType.Ball, Size = Vector3.new(1.3, 0.8, 1.3), CFrame = cf * CFrame.new(0, 1.6, 0), Color = Color3.fromRGB(70, 130, 60), CanCollide = false })
|
||||
end
|
||||
local function cat(cf, color)
|
||||
P({ Size = Vector3.new(1.3, 0.7, 2.0), CFrame = cf * CFrame.new(0, 0.35, 0), Color = color, CanCollide = false }) -- лежит
|
||||
P({ Size = Vector3.new(1.0, 0.85, 0.9), CFrame = cf * CFrame.new(0, 0.55, -1.2), Color = color, CanCollide = false })
|
||||
for _, x in ipairs({ -0.3, 0.3 }) do
|
||||
P({ Class = "WedgePart", Size = Vector3.new(0.25, 0.4, 0.3), CFrame = cf * CFrame.new(x, 1.15, -1.2) * CFrame.Angles(0, math.pi, 0), Color = color, CanCollide = false })
|
||||
end
|
||||
P({ Size = Vector3.new(0.25, 0.25, 1.6), CFrame = cf * CFrame.new(0.7, 0.15, 0.8) * CFrame.Angles(0, math.rad(-30), 0), Color = color, CanCollide = false })
|
||||
end
|
||||
local function hen(cf)
|
||||
P({ Shape = Enum.PartType.Ball, Size = Vector3.new(0.9, 0.85, 1.1), CFrame = cf * CFrame.new(0, 0.7, 0), Color = Color3.fromRGB(240, 236, 226), CanCollide = false })
|
||||
P({ Shape = Enum.PartType.Ball, Size = Vector3.new(0.5, 0.5, 0.5), CFrame = cf * CFrame.new(0, 1.2, -0.45), Color = Color3.fromRGB(240, 236, 226), CanCollide = false })
|
||||
P({ Size = Vector3.new(0.12, 0.25, 0.25), CFrame = cf * CFrame.new(0, 1.5, -0.45), Color = Color3.fromRGB(200, 40, 40), CanCollide = false })
|
||||
P({ Size = Vector3.new(0.12, 0.1, 0.2), CFrame = cf * CFrame.new(0, 1.2, -0.75), Color = Color3.fromRGB(240, 170, 60), CanCollide = false })
|
||||
for _, x in ipairs({ -0.15, 0.15 }) do
|
||||
P({ Size = Vector3.new(0.08, 0.35, 0.08), CFrame = cf * CFrame.new(x, 0.17, 0), Color = Color3.fromRGB(240, 170, 60), CanCollide = false })
|
||||
end
|
||||
end
|
||||
|
||||
-- колодец (северо-запад, между доской «Топ донатеров» и двором гильдии)
|
||||
do
|
||||
local c = at(-55, -62)
|
||||
G("Well")
|
||||
for i = 0, 11 do
|
||||
local a = i / 12 * math.pi * 2
|
||||
P({ Size = Vector3.new(1.4, 2.2, 0.9), CFrame = c * CFrame.Angles(0, a, 0) * CFrame.new(0, 1.1, -2.4), Color = STONE:Lerp(Color3.new(0, 0, 0), rng:NextNumber(0, 0.15)), Material = Enum.Material.Slate })
|
||||
end
|
||||
cyl(c * CFrame.new(0, 1.5, 0), 0.2, 4.2, Color3.fromRGB(40, 90, 120), { Material = Enum.Material.Glass, Transparency = 0.2 })
|
||||
for _, x in ipairs({ -2.4, 2.4 }) do
|
||||
P({ Size = Vector3.new(0.5, 5, 0.5), CFrame = c * CFrame.new(x, 4.4, 0), Color = WOOD })
|
||||
end
|
||||
P({ Class = "WedgePart", Size = Vector3.new(6, 1.4, 2.2), CFrame = c * CFrame.new(0, 7.6, -1.1), Color = Color3.fromRGB(150, 70, 52) })
|
||||
P({ Class = "WedgePart", Size = Vector3.new(6, 1.4, 2.2), CFrame = c * CFrame.new(0, 7.6, 1.1) * CFrame.Angles(0, math.pi, 0), Color = Color3.fromRGB(150, 70, 52) })
|
||||
cyl(c * CFrame.new(0, 5.6, 0) * CFrame.Angles(0, math.rad(90), 0), 5, 0.35, DARK)
|
||||
P({ Size = Vector3.new(0.05, 1.6, 0.05), CFrame = c * CFrame.new(0, 4.8, 0), Color = Color3.fromRGB(190, 170, 120) })
|
||||
cyl(c * CFrame.new(0, 3.8, 0), 0.9, 0.9, WOOD)
|
||||
tub(c * CFrame.new(4, 0, 1.5))
|
||||
barrel(c * CFrame.new(-4, 0, 1))
|
||||
cat(c * CFrame.new(3.2, 0, -2.8) * CFrame.Angles(0, math.rad(40), 0), Color3.fromRGB(232, 150, 70))
|
||||
end
|
||||
|
||||
-- сушащиеся сети, лодка и вёсла (северо-восток)
|
||||
do
|
||||
local c = at(55, -62, 30)
|
||||
G("Nets")
|
||||
for _, x in ipairs({ -4, 0, 4 }) do
|
||||
P({ Size = Vector3.new(0.45, 7, 0.45), CFrame = c * CFrame.new(x, 3.5, 0), Color = WOOD })
|
||||
end
|
||||
P({ Size = Vector3.new(8.6, 0.1, 0.1), CFrame = c * CFrame.new(0, 6.6, 0), Color = Color3.fromRGB(190, 170, 120) })
|
||||
for _, x in ipairs({ -2, 2 }) do
|
||||
local net = P({ Size = Vector3.new(3.4, 4, 0.05), CFrame = c * CFrame.new(x, 4.5, 0), Color = Color3.fromRGB(120, 100, 70), Transparency = 0.35, CanCollide = false })
|
||||
for k = 0, 3 do
|
||||
P({ Size = Vector3.new(3.4, 0.06, 0.08), CFrame = c * CFrame.new(x, 3 + k, 0), Color = Color3.fromRGB(90, 72, 50), CanCollide = false })
|
||||
end
|
||||
P({ Shape = Enum.PartType.Ball, Size = Vector3.new(0.4, 0.4, 0.4), CFrame = c * CFrame.new(x + 1.2, 2.6, 0), Color = Color3.fromRGB(230, 200, 120), CanCollide = false })
|
||||
end
|
||||
-- лодка вверх дном и вёсла
|
||||
local b = c * CFrame.new(0, 0, 5) * CFrame.Angles(0, math.rad(90), 0)
|
||||
P({ Size = Vector3.new(7, 0.9, 2.4), CFrame = b * CFrame.new(0, 0.9, 0), Color = Color3.fromRGB(110, 140, 160) })
|
||||
P({ Size = Vector3.new(6.6, 0.6, 2.0), CFrame = b * CFrame.new(0, 0.3, 0), Color = Color3.fromRGB(96, 70, 46) })
|
||||
P({ Class = "WedgePart", Size = Vector3.new(2.4, 0.9, 1.4), CFrame = b * CFrame.new(4.2, 0.9, 0) * CFrame.Angles(0, math.rad(-90), 0), Color = Color3.fromRGB(110, 140, 160) })
|
||||
for _, z in ipairs({ -0.5, 0.5 }) do
|
||||
P({ Size = Vector3.new(0.25, 0.15, 5), CFrame = b * CFrame.new(-1, 1.45, z) * CFrame.Angles(0, math.rad(80), 0), Color = WOOD })
|
||||
end
|
||||
crate(c * CFrame.new(-6, 0, 2.5))
|
||||
crate(c * CFrame.new(-6, 2.35, 2.5), 2.0)
|
||||
barrel(c * CFrame.new(6.2, 0, 2))
|
||||
end
|
||||
|
||||
-- повозка с бочками (юго-запад от точки появления)
|
||||
do
|
||||
local c = at(-17, 60, 15)
|
||||
G("Cart")
|
||||
P({ Size = Vector3.new(4.4, 0.4, 7), CFrame = c * CFrame.new(0, 2.2, 0), Color = WOOD })
|
||||
for _, x in ipairs({ -2.1, 2.1 }) do
|
||||
P({ Size = Vector3.new(0.3, 1.2, 7), CFrame = c * CFrame.new(x, 2.9, 0), Color = DARK })
|
||||
for _, z in ipairs({ -2.2, 2.2 }) do
|
||||
cyl(c * CFrame.new(x * 1.1, 1.6, z) * CFrame.Angles(0, 0, math.rad(90)), 0.35, 3.2, DARK)
|
||||
cyl(c * CFrame.new(x * 1.12, 1.6, z) * CFrame.Angles(0, 0, math.rad(90)), 0.4, 0.7, IRON)
|
||||
end
|
||||
end
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P({ Size = Vector3.new(0.3, 0.3, 4), CFrame = c * CFrame.new(s * 0.9, 2, -5.4), Color = WOOD })
|
||||
end
|
||||
barrel(c * CFrame.new(-1, 2.4, -1.6))
|
||||
barrel(c * CFrame.new(1, 2.4, -1.6))
|
||||
barrel(c * CFrame.new(0, 2.4, 1.8))
|
||||
tub(c * CFrame.new(4.5, 0, 3))
|
||||
cat(c * CFrame.new(-3.6, 0, 3) * CFrame.Angles(0, math.rad(-60), 0), Color3.fromRGB(70, 66, 64))
|
||||
end
|
||||
|
||||
-- стог сена и куры (юго-восток от точки появления)
|
||||
do
|
||||
local c = at(17, 60, -10)
|
||||
G("Hay")
|
||||
P({ Size = Vector3.new(5, 3, 4), CFrame = c * CFrame.new(0, 1.5, 0), Color = HAY, Material = Enum.Material.Grass })
|
||||
P({ Size = Vector3.new(4, 1.4, 3.2), CFrame = c * CFrame.new(0.3, 3.7, 0), Color = HAY:Lerp(Color3.new(1, 1, 1), 0.1), Material = Enum.Material.Grass })
|
||||
P({ Size = Vector3.new(0.15, 4.4, 0.15), CFrame = c * CFrame.new(1.8, 3.4, 1.4) * CFrame.Angles(0, 0, math.rad(-15)), Color = WOOD })
|
||||
for i, p in ipairs({ { -3.6, 2.2, 30 }, { -2.4, 3.8, -50 }, { 3.5, 2.8, 120 } }) do
|
||||
hen(c * CFrame.new(p[1], 0, p[2]) * CFrame.Angles(0, math.rad(p[3] + i), 0))
|
||||
end
|
||||
crate(c * CFrame.new(-3.2, 0, -2.8), 2)
|
||||
tub(c * CFrame.new(3.6, 0, -2.6))
|
||||
end
|
||||
|
||||
-- указатель у дорожки
|
||||
do
|
||||
local c = at(-8.5, 40, 0)
|
||||
G("Signpost")
|
||||
P({ Size = Vector3.new(0.6, 9, 0.6), CFrame = c * CFrame.new(0, 4.5, 0), Color = WOOD })
|
||||
local function arrow(y, yaw, text)
|
||||
local board = P({ Size = Vector3.new(5.6, 1.1, 0.25), CFrame = c * CFrame.new(0, y, 0) * CFrame.Angles(0, math.rad(yaw), 0) * CFrame.new(2.6, 0, 0), Color = Color3.fromRGB(150, 104, 62) })
|
||||
P({ Class = "WedgePart", Size = Vector3.new(0.25, 1.1, 0.8), CFrame = board.CFrame * CFrame.new(3.2, 0, 0) * CFrame.Angles(0, math.rad(90), 0), Color = Color3.fromRGB(150, 104, 62) })
|
||||
for _, face in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||
local sg = Instance.new("SurfaceGui")
|
||||
sg.Face = face
|
||||
sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
sg.PixelsPerStud = 40
|
||||
sg.LightInfluence = 0.3
|
||||
sg.Parent = board
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Size = UDim2.fromScale(1, 1)
|
||||
t.BackgroundTransparency = 1
|
||||
t.FontFace = FONT
|
||||
t.TextScaled = true
|
||||
t.TextColor3 = Color3.fromRGB(255, 232, 180)
|
||||
t.TextStrokeTransparency = 0.4
|
||||
t.Text = text
|
||||
t.Parent = sg
|
||||
end
|
||||
end
|
||||
-- стрелки смотрят на свою сторону (угол — от оси X к −Z, как Roblox поворачивает вокруг Y)
|
||||
arrow(7.6, 90, "⚓ Гильдия")
|
||||
arrow(6.3, 180, "🎣 Удочки")
|
||||
arrow(5.0, 0, "⚪ Скупка")
|
||||
tub(c * CFrame.new(-1.8, 0, 1.2))
|
||||
end
|
||||
|
||||
-- гирлянды флажков между фонарями вокруг площади (столбы с плафонами на радиусе 35–55)
|
||||
do
|
||||
G("Garlands")
|
||||
local posts = {}
|
||||
for _, p in ipairs(map:GetChildren()) do
|
||||
if p:IsA("BasePart") and p.Shape == Enum.PartType.Cylinder and math.abs(p.Size.X - 9) < 0.5 and math.abs(p.Position.Y - 5.5) < 0.6 then
|
||||
local r = flat(p.Position).Magnitude
|
||||
if r > 33 and r < 56 then
|
||||
table.insert(posts, p.Position)
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(posts, function(a, b)
|
||||
return math.atan2(a.Z, a.X) < math.atan2(b.Z, b.X)
|
||||
end)
|
||||
local colors = { Color3.fromRGB(190, 50, 44), Color3.fromRGB(236, 200, 90), Color3.fromRGB(70, 110, 160), Color3.fromRGB(80, 140, 80) }
|
||||
local strings = 0
|
||||
for i = 1, #posts do
|
||||
local a, b = posts[i], posts[i % #posts + 1]
|
||||
local A, B = Vector3.new(a.X, 10.2, a.Z), Vector3.new(b.X, 10.2, b.Z)
|
||||
local len = (B - A).Magnitude
|
||||
if len > 6 and len < 42 then
|
||||
strings += 1
|
||||
local n = math.floor(len / 1.6)
|
||||
local prev
|
||||
for k = 0, n do
|
||||
local t = k / n
|
||||
local p = A:Lerp(B, t) - Vector3.new(0, math.sin(t * math.pi) * 1.6, 0)
|
||||
if prev then
|
||||
local mid = (prev + p) / 2
|
||||
P({ Size = Vector3.new(0.06, 0.06, (p - prev).Magnitude), CFrame = CFrame.lookAt(mid, p), Color = Color3.fromRGB(70, 60, 50), CanCollide = false, CanQuery = false })
|
||||
end
|
||||
if k > 0 and k < n then
|
||||
P({ Class = "WedgePart", Size = Vector3.new(0.08, 0.9, 0.7), CFrame = CFrame.lookAt(p, p + (B - A)) * CFrame.new(0, -0.45, 0) * CFrame.Angles(math.pi, 0, 0) * CFrame.Angles(0, math.rad(90), 0),
|
||||
Color = colors[(k % #colors) + 1], CanCollide = false, CanQuery = false, CastShadow = false })
|
||||
end
|
||||
prev = p
|
||||
end
|
||||
end
|
||||
end
|
||||
table.insert(report, ("гирлянды: столбов %d, гирлянд %d"):format(#posts, strings))
|
||||
end
|
||||
|
||||
-- проверка: антураж не задевает лавки, порталы, двор гильдии, доски
|
||||
local overlap = OverlapParams.new()
|
||||
overlap.FilterType = Enum.RaycastFilterType.Exclude
|
||||
overlap.FilterDescendantsInstances = { amb }
|
||||
for _, g in ipairs(amb:GetChildren()) do
|
||||
if g.Name ~= "Garlands" then
|
||||
local cf, size = g:GetBoundingBox()
|
||||
local hits = {}
|
||||
for _, p in ipairs(workspace:GetPartBoundsInBox(cf * CFrame.new(0, 0.6, 0), size - Vector3.new(0, 1.2, 0), overlap)) do
|
||||
if p.CanCollide and p.Size.X < 60 and p.Size.Z < 60 and p.Position.Y > 1.3 then
|
||||
hits[(p.Parent and p.Parent ~= map) and p.Parent.Name or p.Name] = true
|
||||
end
|
||||
end
|
||||
local list = {}
|
||||
for k in pairs(hits) do
|
||||
table.insert(list, k)
|
||||
end
|
||||
table.insert(report, g.Name .. ": " .. (#list > 0 and ("задевает " .. table.concat(list, ", ")) or "свободно"))
|
||||
end
|
||||
end
|
||||
return table.concat(report, "\n")
|
||||
@@ -0,0 +1,19 @@
|
||||
// Собирает Luau-файл для Studio: модели декора и рыбок (bbmodel-to-luau.js) + tools/lobby-fix8.lua.
|
||||
// node tools/lobby-fix8.js <out.lua>
|
||||
const fs = require('fs'), path = require('path'), { execFileSync } = require('child_process');
|
||||
const ROOT = path.join(__dirname, '..');
|
||||
const out = process.argv[2] || path.join(ROOT, 'tools', 'lobby-fix8-full.lua');
|
||||
const names = ['chicken', 'chicken_peck', 'cat_sit_ginger', 'cat_sit_gray', 'cat_lie_ginger', 'cat_lie_gray', 'flowerbed', 'flowerpot',
|
||||
'well', 'haystack', 'cart', 'nets', 'boat', 'signpost', 'bunting', 'crates_barrels'];
|
||||
const models = {};
|
||||
for (const n of names) models[n] = 'decor_' + n;
|
||||
for (const n of ['fish_gold', 'fish_koi', 'fish_carp', 'fish_roach']) models[n] = n;
|
||||
let code = '-- СГЕНЕРИРОВАНО tools/lobby-fix8.js\nlocal BUILD = {}\n';
|
||||
for (const [key, file] of Object.entries(models)) {
|
||||
const lua = path.join(ROOT, 'tools', 'lobby-models', file + '.lua');
|
||||
execFileSync('node', [path.join(__dirname, 'bbmodel-to-luau.js'), path.join(ROOT, 'assets', 'props', file + '.bbmodel'),
|
||||
path.join(ROOT, 'assets', 'props', file + '_palette.png'), lua, file], { stdio: 'ignore' });
|
||||
code += `BUILD.${key} = (function()\n${fs.readFileSync(lua, 'utf8')}\nend)()\n`;
|
||||
}
|
||||
fs.writeFileSync(out, code + fs.readFileSync(path.join(__dirname, 'lobby-fix8.lua'), 'utf8'), 'utf8');
|
||||
console.log('->', out, Math.round(code.length / 1024) + ' KB');
|
||||
@@ -0,0 +1,271 @@
|
||||
-- Правки лобби №8: декор и рыбки из Blockbench (assets/props/decor_*.bbmodel, fish_*.bbmodel) вместо деталей.
|
||||
-- Запуск: node tools/lobby-fix8.js <out.lua>, выполнить в Studio (режим редактирования), Ctrl+S. Повторный запуск
|
||||
-- пересобирает новый декор; старый (LobbyAmbience и бочки/ящики/клумбы в промежутках ряда) — в ServerStorage.Backup.LobbyFix8.
|
||||
-- Места — те же, что у декора из lobby-fix6 / lobby-decor. Всё ставится на мостовую по лучу, лицом к центру площади.
|
||||
-- Рыбки фонтана: готовые модели кладутся в ReplicatedStorage.FountainFishModels, их берёт FountainFish.client.lua.
|
||||
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local map = workspace.FishingMap
|
||||
local R = 80
|
||||
local BIG = 1.4 -- крупный декор — в масштабе лавок
|
||||
local ANIMAL = 0.7 -- куры и коты: чуть ниже колена персонажа
|
||||
local FISH = 0.9 -- рыбки ≈ 1.5 studs
|
||||
local TITLE_FONT = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Heavy)
|
||||
local report = {}
|
||||
|
||||
local backup = ServerStorage:FindFirstChild("Backup") or Instance.new("Folder")
|
||||
backup.Name = "Backup"
|
||||
backup.Parent = ServerStorage
|
||||
local store = backup:FindFirstChild("LobbyFix8")
|
||||
local first = store == nil
|
||||
if first then
|
||||
store = Instance.new("Folder")
|
||||
store.Name = "LobbyFix8"
|
||||
store.Parent = backup
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- старое → Backup
|
||||
|
||||
if first then
|
||||
local amb = map:FindFirstChild("LobbyAmbience")
|
||||
if amb then
|
||||
amb.Parent = store
|
||||
end
|
||||
-- в промежутках ряда оставляем только фонарь (детали у оси фонаря), остальное — в резерв
|
||||
local decor = map:FindFirstChild("LobbyMarketDecor")
|
||||
for _, g in ipairs(decor and decor:GetChildren() or {}) do
|
||||
local deg = tonumber(g.Name:match("^Gap_(%d+)$"))
|
||||
if deg then
|
||||
local a = math.rad(deg)
|
||||
local axis = Vector3.new(math.cos(a) * R, 0, math.sin(a) * R)
|
||||
local keep = Instance.new("Folder")
|
||||
keep.Name = g.Name
|
||||
keep:SetAttribute("Deg", deg)
|
||||
for _, p in ipairs(g:GetChildren()) do
|
||||
if p:IsA("BasePart") and (Vector3.new(p.Position.X, 0, p.Position.Z) - axis).Magnitude > 1.2 then
|
||||
p.Parent = keep
|
||||
end
|
||||
end
|
||||
keep.Parent = store
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local new = map:FindFirstChild("LobbyDecor")
|
||||
if new then
|
||||
new:Destroy()
|
||||
end
|
||||
new = Instance.new("Folder")
|
||||
new.Name = "LobbyDecor"
|
||||
new.Parent = map
|
||||
|
||||
local rayParams = RaycastParams.new()
|
||||
rayParams.FilterType = Enum.RaycastFilterType.Exclude
|
||||
rayParams.FilterDescendantsInstances = { new }
|
||||
local function floorY(x, z)
|
||||
local hit = workspace:Raycast(Vector3.new(x, 40, z), Vector3.new(0, -80, 0), rayParams)
|
||||
return hit and hit.Position.Y or 1
|
||||
end
|
||||
|
||||
-- поставить модель: точка (x, z) на полу, фасад (−Z модели) к цели (по умолчанию — к центру площади), доп. поворот yaw
|
||||
local function put(build, name, xz, scale, yaw, target)
|
||||
local x, z = xz[1], xz[2]
|
||||
local m = build(new)
|
||||
m.Name = name
|
||||
m:ScaleTo(scale)
|
||||
local p = Vector3.new(x, floorY(x, z), z)
|
||||
local t = target or Vector3.new(0, p.Y, 0)
|
||||
if (Vector3.new(t.X, p.Y, t.Z) - p).Magnitude < 0.01 then
|
||||
t = p + Vector3.new(0, 0, -1)
|
||||
end
|
||||
m:PivotTo(CFrame.lookAt(p, Vector3.new(t.X, p.Y, t.Z)) * CFrame.Angles(0, math.rad(yaw or 0), 0))
|
||||
for _, d in ipairs(m:GetDescendants()) do
|
||||
if d:IsA("BasePart") then
|
||||
d.Anchored = true
|
||||
-- мелочь не мешает ходить
|
||||
if d.Size.Magnitude < 1.2 then
|
||||
d.CanCollide = false
|
||||
end
|
||||
end
|
||||
end
|
||||
return m
|
||||
end
|
||||
-- точка в осях «уголка»: центр (cx, cz), поворот yaw (как CFrame.Angles в lobby-fix6)
|
||||
local function local2world(cx, cz, yaw, lx, lz)
|
||||
local cf = CFrame.new(cx, 0, cz) * CFrame.Angles(0, math.rad(yaw or 0), 0) * CFrame.new(lx, 0, lz)
|
||||
return { cf.X, cf.Z }
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- уголки (места как в lobby-fix6)
|
||||
|
||||
-- колодец (северо-запад)
|
||||
put(BUILD.well, "Well", { -55, -62 }, BIG)
|
||||
put(BUILD.flowerpot, "Flowerpot", local2world(-55, -62, 0, 4, 1.5), 1.0)
|
||||
put(BUILD.crates_barrels, "CratesBarrels", local2world(-55, -62, 0, -4.5, 1), BIG)
|
||||
put(BUILD.cat_lie_ginger, "Cat", local2world(-55, -62, 0, 3.2, -2.8), ANIMAL * 1.1, 40)
|
||||
|
||||
-- сети, лодка, ящики (северо-восток)
|
||||
do
|
||||
local cx, cz, yaw = 55, -62, 30
|
||||
put(BUILD.nets, "Nets", { cx, cz }, BIG)
|
||||
local boat = local2world(cx, cz, yaw, 0, 6)
|
||||
put(BUILD.boat, "Boat", boat, BIG, 90)
|
||||
put(BUILD.crates_barrels, "CratesBarrels", local2world(cx, cz, yaw, -6.5, 2.5), BIG)
|
||||
put(BUILD.cat_sit_gray, "Cat", local2world(cx, cz, yaw, 6, 2), ANIMAL)
|
||||
end
|
||||
|
||||
-- телега с бочками (юго-запад от точки появления)
|
||||
do
|
||||
local cx, cz, yaw = -17, 60, 15
|
||||
put(BUILD.cart, "Cart", { cx, cz }, BIG, 90)
|
||||
put(BUILD.flowerpot, "Flowerpot", local2world(cx, cz, yaw, 4.5, 3), 1.0)
|
||||
put(BUILD.cat_sit_ginger, "Cat", local2world(cx, cz, yaw, -3.6, 3), ANIMAL, -60)
|
||||
end
|
||||
|
||||
-- стог с вилами и куры (юго-восток от точки появления)
|
||||
do
|
||||
local cx, cz, yaw = 17, 60, -10
|
||||
put(BUILD.haystack, "Haystack", { cx, cz }, BIG)
|
||||
local hens = { { -3.6, 2.2, 30, BUILD.chicken }, { -2.4, 3.8, -50, BUILD.chicken_peck }, { 3.5, 2.8, 120, BUILD.chicken } }
|
||||
for i, h in ipairs(hens) do
|
||||
put(h[4], "Chicken_" .. i, local2world(cx, cz, yaw, h[1], h[2]), ANIMAL, h[3])
|
||||
end
|
||||
put(BUILD.crates_barrels, "CratesBarrels", local2world(cx, cz, yaw, -5.2, 1.2), BIG * 0.8)
|
||||
put(BUILD.flowerpot, "Flowerpot", local2world(cx, cz, yaw, 3.8, -2.6), 1.0)
|
||||
end
|
||||
|
||||
-- указатель у дорожки: лицом к точке появления; стрелки +X модели смотрят на запад, −X — на восток
|
||||
do
|
||||
local sign = put(BUILD.signpost, "Signpost", { -8.5, 40 }, BIG, 0, Vector3.new(-8.5, 0, 60))
|
||||
local texts = { Arrow1_Face = "🎣 Удочки", Arrow2_Face = "⚪ Скупка", Arrow3_Face = "🐛 Наживка" }
|
||||
for name, text in pairs(texts) do
|
||||
local face = sign:FindFirstChild(name, true)
|
||||
if face then
|
||||
for _, side in ipairs({ Enum.NormalId.Front, Enum.NormalId.Back }) do
|
||||
local sg = Instance.new("SurfaceGui")
|
||||
sg.Face = side
|
||||
sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
sg.PixelsPerStud = 50
|
||||
sg.LightInfluence = 0.3
|
||||
sg.Parent = face
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Size = UDim2.fromScale(1, 1)
|
||||
t.BackgroundTransparency = 1
|
||||
t.FontFace = TITLE_FONT
|
||||
t.TextScaled = true
|
||||
t.TextColor3 = Color3.fromRGB(255, 232, 180)
|
||||
t.TextStrokeTransparency = 0.4
|
||||
t.Text = text
|
||||
t.Parent = sg
|
||||
local pad = Instance.new("UIPadding")
|
||||
pad.PaddingTop, pad.PaddingBottom = UDim.new(0.1, 0), UDim.new(0.1, 0)
|
||||
pad.PaddingLeft, pad.PaddingRight = UDim.new(0.06, 0), UDim.new(0.12, 0)
|
||||
pad.Parent = t
|
||||
end
|
||||
end
|
||||
end
|
||||
put(BUILD.flowerpot, "Flowerpot", { -10.3, 41.2 }, 1.0)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- промежутки торгового ряда: ящики с бочками и клумба
|
||||
|
||||
for _, f in ipairs(store:GetChildren()) do
|
||||
local deg = f:GetAttribute("Deg")
|
||||
if deg then
|
||||
local a = math.rad(deg)
|
||||
local c, s = math.cos(a), math.sin(a)
|
||||
put(BUILD.crates_barrels, "CratesBarrels_" .. deg, { c * (R + 5), s * (R + 5) }, BIG)
|
||||
put(BUILD.flowerbed, "Flowerbed_" .. deg, { c * (R - 9), s * (R - 9) }, BIG)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- гирлянды флажков между фонарями вокруг площади
|
||||
|
||||
do
|
||||
local posts = {}
|
||||
for _, p in ipairs(map:GetChildren()) do
|
||||
if p:IsA("BasePart") and p.Shape == Enum.PartType.Cylinder and math.abs(p.Size.X - 9) < 0.5 and math.abs(p.Position.Y - 5.5) < 0.6 then
|
||||
local r = Vector3.new(p.Position.X, 0, p.Position.Z).Magnitude
|
||||
if r > 33 and r < 56 then
|
||||
table.insert(posts, p.Position)
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(posts, function(a, b)
|
||||
return math.atan2(a.Z, a.X) < math.atan2(b.Z, b.X)
|
||||
end)
|
||||
local SPAN = 8.08 * BIG -- длина одной гирлянды модели
|
||||
local n = 0
|
||||
for i = 1, #posts do
|
||||
local a, b = posts[i], posts[i % #posts + 1]
|
||||
local A, B = Vector3.new(a.X, 10.2, a.Z), Vector3.new(b.X, 10.2, b.Z)
|
||||
local len = (B - A).Magnitude
|
||||
if len > 6 and len < 42 then
|
||||
local k = math.max(1, math.ceil(len / SPAN))
|
||||
local s = len / k / 8.08
|
||||
for j = 1, k do
|
||||
local p = A:Lerp(B, (j - 0.5) / k)
|
||||
local m = BUILD.bunting(new)
|
||||
m.Name = "Bunting"
|
||||
m:ScaleTo(s)
|
||||
-- ось X модели — вдоль гирлянды; концы верёвки (на высоте 1.51 модели) — на высоте фонарей
|
||||
m:PivotTo(CFrame.lookAt(p, p + (B - A).Unit:Cross(Vector3.yAxis)) * CFrame.new(0, -1.51 * s, 0))
|
||||
for _, d in ipairs(m:GetDescendants()) do
|
||||
if d:IsA("BasePart") then
|
||||
d.Anchored, d.CanCollide, d.CanQuery, d.CastShadow = true, false, false, false
|
||||
end
|
||||
end
|
||||
n += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
table.insert(report, ("гирлянд: %d (фонарей %d)"):format(n, #posts))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- рыбки для фонтана
|
||||
|
||||
do
|
||||
local old = ReplicatedStorage:FindFirstChild("FountainFishModels")
|
||||
if old then
|
||||
old:Destroy()
|
||||
end
|
||||
local folder = Instance.new("Folder")
|
||||
folder.Name = "FountainFishModels"
|
||||
for _, k in ipairs({ "fish_gold", "fish_koi", "fish_carp", "fish_roach" }) do
|
||||
local m = BUILD[k](folder)
|
||||
m.Name = k
|
||||
m:ScaleTo(FISH)
|
||||
m:PivotTo(CFrame.new())
|
||||
for _, d in ipairs(m:GetDescendants()) do
|
||||
if d:IsA("BasePart") then
|
||||
d.Anchored, d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = true, false, false, false, false
|
||||
end
|
||||
end
|
||||
-- точка, вокруг которой виляет хвост (корень хвоста в модели: z = 0.47)
|
||||
m:SetAttribute("TailPivotZ", 0.47 * FISH)
|
||||
end
|
||||
folder.Parent = ReplicatedStorage
|
||||
table.insert(report, "рыбок-моделей: " .. #folder:GetChildren())
|
||||
end
|
||||
|
||||
-- проверка: декор не задевает лавки, порталы, двор гильдии, доски
|
||||
local overlap = OverlapParams.new()
|
||||
overlap.FilterType = Enum.RaycastFilterType.Exclude
|
||||
overlap.FilterDescendantsInstances = { new }
|
||||
for _, m in ipairs(new:GetChildren()) do
|
||||
if m.Name ~= "Bunting" then
|
||||
local cf, size = m:GetBoundingBox()
|
||||
local hits = {}
|
||||
for _, p in ipairs(workspace:GetPartBoundsInBox(cf * CFrame.new(0, 0.5, 0), size - Vector3.new(0.4, 1, 0.4), overlap)) do
|
||||
if p.CanCollide and p.Size.X < 60 and p.Size.Z < 60 and p.Position.Y > 1.3 then
|
||||
hits[(p.Parent and p.Parent ~= map) and p.Parent.Name or p.Name] = true
|
||||
end
|
||||
end
|
||||
for k in pairs(hits) do
|
||||
table.insert(report, m.Name .. " задевает " .. k)
|
||||
end
|
||||
end
|
||||
end
|
||||
table.insert(report, "декора: " .. #new:GetChildren())
|
||||
return table.concat(report, "\n")
|
||||
@@ -0,0 +1,123 @@
|
||||
-- decor_boat: модель из Blockbench (decor_boat.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Hull", "Strake1_0", 0.641, 0.27, 0.392, 0, 0.385, -1.904, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_0", 0.661, 0.08, 0.392, 0, 0.56, -1.904, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_0", 0.545, 0.22, 0.392, 0, 0.71, -1.904, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_0", 0.353, 0.15, 0.392, 0, 0.895, -1.904, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_0", 0.701, 0.08, 0.392, 0, 0.26, -1.904, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_1", 1.089, 0.27, 0.392, 0, 0.385, -1.522, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_1", 1.109, 0.08, 0.392, 0, 0.56, -1.522, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_1", 0.926, 0.22, 0.392, 0, 0.71, -1.522, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_1", 0.599, 0.15, 0.392, 0, 0.895, -1.522, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_1", 1.149, 0.08, 0.392, 0, 0.26, -1.522, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_2", 1.386, 0.27, 0.392, 0, 0.385, -1.14, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_2", 1.406, 0.08, 0.392, 0, 0.56, -1.14, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_2", 1.178, 0.22, 0.392, 0, 0.71, -1.14, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_2", 0.762, 0.15, 0.392, 0, 0.895, -1.14, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_2", 1.446, 0.08, 0.392, 0, 0.26, -1.14, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_3", 1.599, 0.27, 0.392, 0, 0.385, -0.759, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_3", 1.619, 0.08, 0.392, 0, 0.56, -0.759, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_3", 1.359, 0.22, 0.392, 0, 0.71, -0.759, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_3", 0.879, 0.15, 0.392, 0, 0.895, -0.759, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_3", 1.659, 0.08, 0.392, 0, 0.26, -0.759, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_4", 1.742, 0.27, 0.392, 0, 0.385, -0.377, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_4", 1.762, 0.08, 0.392, 0, 0.56, -0.377, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_4", 1.481, 0.22, 0.392, 0, 0.71, -0.377, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_4", 0.958, 0.15, 0.392, 0, 0.895, -0.377, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_4", 1.802, 0.08, 0.392, 0, 0.26, -0.377, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_5", 1.82, 0.27, 0.392, 0, 0.385, 0.005, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_5", 1.84, 0.08, 0.392, 0, 0.56, 0.005, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_5", 1.547, 0.22, 0.392, 0, 0.71, 0.005, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_5", 1.001, 0.15, 0.392, 0, 0.895, 0.005, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_5", 1.88, 0.08, 0.392, 0, 0.26, 0.005, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_6", 1.785, 0.27, 0.392, 0, 0.385, 0.387, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_6", 1.805, 0.08, 0.392, 0, 0.56, 0.387, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_6", 1.517, 0.22, 0.392, 0, 0.71, 0.387, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_6", 0.982, 0.15, 0.392, 0, 0.895, 0.387, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_6", 1.845, 0.08, 0.392, 0, 0.26, 0.387, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_7", 1.68, 0.27, 0.392, 0, 0.385, 0.769, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_7", 1.7, 0.08, 0.392, 0, 0.56, 0.769, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_7", 1.428, 0.22, 0.392, 0, 0.71, 0.769, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_7", 0.924, 0.15, 0.392, 0, 0.895, 0.769, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_7", 1.74, 0.08, 0.392, 0, 0.26, 0.769, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_8", 1.492, 0.27, 0.392, 0, 0.385, 1.15, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_8", 1.512, 0.08, 0.392, 0, 0.56, 1.15, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_8", 1.269, 0.22, 0.392, 0, 0.71, 1.15, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_8", 0.821, 0.15, 0.392, 0, 0.895, 1.15, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_8", 1.552, 0.08, 0.392, 0, 0.26, 1.15, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_9", 1.197, 0.27, 0.392, 0, 0.385, 1.532, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_9", 1.217, 0.08, 0.392, 0, 0.56, 1.532, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_9", 1.018, 0.22, 0.392, 0, 0.71, 1.532, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_9", 0.659, 0.15, 0.392, 0, 0.895, 1.532, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_9", 1.257, 0.08, 0.392, 0, 0.26, 1.532, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Strake1_10", 0.706, 0.27, 0.392, 0, 0.385, 1.914, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Paint_10", 0.726, 0.08, 0.392, 0, 0.56, 1.914, 0, 0, 0, 0, 0, 0, 52, 128, 140 },
|
||||
{ "Hull", "Strake2_10", 0.6, 0.22, 0.392, 0, 0.71, 1.914, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Hull", "Strake3_10", 0.388, 0.15, 0.392, 0, 0.895, 1.914, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Hull", "Gunwale_10", 0.766, 0.08, 0.392, 0, 0.26, 1.914, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Keel", 0.12, 0.11, 3.8, 0, 1.025, -0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Hull", "Stem", 0.12, 0.75, 0.16, 0, 0.675, -2.1, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Supports", "Log", 2.2, 0.25, 0.28, 0, 0.125, -1, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Supports", "Log", 2.2, 0.25, 0.28, 0, 0.125, 1, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Oars", "OarShaft", 0.08, 0.08, 2.3, 1.45, 0.06, -0.25, 1.45, 0, 0, 0, 0.209, 0, 190, 140, 92 },
|
||||
{ "Oars", "OarBlade", 0.28, 0.05, 0.7, 1.45, 0.045, 1.25, 1.45, 0, 0, 0, 0.209, 0, 190, 140, 92 },
|
||||
{ "Oars", "OarGrip", 0.1, 0.09, 0.15, 1.45, 0.065, -1.475, 1.45, 0, 0, 0, 0.209, 0, 92, 58, 36 },
|
||||
{ "Oars", "OarShaft", 0.08, 0.08, 2.3, 1.75, 0.06, -0.25, 1.75, 0, 0, 0, -0.175, 0, 190, 140, 92 },
|
||||
{ "Oars", "OarBlade", 0.28, 0.05, 0.7, 1.75, 0.045, 1.25, 1.75, 0, 0, 0, -0.175, 0, 190, 140, 92 },
|
||||
{ "Oars", "OarGrip", 0.1, 0.09, 0.15, 1.75, 0.065, -1.475, 1.75, 0, 0, 0, -0.175, 0, 92, 58, 36 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_boat"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,126 @@
|
||||
-- decor_bunting: модель из Blockbench (decor_bunting.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Rope", "Rope_0", 0.576, 0.05, 0.05, -3.75, 1.518, 0, -3.75, 1.518, 0, 0, 0, -0.317, 196, 168, 116 },
|
||||
{ "Rope", "Rope_1", 0.57, 0.05, 0.05, -3.25, 1.365, 0, -3.25, 1.365, 0, 0, 0, -0.277, 196, 168, 116 },
|
||||
{ "Rope", "Rope_2", 0.564, 0.05, 0.05, -2.75, 1.234, 0, -2.75, 1.234, 0, 0, 0, -0.236, 196, 168, 116 },
|
||||
{ "Rope", "Rope_3", 0.56, 0.05, 0.05, -2.25, 1.124, 0, -2.25, 1.124, 0, 0, 0, -0.194, 196, 168, 116 },
|
||||
{ "Rope", "Rope_4", 0.556, 0.05, 0.05, -1.75, 1.037, 0, -1.75, 1.037, 0, 0, 0, -0.152, 196, 168, 116 },
|
||||
{ "Rope", "Rope_5", 0.553, 0.05, 0.05, -1.25, 0.971, 0, -1.25, 0.971, 0, 0, 0, -0.109, 196, 168, 116 },
|
||||
{ "Rope", "Rope_6", 0.551, 0.05, 0.05, -0.75, 0.927, 0, -0.75, 0.927, 0, 0, 0, -0.066, 196, 168, 116 },
|
||||
{ "Rope", "Rope_7", 0.55, 0.05, 0.05, -0.25, 0.906, 0, -0.25, 0.906, 0, 0, 0, -0.022, 196, 168, 116 },
|
||||
{ "Rope", "Rope_8", 0.55, 0.05, 0.05, 0.25, 0.906, 0, 0.25, 0.906, 0, 0, 0, 0.022, 196, 168, 116 },
|
||||
{ "Rope", "Rope_9", 0.551, 0.05, 0.05, 0.75, 0.927, 0, 0.75, 0.927, 0, 0, 0, 0.066, 196, 168, 116 },
|
||||
{ "Rope", "Rope_10", 0.553, 0.05, 0.05, 1.25, 0.971, 0, 1.25, 0.971, 0, 0, 0, 0.109, 196, 168, 116 },
|
||||
{ "Rope", "Rope_11", 0.556, 0.05, 0.05, 1.75, 1.037, 0, 1.75, 1.037, 0, 0, 0, 0.152, 196, 168, 116 },
|
||||
{ "Rope", "Rope_12", 0.56, 0.05, 0.05, 2.25, 1.124, 0, 2.25, 1.124, 0, 0, 0, 0.194, 196, 168, 116 },
|
||||
{ "Rope", "Rope_13", 0.564, 0.05, 0.05, 2.75, 1.234, 0, 2.75, 1.234, 0, 0, 0, 0.236, 196, 168, 116 },
|
||||
{ "Rope", "Rope_14", 0.57, 0.05, 0.05, 3.25, 1.365, 0, 3.25, 1.365, 0, 0, 0, 0.277, 196, 168, 116 },
|
||||
{ "Rope", "Rope_15", 0.576, 0.05, 0.05, 3.75, 1.518, 0, 3.75, 1.518, 0, 0, 0, 0.317, 196, 168, 116 },
|
||||
{ "Rope", "Ring", 0.14, 0.14, 0.14, -4, 1.6, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Rope", "Ring", 0.14, 0.14, 0.14, 4, 1.6, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Flags", "Flag0", 0.5, 0.15, 0.05, -3.6, 1.372, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "Flag0", 0.36, 0.15, 0.05, -3.6, 1.222, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "Flag0", 0.22, 0.14, 0.05, -3.6, 1.077, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "Flag0", 0.1, 0.12, 0.05, -3.6, 0.947, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "FlagHem0", 0.54, 0.05, 0.06, -3.6, 1.437, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag1", 0.5, 0.15, 0.05, -2.8, 1.148, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "Flag1", 0.36, 0.15, 0.05, -2.8, 0.998, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "Flag1", 0.22, 0.14, 0.05, -2.8, 0.853, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "Flag1", 0.1, 0.12, 0.05, -2.8, 0.723, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "FlagHem1", 0.54, 0.05, 0.06, -2.8, 1.213, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag2", 0.5, 0.15, 0.05, -2, 0.98, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "Flag2", 0.36, 0.15, 0.05, -2, 0.83, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "Flag2", 0.22, 0.14, 0.05, -2, 0.685, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "Flag2", 0.1, 0.12, 0.05, -2, 0.555, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "FlagHem2", 0.54, 0.05, 0.06, -2, 1.045, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag3", 0.5, 0.15, 0.05, -1.2, 0.868, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "Flag3", 0.36, 0.15, 0.05, -1.2, 0.718, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "Flag3", 0.22, 0.14, 0.05, -1.2, 0.573, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "Flag3", 0.1, 0.12, 0.05, -1.2, 0.443, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "FlagHem3", 0.54, 0.05, 0.06, -1.2, 0.933, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag4", 0.5, 0.15, 0.05, -0.4, 0.812, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "Flag4", 0.36, 0.15, 0.05, -0.4, 0.662, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "Flag4", 0.22, 0.14, 0.05, -0.4, 0.517, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "Flag4", 0.1, 0.12, 0.05, -0.4, 0.387, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "FlagHem4", 0.54, 0.05, 0.06, -0.4, 0.877, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag5", 0.5, 0.15, 0.05, 0.4, 0.812, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "Flag5", 0.36, 0.15, 0.05, 0.4, 0.662, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "Flag5", 0.22, 0.14, 0.05, 0.4, 0.517, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "Flag5", 0.1, 0.12, 0.05, 0.4, 0.387, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flags", "FlagHem5", 0.54, 0.05, 0.06, 0.4, 0.877, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag6", 0.5, 0.15, 0.05, 1.2, 0.868, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "Flag6", 0.36, 0.15, 0.05, 1.2, 0.718, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "Flag6", 0.22, 0.14, 0.05, 1.2, 0.573, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "Flag6", 0.1, 0.12, 0.05, 1.2, 0.443, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Flags", "FlagHem6", 0.54, 0.05, 0.06, 1.2, 0.933, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag7", 0.5, 0.15, 0.05, 2, 0.98, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "Flag7", 0.36, 0.15, 0.05, 2, 0.83, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "Flag7", 0.22, 0.14, 0.05, 2, 0.685, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "Flag7", 0.1, 0.12, 0.05, 2, 0.555, 0, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flags", "FlagHem7", 0.54, 0.05, 0.06, 2, 1.045, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag8", 0.5, 0.15, 0.05, 2.8, 1.148, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "Flag8", 0.36, 0.15, 0.05, 2.8, 0.998, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "Flag8", 0.22, 0.14, 0.05, 2.8, 0.853, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "Flag8", 0.1, 0.12, 0.05, 2.8, 0.723, 0, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flags", "FlagHem8", 0.54, 0.05, 0.06, 2.8, 1.213, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Flags", "Flag9", 0.5, 0.15, 0.05, 3.6, 1.372, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "Flag9", 0.36, 0.15, 0.05, 3.6, 1.222, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "Flag9", 0.22, 0.14, 0.05, 3.6, 1.077, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "Flag9", 0.1, 0.12, 0.05, 3.6, 0.947, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flags", "FlagHem9", 0.54, 0.05, 0.06, 3.6, 1.437, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_bunting"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,165 @@
|
||||
-- decor_cart: модель из Blockbench (decor_cart.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Bed", "Floor_0", 1.8, 0.15, 0.42, 0, 1.025, -1.09, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Bed", "Floor_1", 1.8, 0.15, 0.42, 0, 1.025, -0.655, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Floor_2", 1.8, 0.15, 0.42, 0, 1.025, -0.22, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Bed", "Floor_3", 1.8, 0.15, 0.42, 0, 1.025, 0.215, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Floor_4", 1.8, 0.15, 0.42, 0, 1.025, 0.65, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Bed", "Floor_5", 1.8, 0.15, 0.42, 0, 1.025, 1.085, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Side", 0.1, 0.2, 2.6, -0.9, 1.2, 0, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Side", 0.1, 0.2, 2.6, -0.9, 1.42, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Bed", "Stake", 0.14, 0.77, 0.12, -0.9, 1.335, -1.25, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "Stake", 0.14, 0.77, 0.12, -0.9, 1.335, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "Stake", 0.14, 0.77, 0.12, -0.9, 1.335, 1.25, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "Side", 0.1, 0.2, 2.6, 0.9, 1.2, 0, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Side", 0.1, 0.2, 2.6, 0.9, 1.42, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Bed", "Stake", 0.14, 0.77, 0.12, 0.9, 1.335, -1.25, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "Stake", 0.14, 0.77, 0.12, 0.9, 1.335, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "Stake", 0.14, 0.77, 0.12, 0.9, 1.335, 1.25, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "Back", 1.8, 0.4, 0.07, 0, 1.3, 1.285, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Front", 1.8, 0.4, 0.07, 0, 1.3, -1.285, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Bed", "Axle", 2.4, 0.14, 0.14, 0, 0.75, 0.2, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Bed", "Bolster", 1.7, 0.13, 0.3, 0, 0.885, 0.2, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Bed", "BolsterF", 1.7, 0.13, 0.3, 0, 0.885, -0.85, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_0", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_1", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 0.785, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_2", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 1.571, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_3", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 2.356, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_4", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 3.142, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_5", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 3.927, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_6", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 4.712, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_7", 0.14, 0.13, 0.661, -1.07, 1.435, 0.2, -1.07, 0.75, 0.2, 5.498, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Tyre_0", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 0.393, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_1", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 1.178, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_2", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 1.963, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_3", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 2.749, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_4", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 3.534, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_5", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 4.32, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_6", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 5.105, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_7", 0.15, 0.05, 0.661, -1.07, 1.495, 0.2, -1.07, 0.75, 0.2, 5.89, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Spoke_0", 0.08, 1.3, 0.08, -1.07, 0.75, 0.2, -1.07, 0.75, 0.2, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Spoke_1", 0.08, 1.3, 0.08, -1.07, 0.75, 0.2, -1.07, 0.75, 0.2, 0.785, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Spoke_2", 0.08, 1.3, 0.08, -1.07, 0.75, 0.2, -1.07, 0.75, 0.2, 1.571, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Spoke_3", 0.08, 1.3, 0.08, -1.07, 0.75, 0.2, -1.07, 0.75, 0.2, 2.356, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Hub", 0.24, 0.26, 0.26, -1.07, 0.75, 0.2, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "HubCap", 0.08, 0.14, 0.14, -1.17, 0.75, 0.2, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Rim_0", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_1", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 0.785, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_2", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 1.571, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_3", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 2.356, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_4", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 3.142, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_5", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 3.927, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Rim_6", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 4.712, 0, 0, 138, 88, 52 },
|
||||
{ "Wheels", "Rim_7", 0.14, 0.13, 0.661, 1.07, 1.435, 0.2, 1.07, 0.75, 0.2, 5.498, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "Tyre_0", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 0.393, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_1", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 1.178, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_2", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 1.963, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_3", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 2.749, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_4", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 3.534, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_5", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 4.32, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_6", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 5.105, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Tyre_7", 0.15, 0.05, 0.661, 1.07, 1.495, 0.2, 1.07, 0.75, 0.2, 5.89, 0, 0, 62, 62, 68 },
|
||||
{ "Wheels", "Spoke_0", 0.08, 1.3, 0.08, 1.07, 0.75, 0.2, 1.07, 0.75, 0.2, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Spoke_1", 0.08, 1.3, 0.08, 1.07, 0.75, 0.2, 1.07, 0.75, 0.2, 0.785, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Spoke_2", 0.08, 1.3, 0.08, 1.07, 0.75, 0.2, 1.07, 0.75, 0.2, 1.571, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Spoke_3", 0.08, 1.3, 0.08, 1.07, 0.75, 0.2, 1.07, 0.75, 0.2, 2.356, 0, 0, 160, 104, 62 },
|
||||
{ "Wheels", "Hub", 0.24, 0.26, 0.26, 1.07, 0.75, 0.2, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Wheels", "HubCap", 0.08, 0.14, 0.14, 1.17, 0.75, 0.2, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Shafts", "Shaft", 0.12, 0.12, 1.95, -0.45, 1, -1.975, 0, 1, -1.2, -0.489, 0, 0, 160, 104, 62 },
|
||||
{ "Shafts", "Shaft", 0.12, 0.12, 1.95, 0.45, 1, -1.975, 0, 1, -1.2, -0.489, 0, 0, 160, 104, 62 },
|
||||
{ "Shafts", "ShaftBar", 1, 0.12, 0.12, 0, 1, -2.54, 0, 1, -1.2, -0.489, 0, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelA_S0", 0.568, 0.22, 0.568, -0.38, 1.21, -0.65, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelA_S0R", 0.568, 0.22, 0.568, -0.38, 1.21, -0.65, -0.38, 0, -0.65, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelA_S1", 0.631, 0.56, 0.631, -0.38, 1.6, -0.65, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Cargo", "BarrelA_S1R", 0.631, 0.56, 0.631, -0.38, 1.6, -0.65, -0.38, 0, -0.65, 0, 0.785, 0, 160, 104, 62 },
|
||||
{ "Cargo", "BarrelA_S2", 0.568, 0.22, 0.568, -0.38, 1.99, -0.65, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelA_S2R", 0.568, 0.22, 0.568, -0.38, 1.99, -0.65, -0.38, 0, -0.65, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelA_Band", 0.692, 0.12, 0.692, -0.38, 1.31, -0.65, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelA_BandR", 0.692, 0.12, 0.692, -0.38, 1.31, -0.65, -0.38, 0, -0.65, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelA_Band", 0.692, 0.12, 0.692, -0.38, 1.96, -0.65, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelA_BandR", 0.692, 0.12, 0.692, -0.38, 1.96, -0.65, -0.38, 0, -0.65, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelA_Lid", 0.448, 0.05, 0.448, -0.38, 2.12, -0.65, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelA_LidR", 0.448, 0.05, 0.448, -0.38, 2.12, -0.65, -0.38, 0, -0.65, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelB_S0", 0.508, 0.187, 0.508, 0.38, 1.194, -0.55, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelB_S0R", 0.508, 0.187, 0.508, 0.38, 1.194, -0.55, 0.38, 0, -0.55, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelB_S1", 0.564, 0.476, 0.564, 0.38, 1.525, -0.55, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelB_S1R", 0.564, 0.476, 0.564, 0.38, 1.525, -0.55, 0.38, 0, -0.55, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelB_S2", 0.508, 0.187, 0.508, 0.38, 1.857, -0.55, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelB_S2R", 0.508, 0.187, 0.508, 0.38, 1.857, -0.55, 0.38, 0, -0.55, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelB_Band", 0.628, 0.12, 0.628, 0.38, 1.288, -0.55, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelB_BandR", 0.628, 0.12, 0.628, 0.38, 1.288, -0.55, 0.38, 0, -0.55, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelB_Band", 0.628, 0.12, 0.628, 0.38, 1.84, -0.55, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelB_BandR", 0.628, 0.12, 0.628, 0.38, 1.84, -0.55, 0.38, 0, -0.55, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelB_Lid", 0.388, 0.05, 0.388, 0.38, 1.97, -0.55, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Cargo", "BarrelB_LidR", 0.388, 0.05, 0.388, 0.38, 1.97, -0.55, 0.38, 0, -0.55, 0, 0.785, 0, 160, 104, 62 },
|
||||
{ "Cargo", "BarrelC_S0", 0.598, 0.231, 0.598, 0, 1.216, 0.55, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelC_S0R", 0.598, 0.231, 0.598, 0, 1.216, 0.55, 0, 0, 0.55, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelC_S1", 0.664, 0.588, 0.664, 0, 1.625, 0.55, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Cargo", "BarrelC_S1R", 0.664, 0.588, 0.664, 0, 1.625, 0.55, 0, 0, 0.55, 0, 0.785, 0, 160, 104, 62 },
|
||||
{ "Cargo", "BarrelC_S2", 0.598, 0.231, 0.598, 0, 2.035, 0.55, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelC_S2R", 0.598, 0.231, 0.598, 0, 2.035, 0.55, 0, 0, 0.55, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Cargo", "BarrelC_Band", 0.724, 0.12, 0.724, 0, 1.318, 0.55, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelC_BandR", 0.724, 0.12, 0.724, 0, 1.318, 0.55, 0, 0, 0.55, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelC_Band", 0.724, 0.12, 0.724, 0, 2, 0.55, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelC_BandR", 0.724, 0.12, 0.724, 0, 2, 0.55, 0, 0, 0.55, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Cargo", "BarrelC_Lid", 0.478, 0.05, 0.478, 0, 2.17, 0.55, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Cargo", "BarrelC_LidR", 0.478, 0.05, 0.478, 0, 2.17, 0.55, 0, 0, 0.55, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Cargo", "Sack", 0.45, 0.45, 0.45, 0.575, 1.325, 0.975, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Cargo", "SackTop", 0.21, 0.13, 0.21, 0.575, 1.615, 0.975, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Cargo", "SackTie", 0.25, 0.05, 0.25, 0.575, 1.555, 0.975, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_cart"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,92 @@
|
||||
-- decor_cat_lie_ginger: модель из Blockbench (decor_cat_lie_ginger.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Cat", "Body", 0.48, 0.4, 0.87, 0, 0.2, 0.185, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Chest", 0.34, 0.28, 0.05, 0, 0.16, -0.265, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Paw", 0.13, 0.09, 0.31, -0.1, 0.045, -0.395, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Hind", 0.1, 0.28, 0.33, -0.24, 0.14, 0.415, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, -0.24, 0.25, 0.03, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, -0.24, 0.25, 0.23, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, -0.24, 0.25, 0.43, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "Paw", 0.13, 0.09, 0.31, 0.1, 0.045, -0.395, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Hind", 0.1, 0.28, 0.33, 0.24, 0.14, 0.415, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, 0.24, 0.25, 0.03, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, 0.24, 0.25, 0.23, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, 0.24, 0.25, 0.43, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, -0.02, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, 0.18, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, 0.38, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, 0.55, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "Head", 0.42, 0.34, 0.34, 0, 0.36, -0.36, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Cheeks", 0.5, 0.13, 0.2, 0, 0.275, -0.38, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Muzzle", 0.2, 0.12, 0.06, 0, 0.26, -0.54, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Nose", 0.06, 0.05, 0.05, 0, 0.32, -0.575, 0, 0, 0, 0, 0, 0, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, -0.09, 0.4, -0.532, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, -0.09, 0.4, -0.538, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, -0.13, 0.54, -0.36, -0.13, 0.54, -0.36, 0, 0, 0.785, 226, 138, 62 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, -0.13, 0.545, -0.402, -0.13, 0.54, -0.36, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, 0.09, 0.4, -0.532, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, 0.09, 0.4, -0.538, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, 0.13, 0.54, -0.36, 0.13, 0.54, -0.36, 0, 0, 0.785, 226, 138, 62 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, 0.13, 0.545, -0.402, 0.13, 0.54, -0.36, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, -0.07, 0.535, -0.37, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0, 0.535, -0.37, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0.07, 0.535, -0.37, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "Tail1", 0.12, 0.12, 0.4, 0.26, 0.06, 0.75, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Tail2", 0.3, 0.12, 0.12, 0.47, 0.06, 0.81, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "TailTip", 0.12, 0.11, 0.27, 0.68, 0.055, 0.735, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_cat_lie_ginger"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,92 @@
|
||||
-- decor_cat_lie_gray: модель из Blockbench (decor_cat_lie_gray.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Cat", "Body", 0.48, 0.4, 0.87, 0, 0.2, 0.185, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Chest", 0.34, 0.28, 0.05, 0, 0.16, -0.265, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Paw", 0.13, 0.09, 0.31, -0.1, 0.045, -0.395, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Hind", 0.1, 0.28, 0.33, -0.24, 0.14, 0.415, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, -0.24, 0.25, 0.03, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, -0.24, 0.25, 0.23, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, -0.24, 0.25, 0.43, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "Paw", 0.13, 0.09, 0.31, 0.1, 0.045, -0.395, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Hind", 0.1, 0.28, 0.33, 0.24, 0.14, 0.415, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, 0.24, 0.25, 0.03, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, 0.24, 0.25, 0.23, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "SideStripe", 0.05, 0.26, 0.06, 0.24, 0.25, 0.43, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, -0.02, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, 0.18, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, 0.38, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.06, 0, 0.405, 0.55, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "Head", 0.42, 0.34, 0.34, 0, 0.36, -0.36, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Cheeks", 0.5, 0.13, 0.2, 0, 0.275, -0.38, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Muzzle", 0.2, 0.12, 0.06, 0, 0.26, -0.54, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Nose", 0.06, 0.05, 0.05, 0, 0.32, -0.575, 0, 0, 0, 0, 0, 0, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, -0.09, 0.4, -0.532, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, -0.09, 0.4, -0.538, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, -0.13, 0.54, -0.36, -0.13, 0.54, -0.36, 0, 0, 0.785, 140, 140, 146 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, -0.13, 0.545, -0.402, -0.13, 0.54, -0.36, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, 0.09, 0.4, -0.532, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, 0.09, 0.4, -0.538, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, 0.13, 0.54, -0.36, 0.13, 0.54, -0.36, 0, 0, 0.785, 140, 140, 146 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, 0.13, 0.545, -0.402, 0.13, 0.54, -0.36, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, -0.07, 0.535, -0.37, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0, 0.535, -0.37, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0.07, 0.535, -0.37, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "Tail1", 0.12, 0.12, 0.4, 0.26, 0.06, 0.75, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Tail2", 0.3, 0.12, 0.12, 0.47, 0.06, 0.81, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "TailTip", 0.12, 0.11, 0.27, 0.68, 0.055, 0.735, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_cat_lie_gray"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,92 @@
|
||||
-- decor_cat_sit_ginger: модель из Blockbench (decor_cat_sit_ginger.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Cat", "Haunch", 0.58, 0.5, 0.5, 0, 0.25, 0.2, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Torso", 0.42, 0.64, 0.38, 0, 0.62, 0.02, 0, 0.62, 0.02, 0.209, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Chest", 0.3, 0.44, 0.1, 0, 0.55, -0.16, 0, 0.55, -0.16, 0.14, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "FrontLeg", 0.12, 0.45, 0.12, -0.1, 0.275, -0.22, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Paw", 0.14, 0.07, 0.17, -0.1, 0.035, -0.245, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HindPaw", 0.14, 0.07, 0.2, -0.22, 0.035, -0.04, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, -0.29, 0.175, 0.2, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, -0.29, 0.325, 0.2, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "FrontLeg", 0.12, 0.45, 0.12, 0.1, 0.275, -0.22, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Paw", 0.14, 0.07, 0.17, 0.1, 0.035, -0.245, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HindPaw", 0.14, 0.07, 0.2, 0.22, 0.035, -0.04, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, 0.29, 0.175, 0.2, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, 0.29, 0.325, 0.2, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.05, 0, 0.55, 0.215, 0, 0.55, 0.215, 0.209, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.05, 0, 0.72, 0.215, 0, 0.72, 0.215, 0.209, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.05, 0, 0.88, 0.215, 0, 0.88, 0.215, 0.209, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "Head", 0.42, 0.34, 0.34, 0, 1.08, -0.1, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Cheeks", 0.5, 0.13, 0.2, 0, 0.995, -0.12, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Muzzle", 0.2, 0.12, 0.06, 0, 0.98, -0.28, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Nose", 0.06, 0.05, 0.05, 0, 1.04, -0.315, 0, 0, 0, 0, 0, 0, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, -0.09, 1.12, -0.272, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, -0.09, 1.12, -0.278, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, -0.13, 1.26, -0.1, -0.13, 1.26, -0.1, 0, 0, 0.785, 226, 138, 62 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, -0.13, 1.265, -0.143, -0.13, 1.26, -0.1, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, 0.09, 1.12, -0.272, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, 0.09, 1.12, -0.278, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, 0.13, 1.26, -0.1, 0.13, 1.26, -0.1, 0, 0, 0.785, 226, 138, 62 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, 0.13, 1.265, -0.143, 0.13, 1.26, -0.1, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, -0.07, 1.255, -0.11, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0, 1.255, -0.11, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0.07, 1.255, -0.11, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
{ "Cat", "Tail1", 0.12, 0.12, 0.45, 0.31, 0.06, 0.225, 0, 0, 0, 0, 0, 0, 226, 138, 62 },
|
||||
{ "Cat", "Tail2", 0.12, 0.12, 0.34, 0.24, 0.06, -0.15, 0.31, 0, 0, 0, -0.524, 0, 226, 138, 62 },
|
||||
{ "Cat", "TailTip", 0.22, 0.11, 0.12, 0.11, 0.055, -0.36, 0, 0, 0, 0, 0, 0, 178, 96, 40 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_cat_sit_ginger"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,92 @@
|
||||
-- decor_cat_sit_gray: модель из Blockbench (decor_cat_sit_gray.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Cat", "Haunch", 0.58, 0.5, 0.5, 0, 0.25, 0.2, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Torso", 0.42, 0.64, 0.38, 0, 0.62, 0.02, 0, 0.62, 0.02, 0.209, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Chest", 0.3, 0.44, 0.1, 0, 0.55, -0.16, 0, 0.55, -0.16, 0.14, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "FrontLeg", 0.12, 0.45, 0.12, -0.1, 0.275, -0.22, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Paw", 0.14, 0.07, 0.17, -0.1, 0.035, -0.245, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HindPaw", 0.14, 0.07, 0.2, -0.22, 0.035, -0.04, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, -0.29, 0.175, 0.2, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, -0.29, 0.325, 0.2, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "FrontLeg", 0.12, 0.45, 0.12, 0.1, 0.275, -0.22, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Paw", 0.14, 0.07, 0.17, 0.1, 0.035, -0.245, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HindPaw", 0.14, 0.07, 0.2, 0.22, 0.035, -0.04, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, 0.29, 0.175, 0.2, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "HaunchStripe", 0.05, 0.05, 0.4, 0.29, 0.325, 0.2, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.05, 0, 0.55, 0.215, 0, 0.55, 0.215, 0.209, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.05, 0, 0.72, 0.215, 0, 0.72, 0.215, 0.209, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "BackStripe", 0.34, 0.05, 0.05, 0, 0.88, 0.215, 0, 0.88, 0.215, 0.209, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "Head", 0.42, 0.34, 0.34, 0, 1.08, -0.1, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Cheeks", 0.5, 0.13, 0.2, 0, 0.995, -0.12, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Muzzle", 0.2, 0.12, 0.06, 0, 0.98, -0.28, 0, 0, 0, 0, 0, 0, 244, 238, 226 },
|
||||
{ "Cat", "Nose", 0.06, 0.05, 0.05, 0, 1.04, -0.315, 0, 0, 0, 0, 0, 0, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, -0.09, 1.12, -0.272, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, -0.09, 1.12, -0.278, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, -0.13, 1.26, -0.1, -0.13, 1.26, -0.1, 0, 0, 0.785, 140, 140, 146 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, -0.13, 1.265, -0.143, -0.13, 1.26, -0.1, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "Eye", 0.09, 0.08, 0.05, 0.09, 1.12, -0.272, 0, 0, 0, 0, 0, 0, 120, 196, 90 },
|
||||
{ "Cat", "Pupil", 0.05, 0.07, 0.05, 0.09, 1.12, -0.278, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Cat", "Ear", 0.16, 0.16, 0.08, 0.13, 1.26, -0.1, 0.13, 1.26, -0.1, 0, 0, 0.785, 140, 140, 146 },
|
||||
{ "Cat", "EarIn", 0.09, 0.09, 0.05, 0.13, 1.265, -0.143, 0.13, 1.26, -0.1, 0, 0, 0.785, 232, 140, 150 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, -0.07, 1.255, -0.11, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0, 1.255, -0.11, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "HeadStripe", 0.05, 0.05, 0.22, 0.07, 1.255, -0.11, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
{ "Cat", "Tail1", 0.12, 0.12, 0.45, 0.31, 0.06, 0.225, 0, 0, 0, 0, 0, 0, 140, 140, 146 },
|
||||
{ "Cat", "Tail2", 0.12, 0.12, 0.34, 0.24, 0.06, -0.15, 0.31, 0, 0, 0, -0.524, 0, 140, 140, 146 },
|
||||
{ "Cat", "TailTip", 0.22, 0.11, 0.12, 0.11, 0.055, -0.36, 0, 0, 0, 0, 0, 0, 96, 96, 104 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_cat_sit_gray"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,88 @@
|
||||
-- decor_chicken: модель из Blockbench (decor_chicken.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Legs", "Leg", 0.07, 0.49, 0.07, -0.12, 0.275, 0, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeF", 0.05, 0.05, 0.2, -0.12, 0.02, -0.1, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeL", 0.05, 0.05, 0.17, -0.12, 0.02, -0.085, -0.12, 0, 0, 0, 0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeR", 0.05, 0.05, 0.17, -0.12, 0.02, -0.085, -0.12, 0, 0, 0, -0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeB", 0.05, 0.05, 0.09, -0.12, 0.02, 0.045, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "Leg", 0.07, 0.49, 0.07, 0.12, 0.275, 0, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeF", 0.05, 0.05, 0.2, 0.12, 0.02, -0.1, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeL", 0.05, 0.05, 0.17, 0.12, 0.02, -0.085, 0.12, 0, 0, 0, 0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeR", 0.05, 0.05, 0.17, 0.12, 0.02, -0.085, 0.12, 0, 0, 0, -0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeB", 0.05, 0.05, 0.09, 0.12, 0.02, 0.045, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Body", "Body", 0.6, 0.48, 0.72, 0, 0.8, 0.05, 0, 0, 0, 0, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Breast", 0.5, 0.42, 0.2, 0, 0.74, -0.3, 0, 0, 0, 0, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Belly", 0.48, 0.1, 0.56, 0, 0.58, 0.05, 0, 0, 0, 0, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "Rear", 0.48, 0.4, 0.2, 0, 0.96, 0.4, 0, 0, 0, 0, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Tail1", 0.34, 0.4, 0.14, 0, 1.22, 0.5, 0, 1.22, 0.5, 0.436, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Tail2", 0.22, 0.3, 0.1, 0, 1.36, 0.6, 0, 1.36, 0.6, 0.663, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingL", 0.07, 0.3, 0.5, -0.31, 0.83, 0.1, -0.31, 0.83, 0.1, -0.14, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingR", 0.07, 0.3, 0.5, 0.31, 0.83, 0.1, 0.31, 0.83, 0.1, -0.14, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingTipL", 0.06, 0.16, 0.12, -0.3, 0.74, 0.34, 0, 0, 0, 0, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingTipR", 0.06, 0.16, 0.12, 0.3, 0.74, 0.34, 0, 0, 0, 0, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "Neck", 0.3, 0.28, 0.26, 0, 1.08, -0.3, 0, 0, 0, 0, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Head", 0.28, 0.26, 0.28, 0, 1.3, -0.36, 0, 0, 0, 0, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Beak", 0.1, 0.07, 0.12, 0, 1.29, -0.55, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Body", "BeakLow", 0.07, 0.05, 0.08, 0, 1.245, -0.52, 0, 0, 0, 0, 0, 0, 200, 120, 36 },
|
||||
{ "Body", "Wattle", 0.07, 0.12, 0.06, 0, 1.17, -0.48, 0, 0, 0, 0, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "Comb1", 0.07, 0.1, 0.09, 0, 1.47, -0.44, 0, 0, 0, 0, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "Comb2", 0.07, 0.14, 0.1, 0, 1.5, -0.35, 0, 0, 0, 0, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "Comb3", 0.07, 0.1, 0.09, 0, 1.47, -0.26, 0, 0, 0, 0, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "EyeL", 0.05, 0.06, 0.06, -0.145, 1.33, -0.42, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "EyeR", 0.05, 0.06, 0.06, 0.145, 1.33, -0.42, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_chicken"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,91 @@
|
||||
-- decor_chicken_peck: модель из Blockbench (decor_chicken_peck.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Legs", "Leg", 0.07, 0.49, 0.07, -0.12, 0.275, 0, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeF", 0.05, 0.05, 0.2, -0.12, 0.02, -0.1, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeL", 0.05, 0.05, 0.17, -0.12, 0.02, -0.085, -0.12, 0, 0, 0, 0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeR", 0.05, 0.05, 0.17, -0.12, 0.02, -0.085, -0.12, 0, 0, 0, -0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeB", 0.05, 0.05, 0.09, -0.12, 0.02, 0.045, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "Leg", 0.07, 0.49, 0.07, 0.12, 0.275, 0, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeF", 0.05, 0.05, 0.2, 0.12, 0.02, -0.1, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeL", 0.05, 0.05, 0.17, 0.12, 0.02, -0.085, 0.12, 0, 0, 0, 0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeR", 0.05, 0.05, 0.17, 0.12, 0.02, -0.085, 0.12, 0, 0, 0, -0.611, 0, 240, 168, 50 },
|
||||
{ "Legs", "ToeB", 0.05, 0.05, 0.09, 0.12, 0.02, 0.045, 0, 0, 0, 0, 0, 0, 240, 168, 50 },
|
||||
{ "Body", "Body", 0.6, 0.48, 0.72, 0, 0.623, -0.149, 0, 0.623, -0.149, -0.96, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Breast", 0.5, 0.42, 0.2, 0, 0.302, -0.301, 0, 0.302, -0.301, -0.96, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Belly", 0.48, 0.1, 0.56, 0, 0.497, 0.031, 0, 0.497, 0.031, -0.96, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "Rear", 0.48, 0.4, 0.2, 0, 1.002, -0.08, 0, 1.002, -0.08, -0.96, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Tail1", 0.34, 0.4, 0.14, 0, 1.233, -0.235, 0, 1.233, -0.235, -0.524, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Tail2", 0.22, 0.3, 0.1, 0, 1.395, -0.293, 0, 1.395, -0.293, -0.297, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingL", 0.07, 0.3, 0.5, -0.31, 0.681, -0.145, -0.31, 0.681, -0.145, -1.1, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingR", 0.07, 0.3, 0.5, 0.31, 0.681, -0.145, 0.31, 0.681, -0.145, -1.1, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingTipL", 0.06, 0.16, 0.12, -0.3, 0.826, 0.066, -0.3, 0.826, 0.066, -0.96, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "WingTipR", 0.06, 0.16, 0.12, 0.3, 0.826, 0.066, 0.3, 0.826, 0.066, -0.96, 0, 0, 214, 206, 192 },
|
||||
{ "Body", "Neck", 0.3, 0.28, 0.26, 0, 0.497, -0.58, 0, 0.497, -0.58, -0.96, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Head", 0.28, 0.26, 0.28, 0, 0.574, -0.794, 0, 0.574, -0.794, -0.96, 0, 0, 240, 236, 226 },
|
||||
{ "Body", "Beak", 0.1, 0.07, 0.12, 0, 0.413, -0.895, 0, 0.413, -0.895, -0.96, 0, 0, 240, 168, 50 },
|
||||
{ "Body", "BeakLow", 0.07, 0.05, 0.08, 0, 0.412, -0.841, 0, 0.412, -0.841, -0.96, 0, 0, 200, 120, 36 },
|
||||
{ "Body", "Wattle", 0.07, 0.12, 0.06, 0, 0.401, -0.757, 0, 0.401, -0.757, -0.96, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "Comb1", 0.07, 0.1, 0.09, 0, 0.606, -0.979, 0, 0.606, -0.979, -0.96, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "Comb2", 0.07, 0.14, 0.1, 0, 0.697, -0.952, 0, 0.697, -0.952, -0.96, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "Comb3", 0.07, 0.1, 0.09, 0, 0.754, -0.876, 0, 0.754, -0.876, -0.96, 0, 0, 210, 44, 44 },
|
||||
{ "Body", "EyeL", 0.05, 0.06, 0.06, -0.145, 0.542, -0.853, -0.145, 0.542, -0.853, -0.96, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "EyeR", 0.05, 0.06, 0.06, 0.145, 0.542, -0.853, 0.145, 0.542, -0.853, -0.96, 0, 0, 24, 24, 30 },
|
||||
{ "Grain", "Grain", 0.06, 0.05, 0.06, 0.05, 0.015, -0.75, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
{ "Grain", "Grain", 0.06, 0.05, 0.06, -0.1, 0.015, -0.68, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
{ "Grain", "Grain", 0.06, 0.05, 0.06, 0.12, 0.015, -0.62, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_chicken_peck"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,133 @@
|
||||
-- decor_crates_barrels: модель из Blockbench (decor_crates_barrels.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Crates", "CrateA_Box", 1.1, 1.08, 1, -0.9, 0.54, 0.05, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Crates", "CrateA_Post", 0.12, 1.1, 0.12, -1.44, 0.55, -0.44, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_Post", 0.12, 1.1, 0.12, -0.36, 0.55, -0.44, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_Post", 0.12, 1.1, 0.12, -1.44, 0.55, 0.54, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_Post", 0.12, 1.1, 0.12, -0.36, 0.55, 0.54, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailF", 1.2, 0.12, 0.14, -0.9, 0.06, -0.45, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailB", 1.2, 0.12, 0.14, -0.9, 0.06, 0.55, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailL", 0.14, 0.12, 1.1, -1.45, 0.06, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailR", 0.14, 0.12, 1.1, -0.35, 0.06, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailF", 1.2, 0.12, 0.14, -0.9, 1.04, -0.45, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailB", 1.2, 0.12, 0.14, -0.9, 1.04, 0.55, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailL", 0.14, 0.12, 1.1, -1.45, 1.04, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_RailR", 0.14, 0.12, 1.1, -0.35, 1.04, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateA_Diag", 1.378, 0.1, 0.07, -0.731, 0.11, -0.495, -1.42, 0.06, -0.5, 0, 0, 0.742, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_Box", 0.7, 0.68, 0.7, -0.9, 1.44, 0.05, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Crates", "CrateB_Post", 0.12, 0.7, 0.12, -1.24, 1.45, -0.29, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_Post", 0.12, 0.7, 0.12, -0.56, 1.45, -0.29, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_Post", 0.12, 0.7, 0.12, -1.24, 1.45, 0.39, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_Post", 0.12, 0.7, 0.12, -0.56, 1.45, 0.39, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailF", 0.8, 0.12, 0.14, -0.9, 1.16, -0.3, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailB", 0.8, 0.12, 0.14, -0.9, 1.16, 0.4, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailL", 0.14, 0.12, 0.8, -1.25, 1.16, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailR", 0.14, 0.12, 0.8, -0.55, 1.16, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailF", 0.8, 0.12, 0.14, -0.9, 1.74, -0.3, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailB", 0.8, 0.12, 0.14, -0.9, 1.74, 0.4, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailL", 0.14, 0.12, 0.8, -1.25, 1.74, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_RailR", 0.14, 0.12, 0.8, -0.55, 1.74, 0.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateB_Diag", 0.813, 0.1, 0.07, -0.813, 1.21, -0.345, -1.22, 1.16, -0.35, 0, 0, 0.719, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_Box", 0.9, 0.5, 0.75, 0.3, 0.25, -0.675, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Crates", "CrateC_Post", 0.12, 0.75, 0.12, -0.14, 0.375, -1.04, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_Post", 0.12, 0.75, 0.12, 0.74, 0.375, -1.04, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_Post", 0.12, 0.75, 0.12, -0.14, 0.375, -0.31, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_Post", 0.12, 0.75, 0.12, 0.74, 0.375, -0.31, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailF", 1, 0.12, 0.14, 0.3, 0.06, -1.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailB", 1, 0.12, 0.14, 0.3, 0.06, -0.3, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailL", 0.14, 0.12, 0.85, -0.15, 0.06, -0.675, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailR", 0.14, 0.12, 0.85, 0.75, 0.06, -0.675, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailF", 1, 0.12, 0.14, 0.3, 0.69, -1.05, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailB", 1, 0.12, 0.14, 0.3, 0.69, -0.3, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailL", 0.14, 0.12, 0.85, -0.15, 0.69, -0.675, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_RailR", 0.14, 0.12, 0.85, 0.75, 0.69, -0.675, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crates", "CrateC_Diag", 1, 0.1, 0.07, 0.38, 0.11, -1.095, -0.12, 0.06, -1.1, 0, 0, 0.644, 92, 58, 36 },
|
||||
{ "Crates", "Apple_0", 0.22, 0.2, 0.22, 0.05, 0.65, -0.9, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Crates", "Apple_1", 0.22, 0.2, 0.22, 0.35, 0.65, -0.85, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Crates", "Apple_2", 0.22, 0.2, 0.22, 0.6, 0.65, -0.55, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Crates", "Apple_3", 0.22, 0.2, 0.22, 0.2, 0.65, -0.5, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Crates", "Apple_4", 0.22, 0.2, 0.22, 0.5, 0.65, -0.95, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Crates", "Apple_5", 0.22, 0.2, 0.22, -0.02, 0.65, -0.6, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Barrels", "Barrel1_S0", 0.777, 0.286, 0.777, 1.25, 0.143, 0.25, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Barrels", "Barrel1_S0R", 0.777, 0.286, 0.777, 1.25, 0.143, 0.25, 1.25, 0, 0.25, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Barrels", "Barrel1_S1", 0.863, 0.728, 0.863, 1.25, 0.65, 0.25, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Barrels", "Barrel1_S1R", 0.863, 0.728, 0.863, 1.25, 0.65, 0.25, 1.25, 0, 0.25, 0, 0.785, 0, 160, 104, 62 },
|
||||
{ "Barrels", "Barrel1_S2", 0.777, 0.286, 0.777, 1.25, 1.157, 0.25, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Barrels", "Barrel1_S2R", 0.777, 0.286, 0.777, 1.25, 1.157, 0.25, 1.25, 0, 0.25, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Barrels", "Barrel1_Band", 0.917, 0.12, 0.917, 1.25, 0.255, 0.25, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel1_BandR", 0.917, 0.12, 0.917, 1.25, 0.255, 0.25, 1.25, 0, 0.25, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel1_Band", 0.917, 0.12, 0.917, 1.25, 1.1, 0.25, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel1_BandR", 0.917, 0.12, 0.917, 1.25, 1.1, 0.25, 1.25, 0, 0.25, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel1_Lid", 0.657, 0.05, 0.657, 1.25, 1.32, 0.25, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Barrels", "Barrel1_LidR", 0.657, 0.05, 0.657, 1.25, 1.32, 0.25, 1.25, 0, 0.25, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Barrels", "Barrel2_S0", 0.628, 0.231, 0.628, 0.35, 0.116, 0.75, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Barrels", "Barrel2_S0R", 0.628, 0.231, 0.628, 0.35, 0.116, 0.75, 0.35, 0, 0.75, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Barrels", "Barrel2_S1", 0.697, 0.588, 0.697, 0.35, 0.525, 0.75, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Barrels", "Barrel2_S1R", 0.697, 0.588, 0.697, 0.35, 0.525, 0.75, 0.35, 0, 0.75, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Barrels", "Barrel2_S2", 0.628, 0.231, 0.628, 0.35, 0.935, 0.75, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Barrels", "Barrel2_S2R", 0.628, 0.231, 0.628, 0.35, 0.935, 0.75, 0.35, 0, 0.75, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Barrels", "Barrel2_Band", 0.756, 0.12, 0.756, 0.35, 0.218, 0.75, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel2_BandR", 0.756, 0.12, 0.756, 0.35, 0.218, 0.75, 0.35, 0, 0.75, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel2_Band", 0.756, 0.12, 0.756, 0.35, 0.9, 0.75, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel2_BandR", 0.756, 0.12, 0.756, 0.35, 0.9, 0.75, 0.35, 0, 0.75, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Barrels", "Barrel2_Lid", 0.508, 0.05, 0.507, 0.35, 1.07, 0.75, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Barrels", "Barrel2_LidR", 0.508, 0.05, 0.507, 0.35, 1.07, 0.75, 0.35, 0, 0.75, 0, 0.785, 0, 160, 104, 62 },
|
||||
{ "Barrels", "Sack", 0.5, 0.6, 0.45, 0, 0.3, 0.225, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Barrels", "SackTop", 0.24, 0.12, 0.25, 0, 0.66, 0.225, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Barrels", "SackTie", 0.28, 0.05, 0.29, 0, 0.605, 0.225, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_crates_barrels"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,189 @@
|
||||
-- decor_flowerbed: модель из Blockbench (decor_flowerbed.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Box", "PlankF", 3.2, 0.2, 0.08, 0, 0.1, -0.61, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankB", 3.2, 0.2, 0.08, 0, 0.1, 0.61, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankL", 0.08, 0.2, 1.3, -1.56, 0.1, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankR", 0.08, 0.2, 1.3, 1.56, 0.1, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankF", 3.2, 0.2, 0.08, 0, 0.31, -0.61, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Box", "PlankB", 3.2, 0.2, 0.08, 0, 0.31, 0.61, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Box", "PlankL", 0.08, 0.2, 1.3, -1.56, 0.31, 0, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Box", "PlankR", 0.08, 0.2, 1.3, 1.56, 0.31, 0, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Box", "PlankF", 3.2, 0.2, 0.08, 0, 0.52, -0.61, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankB", 3.2, 0.2, 0.08, 0, 0.52, 0.61, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankL", 0.08, 0.2, 1.3, -1.56, 0.52, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "PlankR", 0.08, 0.2, 1.3, 1.56, 0.52, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Box", "Post", 0.2, 0.75, 0.2, -1.6, 0.375, -0.65, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Box", "Post", 0.2, 0.75, 0.2, 1.6, 0.375, -0.65, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Box", "Post", 0.2, 0.75, 0.2, -1.6, 0.375, 0.65, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Box", "Post", 0.2, 0.75, 0.2, 1.6, 0.375, 0.65, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Box", "RimF", 3.2, 0.07, 0.14, 0, 0.655, -0.62, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Box", "RimB", 3.2, 0.07, 0.14, 0, 0.655, 0.62, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Box", "Strap", 0.12, 0.55, 0.05, -0.55, 0.325, -0.655, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Box", "Strap", 0.12, 0.55, 0.05, 0.55, 0.325, -0.655, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Box", "Soil", 3.04, 0.5, 1.14, 0, 0.35, 0, 0, 0, 0, 0, 0, 0, 74, 52, 36 },
|
||||
{ "Flowers", "Stem_0", 0.06, 0.55, 0.06, -1.3, 0.875, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_0", 0.2, 0.07, 0.08, -1.2, 0.883, 0.28, -1.3, 0.848, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_0", 0.18, 0.07, 0.08, -1.39, 1.003, 0.28, -1.3, 0.968, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_0", 0.12, 0.12, 0.12, -1.3, 1.21, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_0", 0.13, 0.11, 0.13, -1.19, 1.195, 0.28, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_0", 0.13, 0.11, 0.13, -1.41, 1.195, 0.28, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_0", 0.13, 0.11, 0.13, -1.3, 1.195, 0.39, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_0", 0.13, 0.11, 0.13, -1.3, 1.195, 0.17, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Stem_1", 0.06, 0.73, 0.06, -0.87, 0.965, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_1", 0.2, 0.07, 0.08, -0.77, 0.964, 0.28, -0.87, 0.929, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_1", 0.18, 0.07, 0.08, -0.96, 1.084, 0.28, -0.87, 1.049, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_1", 0.12, 0.12, 0.12, -0.87, 1.39, 0.28, 0, 0, 0, 0, 0, 0, 236, 136, 52 },
|
||||
{ "Flowers", "Petal_1", 0.13, 0.11, 0.13, -0.76, 1.375, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_1", 0.13, 0.11, 0.13, -0.98, 1.375, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_1", 0.13, 0.11, 0.13, -0.87, 1.375, 0.39, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_1", 0.13, 0.11, 0.13, -0.87, 1.375, 0.17, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Stem_2", 0.06, 0.91, 0.06, -0.44, 1.055, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_2", 0.2, 0.07, 0.08, -0.34, 1.045, 0.28, -0.44, 1.01, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_2", 0.18, 0.07, 0.08, -0.53, 1.164, 0.28, -0.44, 1.13, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_2", 0.12, 0.12, 0.12, -0.44, 1.57, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_2", 0.13, 0.11, 0.13, -0.33, 1.555, 0.28, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_2", 0.13, 0.11, 0.13, -0.55, 1.555, 0.28, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_2", 0.13, 0.11, 0.13, -0.44, 1.555, 0.39, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_2", 0.13, 0.11, 0.13, -0.44, 1.555, 0.17, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Stem_3", 0.06, 0.64, 0.06, -0.01, 0.92, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_3", 0.2, 0.07, 0.08, 0.09, 0.923, 0.28, -0.01, 0.888, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_3", 0.18, 0.07, 0.08, -0.1, 1.043, 0.28, -0.01, 1.008, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_3", 0.12, 0.12, 0.12, -0.01, 1.3, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_3", 0.13, 0.11, 0.13, 0.1, 1.285, 0.28, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Petal_3", 0.13, 0.11, 0.13, -0.12, 1.285, 0.28, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Petal_3", 0.13, 0.11, 0.13, -0.01, 1.285, 0.39, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Petal_3", 0.13, 0.11, 0.13, -0.01, 1.285, 0.17, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Stem_4", 0.06, 0.82, 0.06, 0.42, 1.01, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_4", 0.2, 0.07, 0.08, 0.52, 1.004, 0.28, 0.42, 0.969, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_4", 0.18, 0.07, 0.08, 0.33, 1.124, 0.28, 0.42, 1.089, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_4", 0.12, 0.12, 0.12, 0.42, 1.48, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_4", 0.13, 0.11, 0.13, 0.53, 1.465, 0.28, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Petal_4", 0.13, 0.11, 0.13, 0.31, 1.465, 0.28, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Petal_4", 0.13, 0.11, 0.13, 0.42, 1.465, 0.39, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Petal_4", 0.13, 0.11, 0.13, 0.42, 1.465, 0.17, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Stem_5", 0.06, 0.55, 0.06, 0.85, 0.875, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_5", 0.2, 0.07, 0.08, 0.95, 0.883, 0.28, 0.85, 0.848, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_5", 0.18, 0.07, 0.08, 0.76, 1.003, 0.28, 0.85, 0.968, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_5", 0.12, 0.12, 0.12, 0.85, 1.21, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_5", 0.13, 0.11, 0.13, 0.96, 1.195, 0.28, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_5", 0.13, 0.11, 0.13, 0.74, 1.195, 0.28, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_5", 0.13, 0.11, 0.13, 0.85, 1.195, 0.39, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_5", 0.13, 0.11, 0.13, 0.85, 1.195, 0.17, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Stem_6", 0.06, 0.73, 0.06, 1.28, 0.965, 0.28, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_6", 0.2, 0.07, 0.08, 1.38, 0.964, 0.28, 1.28, 0.929, 0.28, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_6", 0.18, 0.07, 0.08, 1.19, 1.084, 0.28, 1.28, 1.049, 0.28, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_6", 0.12, 0.12, 0.12, 1.28, 1.39, 0.28, 0, 0, 0, 0, 0, 0, 236, 136, 52 },
|
||||
{ "Flowers", "Petal_6", 0.13, 0.11, 0.13, 1.39, 1.375, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_6", 0.13, 0.11, 0.13, 1.17, 1.375, 0.28, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_6", 0.13, 0.11, 0.13, 1.28, 1.375, 0.39, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_6", 0.13, 0.11, 0.13, 1.28, 1.375, 0.17, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Stem_7", 0.06, 0.7, 0.06, -1.1, 0.95, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_7", 0.2, 0.07, 0.08, -1, 0.95, -0.25, -1.1, 0.915, -0.25, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_7", 0.18, 0.07, 0.08, -1.19, 1.07, -0.25, -1.1, 1.035, -0.25, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_7", 0.12, 0.12, 0.12, -1.1, 1.36, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_7", 0.13, 0.11, 0.13, -0.99, 1.345, -0.25, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_7", 0.13, 0.11, 0.13, -1.21, 1.345, -0.25, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_7", 0.13, 0.11, 0.13, -1.1, 1.345, -0.14, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_7", 0.13, 0.11, 0.13, -1.1, 1.345, -0.36, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Stem_8", 0.06, 0.43, 0.06, -0.67, 0.815, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_8", 0.2, 0.07, 0.08, -0.57, 0.829, -0.25, -0.67, 0.794, -0.25, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_8", 0.18, 0.07, 0.08, -0.76, 0.949, -0.25, -0.67, 0.914, -0.25, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_8", 0.12, 0.12, 0.12, -0.67, 1.09, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_8", 0.13, 0.11, 0.13, -0.56, 1.075, -0.25, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Petal_8", 0.13, 0.11, 0.13, -0.78, 1.075, -0.25, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Petal_8", 0.13, 0.11, 0.13, -0.67, 1.075, -0.14, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Petal_8", 0.13, 0.11, 0.13, -0.67, 1.075, -0.36, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Flowers", "Stem_9", 0.06, 0.61, 0.06, -0.24, 0.905, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_9", 0.2, 0.07, 0.08, -0.14, 0.91, -0.25, -0.24, 0.875, -0.25, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_9", 0.18, 0.07, 0.08, -0.33, 1.03, -0.25, -0.24, 0.995, -0.25, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_9", 0.12, 0.12, 0.12, -0.24, 1.27, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_9", 0.13, 0.11, 0.13, -0.13, 1.255, -0.25, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Petal_9", 0.13, 0.11, 0.13, -0.35, 1.255, -0.25, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Petal_9", 0.13, 0.11, 0.13, -0.24, 1.255, -0.14, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Petal_9", 0.13, 0.11, 0.13, -0.24, 1.255, -0.36, 0, 0, 0, 0, 0, 0, 86, 136, 206 },
|
||||
{ "Flowers", "Stem_10", 0.06, 0.79, 0.06, 0.19, 0.995, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_10", 0.2, 0.07, 0.08, 0.29, 0.991, -0.25, 0.19, 0.956, -0.25, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_10", 0.18, 0.07, 0.08, 0.1, 1.111, -0.25, 0.19, 1.076, -0.25, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_10", 0.12, 0.12, 0.12, 0.19, 1.45, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_10", 0.13, 0.11, 0.13, 0.3, 1.435, -0.25, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_10", 0.13, 0.11, 0.13, 0.08, 1.435, -0.25, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_10", 0.13, 0.11, 0.13, 0.19, 1.435, -0.14, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Petal_10", 0.13, 0.11, 0.13, 0.19, 1.435, -0.36, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Flowers", "Stem_11", 0.06, 0.52, 0.06, 0.62, 0.86, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_11", 0.2, 0.07, 0.08, 0.72, 0.869, -0.25, 0.62, 0.834, -0.25, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_11", 0.18, 0.07, 0.08, 0.53, 0.989, -0.25, 0.62, 0.954, -0.25, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_11", 0.12, 0.12, 0.12, 0.62, 1.18, -0.25, 0, 0, 0, 0, 0, 0, 236, 136, 52 },
|
||||
{ "Flowers", "Petal_11", 0.13, 0.11, 0.13, 0.73, 1.165, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_11", 0.13, 0.11, 0.13, 0.51, 1.165, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_11", 0.13, 0.11, 0.13, 0.62, 1.165, -0.14, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_11", 0.13, 0.11, 0.13, 0.62, 1.165, -0.36, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Stem_12", 0.06, 0.7, 0.06, 1.05, 0.95, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "LeafA_12", 0.2, 0.07, 0.08, 1.15, 0.95, -0.25, 1.05, 0.915, -0.25, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Flowers", "LeafB_12", 0.18, 0.07, 0.08, 0.96, 1.07, -0.25, 1.05, 1.035, -0.25, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Flowers", "Bud_12", 0.12, 0.12, 0.12, 1.05, 1.36, -0.25, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Flowers", "Petal_12", 0.13, 0.11, 0.13, 1.16, 1.345, -0.25, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_12", 0.13, 0.11, 0.13, 0.94, 1.345, -0.25, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_12", 0.13, 0.11, 0.13, 1.05, 1.345, -0.14, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Petal_12", 0.13, 0.11, 0.13, 1.05, 1.345, -0.36, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Flowers", "Bush_0", 0.25, 0.22, 0.18, -1.225, 0.71, -0.41, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flowers", "Bush_1", 0.25, 0.22, 0.18, -0.705, 0.71, -0.41, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "Bush_2", 0.25, 0.22, 0.18, -0.185, 0.71, -0.41, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flowers", "Bush_3", 0.25, 0.22, 0.18, 0.335, 0.71, -0.41, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Flowers", "Bush_4", 0.25, 0.22, 0.18, 0.855, 0.71, -0.41, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Flowers", "Bush_5", 0.25, 0.22, 0.18, 1.375, 0.71, -0.41, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_flowerbed"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,118 @@
|
||||
-- decor_flowerpot: модель из Blockbench (decor_flowerpot.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Pot", "Tub", 1.029, 0.9, 1.029, 0, 0.45, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Pot", "TubR", 1.029, 0.9, 1.029, 0, 0.45, 0, 0, 0, 0, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Pot", "TubLip", 1.162, 0.1, 1.162, 0, 0.95, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Pot", "TubLipR", 1.162, 0.1, 1.162, 0, 0.95, 0, 0, 0, 0, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Pot", "Band", 1.096, 0.1, 1.096, 0, 0.17, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Pot", "BandR", 1.096, 0.1, 1.096, 0, 0.17, 0, 0, 0, 0, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Pot", "Band", 1.096, 0.1, 1.096, 0, 0.67, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Pot", "BandR", 1.096, 0.1, 1.096, 0, 0.67, 0, 0, 0, 0, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Pot", "Soil", 0.93, 0.05, 0.93, 0, 1, 0, 0, 0, 0, 0, 0, 0, 74, 52, 36 },
|
||||
{ "Pot", "SoilR", 0.93, 0.05, 0.93, 0, 1, 0, 0, 0, 0, 0, 0.785, 0, 74, 52, 36 },
|
||||
{ "Bush", "Leaves_0", 0.697, 0.75, 0.697, 0, 1.375, 0, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Bush", "Leaves_0R", 0.697, 0.75, 0.697, 0, 1.375, 0, 0, 0, 0, 0, 0.785, 0, 56, 110, 48 },
|
||||
{ "Bush", "Leaves_1", 0.498, 0.55, 0.498, -0.25, 1.275, -0.2, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "Leaves_1R", 0.498, 0.55, 0.498, -0.25, 1.275, -0.2, -0.25, 0, -0.2, 0, 0.785, 0, 76, 140, 62 },
|
||||
{ "Bush", "Leaves_2", 0.498, 0.6, 0.498, 0.25, 1.3, 0.22, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Bush", "Leaves_2R", 0.498, 0.6, 0.498, 0.25, 1.3, 0.22, 0.25, 0, 0.22, 0, 0.785, 0, 56, 110, 48 },
|
||||
{ "Bush", "Leaves_3", 0.432, 0.45, 0.432, 0.22, 1.225, -0.25, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "Leaves_3R", 0.432, 0.45, 0.432, 0.22, 1.225, -0.25, 0.22, 0, -0.25, 0, 0.785, 0, 76, 140, 62 },
|
||||
{ "Bush", "Leaves_4", 0.448, 0.5, 0.448, -0.25, 1.25, 0.25, 0, 0, 0, 0, 0, 0, 76, 140, 62 },
|
||||
{ "Bush", "Leaves_4R", 0.448, 0.5, 0.448, -0.25, 1.25, 0.25, -0.25, 0, 0.25, 0, 0.785, 0, 56, 110, 48 },
|
||||
{ "Bush", "Stem_0", 0.06, 0.32, 0.06, -0.32, 1.46, -0.32, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "LeafA_0", 0.2, 0.07, 0.08, -0.22, 1.479, -0.32, -0.32, 1.444, -0.32, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Bush", "LeafB_0", 0.18, 0.07, 0.08, -0.41, 1.599, -0.32, -0.32, 1.564, -0.32, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Bush", "Bud_0", 0.12, 0.12, 0.12, -0.32, 1.68, -0.32, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_0", 0.13, 0.11, 0.13, -0.21, 1.665, -0.32, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Petal_0", 0.13, 0.11, 0.13, -0.43, 1.665, -0.32, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Petal_0", 0.13, 0.11, 0.13, -0.32, 1.665, -0.21, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Petal_0", 0.13, 0.11, 0.13, -0.32, 1.665, -0.43, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Stem_1", 0.06, 0.48, 0.06, 0.1, 1.54, -0.4, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "LeafA_1", 0.2, 0.07, 0.08, 0.2, 1.551, -0.4, 0.1, 1.516, -0.4, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Bush", "LeafB_1", 0.18, 0.07, 0.08, 0.01, 1.671, -0.4, 0.1, 1.636, -0.4, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Bush", "Bud_1", 0.12, 0.12, 0.12, 0.1, 1.84, -0.4, 0, 0, 0, 0, 0, 0, 236, 136, 52 },
|
||||
{ "Bush", "Petal_1", 0.13, 0.11, 0.13, 0.21, 1.825, -0.4, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_1", 0.13, 0.11, 0.13, -0.01, 1.825, -0.4, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_1", 0.13, 0.11, 0.13, 0.1, 1.825, -0.29, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_1", 0.13, 0.11, 0.13, 0.1, 1.825, -0.51, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Stem_2", 0.06, 0.36, 0.06, 0.36, 1.48, -0.1, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "LeafA_2", 0.2, 0.07, 0.08, 0.46, 1.497, -0.1, 0.36, 1.462, -0.1, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Bush", "LeafB_2", 0.18, 0.07, 0.08, 0.27, 1.617, -0.1, 0.36, 1.582, -0.1, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Bush", "Bud_2", 0.12, 0.12, 0.12, 0.36, 1.72, -0.1, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_2", 0.13, 0.11, 0.13, 0.47, 1.705, -0.1, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Bush", "Petal_2", 0.13, 0.11, 0.13, 0.25, 1.705, -0.1, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Bush", "Petal_2", 0.13, 0.11, 0.13, 0.36, 1.705, 0.01, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Bush", "Petal_2", 0.13, 0.11, 0.13, 0.36, 1.705, -0.21, 0, 0, 0, 0, 0, 0, 172, 108, 210 },
|
||||
{ "Bush", "Stem_3", 0.06, 0.6, 0.06, -0.12, 1.6, 0.12, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "LeafA_3", 0.2, 0.07, 0.08, -0.02, 1.605, 0.12, -0.12, 1.57, 0.12, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Bush", "LeafB_3", 0.18, 0.07, 0.08, -0.21, 1.725, 0.12, -0.12, 1.69, 0.12, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Bush", "Bud_3", 0.12, 0.12, 0.12, -0.12, 1.96, 0.12, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_3", 0.13, 0.11, 0.13, -0.01, 1.945, 0.12, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Bush", "Petal_3", 0.13, 0.11, 0.13, -0.23, 1.945, 0.12, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Bush", "Petal_3", 0.13, 0.11, 0.13, -0.12, 1.945, 0.23, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Bush", "Petal_3", 0.13, 0.11, 0.13, -0.12, 1.945, 0.01, 0, 0, 0, 0, 0, 0, 244, 240, 230 },
|
||||
{ "Bush", "Stem_4", 0.06, 0.4, 0.06, 0.3, 1.5, 0.32, 0, 0, 0, 0, 0, 0, 56, 110, 48 },
|
||||
{ "Bush", "LeafA_4", 0.2, 0.07, 0.08, 0.4, 1.515, 0.32, 0.3, 1.48, 0.32, 0, 0, 0.524, 76, 140, 62 },
|
||||
{ "Bush", "LeafB_4", 0.18, 0.07, 0.08, 0.21, 1.635, 0.32, 0.3, 1.6, 0.32, 0, 0, -0.524, 76, 140, 62 },
|
||||
{ "Bush", "Bud_4", 0.12, 0.12, 0.12, 0.3, 1.76, 0.32, 0, 0, 0, 0, 0, 0, 242, 202, 76 },
|
||||
{ "Bush", "Petal_4", 0.13, 0.11, 0.13, 0.41, 1.745, 0.32, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Petal_4", 0.13, 0.11, 0.13, 0.19, 1.745, 0.32, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Petal_4", 0.13, 0.11, 0.13, 0.3, 1.745, 0.43, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Bush", "Petal_4", 0.13, 0.11, 0.13, 0.3, 1.745, 0.21, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_flowerpot"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,109 @@
|
||||
-- decor_haystack: модель из Blockbench (decor_haystack.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Hay", "Layer_0_0", 2.675, 0.271, 2.675, 0, 0.136, 0, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_0_1", 2.675, 0.271, 2.675, 0, 0.136, 0, 0, 0, 0, 0, 0.393, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_0_2", 2.675, 0.271, 2.675, 0, 0.136, 0, 0, 0, 0, 0, 0.785, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_0_3", 2.675, 0.271, 2.675, 0, 0.136, 0, 0, 0, 0, 0, 1.178, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_1_0", 2.539, 0.271, 2.539, 0, 0.397, 0, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_1_1", 2.539, 0.271, 2.539, 0, 0.397, 0, 0, 0, 0, 0, 0.393, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_1_2", 2.539, 0.271, 2.539, 0, 0.397, 0, 0, 0, 0, 0, 0.785, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_1_3", 2.539, 0.271, 2.539, 0, 0.397, 0, 0, 0, 0, 0, 1.178, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_2_0", 2.473, 0.271, 2.473, 0, 0.658, 0, 0, 0, 0, 0, 0, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_2_1", 2.473, 0.271, 2.473, 0, 0.658, 0, 0, 0, 0, 0, 0.393, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_2_2", 2.473, 0.271, 2.473, 0, 0.658, 0, 0, 0, 0, 0, 0.785, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_2_3", 2.473, 0.271, 2.473, 0, 0.658, 0, 0, 0, 0, 0, 1.178, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_3_0", 2.371, 0.271, 2.371, 0, 0.919, 0, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_3_1", 2.371, 0.271, 2.371, 0, 0.919, 0, 0, 0, 0, 0, 0.393, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_3_2", 2.371, 0.271, 2.371, 0, 0.919, 0, 0, 0, 0, 0, 0.785, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_3_3", 2.371, 0.271, 2.371, 0, 0.919, 0, 0, 0, 0, 0, 1.178, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_4_0", 2.228, 0.271, 2.228, 0, 1.18, 0, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_4_1", 2.228, 0.271, 2.228, 0, 1.18, 0, 0, 0, 0, 0, 0.393, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_4_2", 2.228, 0.271, 2.228, 0, 1.18, 0, 0, 0, 0, 0, 0.785, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_4_3", 2.228, 0.271, 2.228, 0, 1.18, 0, 0, 0, 0, 0, 1.178, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_5_0", 2.035, 0.271, 2.035, 0, 1.441, 0, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_5_1", 2.035, 0.271, 2.035, 0, 1.441, 0, 0, 0, 0, 0, 0.393, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_5_2", 2.035, 0.271, 2.035, 0, 1.441, 0, 0, 0, 0, 0, 0.785, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_5_3", 2.035, 0.271, 2.035, 0, 1.441, 0, 0, 0, 0, 0, 1.178, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_6_0", 1.776, 0.271, 1.776, 0, 1.702, 0, 0, 0, 0, 0, 0, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_6_1", 1.776, 0.271, 1.776, 0, 1.702, 0, 0, 0, 0, 0, 0.393, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_6_2", 1.776, 0.271, 1.776, 0, 1.702, 0, 0, 0, 0, 0, 0.785, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_6_3", 1.776, 0.271, 1.776, 0, 1.702, 0, 0, 0, 0, 0, 1.178, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_7_0", 1.416, 0.271, 1.416, 0, 1.963, 0, 0, 0, 0, 0, 0, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_7_1", 1.416, 0.271, 1.416, 0, 1.963, 0, 0, 0, 0, 0, 0.393, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_7_2", 1.416, 0.271, 1.416, 0, 1.963, 0, 0, 0, 0, 0, 0.785, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_7_3", 1.416, 0.271, 1.416, 0, 1.963, 0, 0, 0, 0, 0, 1.178, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_8_0", 0.831, 0.271, 0.831, 0, 2.224, 0, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Hay", "Layer_8_1", 0.831, 0.271, 0.831, 0, 2.224, 0, 0, 0, 0, 0, 0.393, 0, 222, 186, 102 },
|
||||
{ "Hay", "Layer_8_2", 0.831, 0.271, 0.831, 0, 2.224, 0, 0, 0, 0, 0, 0.785, 0, 240, 214, 140 },
|
||||
{ "Hay", "Layer_8_3", 0.831, 0.271, 0.831, 0, 2.224, 0, 0, 0, 0, 0, 1.178, 0, 222, 186, 102 },
|
||||
{ "Hay", "Top", 0.498, 0.15, 0.498, 0, 2.425, 0, 0, 0, 0, 0, 0, 0, 240, 214, 140 },
|
||||
{ "Hay", "TopR", 0.498, 0.15, 0.498, 0, 2.425, 0, 0, 0, 0, 0, 0.785, 0, 240, 214, 140 },
|
||||
{ "Hay", "Straw_0", 0.6, 0.05, 0.05, 1.2, 0.325, 0.2, 1.2, 0.3, 0.2, 0, 0.349, 0.524, 196, 158, 80 },
|
||||
{ "Hay", "Straw_1", 0.6, 0.05, 0.05, -1.15, 0.625, -0.4, -1.15, 0.6, -0.4, 0, 1.047, -0.436, 240, 214, 140 },
|
||||
{ "Hay", "Straw_2", 0.6, 0.05, 0.05, 0.5, 1.225, -0.85, 0.5, 1.2, -0.85, 0, -0.524, 0.698, 196, 158, 80 },
|
||||
{ "Hay", "Straw_3", 0.6, 0.05, 0.05, -0.4, 1.625, 0.6, -0.4, 1.6, 0.6, 0, 0.175, -0.611, 240, 214, 140 },
|
||||
{ "Hay", "Straw_4", 0.6, 0.05, 0.05, 0.9, 0.075, -1.3, 0.9, 0.05, -1.3, 0, 1.222, 0, 196, 158, 80 },
|
||||
{ "Hay", "Straw_5", 0.6, 0.05, 0.05, -1.4, 0.075, 0.8, -1.4, 0.05, 0.8, 0, 0.349, 0, 240, 214, 140 },
|
||||
{ "Hay", "Straw_6", 0.6, 0.05, 0.05, 0.2, 2.125, 0.1, 0.2, 2.1, 0.1, 0, 0.785, 0.524, 196, 158, 80 },
|
||||
{ "Pitchfork", "Handle", 0.06, 2.5, 0.06, 1.9, 1.25, -0.7, 1.9, 0, -0.7, 0, 0, 0.314, 160, 104, 62 },
|
||||
{ "Pitchfork", "Ferrule", 0.1, 0.12, 0.1, 1.9, 2.56, -0.7, 1.9, 0, -0.7, 0, 0, 0.314, 62, 62, 68 },
|
||||
{ "Pitchfork", "Crossbar", 0.44, 0.06, 0.05, 1.9, 2.65, -0.7, 1.9, 0, -0.7, 0, 0, 0.314, 62, 62, 68 },
|
||||
{ "Pitchfork", "Tine", 0.05, 0.53, 0.05, 1.7, 2.885, -0.7, 1.9, 0, -0.7, 0, 0, 0.314, 62, 62, 68 },
|
||||
{ "Pitchfork", "Tine", 0.05, 0.53, 0.05, 1.9, 2.885, -0.7, 1.9, 0, -0.7, 0, 0, 0.314, 62, 62, 68 },
|
||||
{ "Pitchfork", "Tine", 0.05, 0.53, 0.05, 2.1, 2.885, -0.7, 1.9, 0, -0.7, 0, 0, 0.314, 62, 62, 68 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_haystack"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,143 @@
|
||||
-- decor_nets: модель из Blockbench (decor_nets.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Poles", "Pole", 0.18, 3.8, 0.18, -3, 1.9, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Poles", "PoleFoot", 0.44, 0.2, 0.44, -3, 0.1, 0, 0, 0, 0, 0, 0, 0, 122, 118, 114 },
|
||||
{ "Poles", "PoleTop", 0.6, 0.1, 0.12, -3, 3.6, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Poles", "Pole", 0.18, 3.8, 0.18, 0, 1.9, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Poles", "PoleFoot", 0.44, 0.2, 0.44, 0, 0.1, 0, 0, 0, 0, 0, 0, 0, 122, 118, 114 },
|
||||
{ "Poles", "PoleTop", 0.6, 0.1, 0.12, 0, 3.6, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Poles", "Pole", 0.18, 3.8, 0.18, 3, 1.9, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Poles", "PoleFoot", 0.44, 0.2, 0.44, 3, 0.1, 0, 0, 0, 0, 0, 0, 0, 122, 118, 114 },
|
||||
{ "Poles", "PoleTop", 0.6, 0.1, 0.12, 3, 3.6, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Poles", "TopRope", 6, 0.06, 0.06, 0, 3.45, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.394, 0.05, -2.8, 2.253, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.553, 0.05, -2.429, 2.173, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.675, 0.05, -2.058, 2.112, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.741, 0.05, -1.687, 2.079, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.742, 0.05, -1.316, 2.079, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.676, 0.05, -0.945, 2.112, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.555, 0.05, -0.574, 2.173, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.395, 0.05, -0.203, 2.253, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, -1.5, 3.075, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, -1.5, 2.695, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, -1.5, 2.315, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, -1.5, 1.935, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, -1.5, 1.555, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.454, 0.05, 0.05, -2.614, 0.977, 0, -2.614, 0.977, 0, 0, 0, -0.407, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.441, 0.05, 0.05, -2.243, 0.836, 0, -2.243, 0.836, 0, 0, 0, -0.318, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.427, 0.05, 0.05, -1.872, 0.742, 0, -1.872, 0.742, 0, 0, 0, -0.176, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.421, 0.05, 0.05, -1.501, 0.708, 0, -1.501, 0.708, 0, 0, 0, -0.001, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.427, 0.05, 0.05, -1.13, 0.741, 0, -1.13, 0.741, 0, 0, 0, 0.175, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.44, 0.05, 0.05, -0.76, 0.835, 0, -0.759, 0.835, 0, 0, 0, 0.317, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.454, 0.05, 0.05, -0.388, 0.975, 0, -0.388, 0.975, 0, 0, 0, 0.406, 196, 168, 116 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, -2.429, 0.837, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, -1.687, 0.649, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, -0.945, 0.714, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, -0.203, 0.995, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, -2.55, 3.43, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, -2.02, 3.43, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, -1.49, 3.43, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, -0.96, 3.43, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, -0.43, 3.43, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Net", "NetV", 0.05, 2.394, 0.05, 0.2, 2.253, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.553, 0.05, 0.571, 2.173, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.675, 0.05, 0.942, 2.112, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.741, 0.05, 1.313, 2.079, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.742, 0.05, 1.684, 2.079, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.676, 0.05, 2.055, 2.112, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.555, 0.05, 2.426, 2.173, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetV", 0.05, 2.395, 0.05, 2.797, 2.253, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, 1.5, 3.075, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, 1.5, 2.695, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, 1.5, 2.315, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, 1.5, 1.935, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetH", 2.6, 0.05, 0.05, 1.5, 1.555, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.454, 0.05, 0.05, 0.386, 0.977, 0, 0.386, 0.977, 0, 0, 0, -0.407, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.441, 0.05, 0.05, 0.757, 0.836, 0, 0.757, 0.836, 0, 0, 0, -0.318, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.427, 0.05, 0.05, 1.128, 0.742, 0, 1.128, 0.742, 0, 0, 0, -0.176, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.421, 0.05, 0.05, 1.499, 0.708, 0, 1.499, 0.708, 0, 0, 0, -0.001, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.427, 0.05, 0.05, 1.87, 0.741, 0, 1.87, 0.741, 0, 0, 0, 0.175, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.44, 0.05, 0.05, 2.241, 0.835, 0, 2.241, 0.835, 0, 0, 0, 0.317, 196, 168, 116 },
|
||||
{ "Net", "NetBottom", 0.454, 0.05, 0.05, 2.612, 0.975, 0, 2.612, 0.975, 0, 0, 0, 0.406, 196, 168, 116 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, 0.571, 0.837, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, 1.313, 0.649, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, 2.055, 0.714, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Sinker", 0.12, 0.12, 0.1, 2.797, 0.995, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, 0.45, 3.43, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, 0.98, 3.43, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, 1.51, 3.43, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, 2.04, 3.43, 0, 0, 0, 0, 0, 0, 0, 238, 226, 196 },
|
||||
{ "Net", "Float", 0.18, 0.2, 0.16, 2.57, 3.43, 0, 0, 0, 0, 0, 0, 0, 204, 64, 60 },
|
||||
{ "Net", "CaughtFish_Snout", 0.06, 0.075, 0.075, 1.005, 2.2, -0.05, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Net", "CaughtFish_Head", 0.135, 0.18, 0.105, 1.103, 2.2, -0.05, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Net", "CaughtFish_Body", 0.27, 0.24, 0.12, 1.305, 2.2, -0.05, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Net", "CaughtFish_Belly", 0.27, 0.075, 0.128, 1.275, 2.11, -0.05, 0, 0, 0, 0, 0, 0, 240, 244, 246 },
|
||||
{ "Net", "CaughtFish_Rear", 0.135, 0.15, 0.098, 1.507, 2.2, -0.05, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Net", "CaughtFish_Stalk", 0.06, 0.068, 0.068, 1.605, 2.2, -0.05, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Net", "CaughtFish_Dorsal", 0.165, 0.075, 0.05, 1.328, 2.343, -0.05, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Net", "CaughtFish_Gill", 0.05, 0.165, 0.128, 1.174, 2.2, -0.05, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Net", "CaughtFish_TailA", 0.195, 0.068, 0.05, 1.718, 2.2, -0.05, 1.628, 2.2, -0.05, 0, 0, -0.611, 216, 72, 60 },
|
||||
{ "Net", "CaughtFish_TailB", 0.195, 0.068, 0.05, 1.718, 2.2, -0.05, 1.628, 2.2, -0.05, 0, 0, 0.611, 216, 72, 60 },
|
||||
{ "Net", "CaughtFish_Eye", 0.05, 0.05, 0.05, 1.08, 2.234, 0.006, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Net", "CaughtFish_Eye", 0.05, 0.05, 0.05, 1.08, 2.234, -0.106, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Basket", "Basket", 0.664, 0.45, 0.664, -1.6, 0.225, -0.9, 0, 0, 0, 0, 0, 0, 196, 158, 80 },
|
||||
{ "Basket", "BasketR", 0.664, 0.45, 0.664, -1.6, 0.225, -0.9, -1.6, 0, -0.9, 0, 0.785, 0, 222, 186, 102 },
|
||||
{ "Basket", "BasketRim", 0.714, 0.07, 0.714, -1.6, 0.485, -0.9, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Basket", "BasketRimR", 0.714, 0.07, 0.714, -1.6, 0.485, -0.9, -1.6, 0, -0.9, 0, 0.785, 0, 92, 58, 36 },
|
||||
{ "Basket", "BasketNet", 0.55, 0.12, 0.4, -1.575, 0.56, -0.9, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_nets"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,81 @@
|
||||
-- decor_signpost: модель из Blockbench (decor_signpost.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Post", "Post", 0.26, 4.2, 0.26, 0, 2.1, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Post", "PostCap", 0.38, 0.1, 0.38, 0, 4.25, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Post", "PostCap2", 0.2, 0.12, 0.2, 0, 4.36, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Post", "Knob", 0.12, 0.1, 0.12, 0, 4.47, 0, 0, 0, 0, 0, 0, 0, 204, 158, 66 },
|
||||
{ "Post", "Stone_0", 0.4, 0.18, 0.34, 0.4, 0.09, -0.3, 0.4, 0, -0.3, 0, 0, 0, 168, 164, 158 },
|
||||
{ "Post", "Stone_1", 0.4, 0.18, 0.34, -0.35, 0.09, 0.35, -0.35, 0, 0.35, 0, 0.611, 0, 122, 118, 114 },
|
||||
{ "Post", "Stone_2", 0.4, 0.18, 0.34, 0.1, 0.09, 0.42, 0.1, 0, 0.42, 0, 1.222, 0, 168, 164, 158 },
|
||||
{ "Post", "Stone_3", 0.4, 0.18, 0.34, -0.3, 0.09, -0.35, -0.3, 0, -0.35, 0, 1.833, 0, 122, 118, 114 },
|
||||
{ "Arrows", "Arrow1_Face", 2.13, 0.44, 0.12, 1.235, 3.55, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Arrows", "Arrow1_Tip", 0.31, 0.31, 0.12, 2.3, 3.55, 0, 2.3, 3.55, 0, 0, 0, 0.785, 160, 104, 62 },
|
||||
{ "Arrows", "Arrow1_EdgeT", 2.13, 0.05, 0.14, 1.235, 3.79, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Arrows", "Arrow1_EdgeB", 2.13, 0.05, 0.14, 1.235, 3.31, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Arrows", "Arrow1_Nail", 0.08, 0.08, 0.05, 0, 3.55, -0.15, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Arrows", "Arrow2_Face", 1.93, 0.44, 0.12, -1.135, 2.95, 0, 0, 0, 0, 0, 0, 0, 190, 140, 92 },
|
||||
{ "Arrows", "Arrow2_Tip", 0.31, 0.31, 0.12, -2.1, 2.95, 0, -2.1, 2.95, 0, 0, 0, 0.785, 190, 140, 92 },
|
||||
{ "Arrows", "Arrow2_EdgeT", 1.93, 0.05, 0.14, -1.135, 3.19, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Arrows", "Arrow2_EdgeB", 1.93, 0.05, 0.14, -1.135, 2.71, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Arrows", "Arrow2_Nail", 0.08, 0.08, 0.05, 0, 2.95, -0.15, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Arrows", "Arrow3_Face", 1.63, 0.44, 0.12, 0.985, 2.35, 0, 0, 0, 0, 0, 0, 0, 138, 88, 52 },
|
||||
{ "Arrows", "Arrow3_Tip", 0.31, 0.31, 0.12, 1.8, 2.35, 0, 1.8, 2.35, 0, 0, 0, 0.785, 138, 88, 52 },
|
||||
{ "Arrows", "Arrow3_EdgeT", 1.63, 0.05, 0.14, 0.985, 2.59, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Arrows", "Arrow3_EdgeB", 1.63, 0.05, 0.14, 0.985, 2.11, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Arrows", "Arrow3_Nail", 0.08, 0.08, 0.05, 0, 2.35, -0.15, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_signpost"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,128 @@
|
||||
-- decor_well: модель из Blockbench (decor_well.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Stone", "Wall_0_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 0, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_0_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 0, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_0_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 0, 0, 198, 194, 186 },
|
||||
{ "Stone", "Cap_0", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 0, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_1_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 0.785, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_1_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 0.785, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_1_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 0.785, 0, 168, 164, 158 },
|
||||
{ "Stone", "Cap_1", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 0.785, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_2_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 1.571, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_2_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 1.571, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_2_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 1.571, 0, 198, 194, 186 },
|
||||
{ "Stone", "Cap_2", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 1.571, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_3_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 2.356, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_3_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 2.356, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_3_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 2.356, 0, 168, 164, 158 },
|
||||
{ "Stone", "Cap_3", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 2.356, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_4_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 3.142, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_4_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 3.142, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_4_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 3.142, 0, 198, 194, 186 },
|
||||
{ "Stone", "Cap_4", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 3.142, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_5_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 3.927, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_5_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 3.927, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_5_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 3.927, 0, 168, 164, 158 },
|
||||
{ "Stone", "Cap_5", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 3.927, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_6_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 4.712, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_6_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 4.712, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_6_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 4.712, 0, 198, 194, 186 },
|
||||
{ "Stone", "Cap_6", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 4.712, 0, 122, 118, 114 },
|
||||
{ "Stone", "Wall_7_0", 1.22, 0.32, 0.35, -0.1, 0.16, 1.225, 0, 0, 0, 0, 5.498, 0, 168, 164, 158 },
|
||||
{ "Stone", "Wall_7_1", 1.22, 0.32, 0.35, 0.1, 0.49, 1.225, 0, 0, 0, 0, 5.498, 0, 198, 194, 186 },
|
||||
{ "Stone", "Wall_7_2", 1.22, 0.32, 0.35, -0.1, 0.82, 1.225, 0, 0, 0, 0, 5.498, 0, 168, 164, 158 },
|
||||
{ "Stone", "Cap_7", 1.303, 0.14, 0.52, 0, 1.06, 1.24, 0, 0, 0, 0, 5.498, 0, 122, 118, 114 },
|
||||
{ "Stone", "Water", 1.859, 0.05, 1.859, 0, 0.525, 0, 0, 0, 0, 0, 0, 0, 70, 120, 150 },
|
||||
{ "Stone", "WaterR", 1.859, 0.05, 1.859, 0, 0.525, 0, 0, 0, 0, 0, 0.785, 0, 70, 120, 150 },
|
||||
{ "Stone", "Pebble_0", 0.3, 0.12, 0.24, 1.7, 0.06, -0.6, 1.7, 0, -0.6, 0, 0, 0, 168, 164, 158 },
|
||||
{ "Stone", "Pebble_1", 0.3, 0.12, 0.24, -1.6, 0.06, 0.9, -1.6, 0, 0.9, 0, 0.524, 0, 122, 118, 114 },
|
||||
{ "Stone", "Pebble_2", 0.3, 0.12, 0.24, 0.4, 0.06, -1.7, 0.4, 0, -1.7, 0, 1.047, 0, 168, 164, 158 },
|
||||
{ "Stone", "Pebble_3", 0.3, 0.12, 0.24, -1, 0.06, -1.45, -1, 0, -1.45, 0, 1.571, 0, 122, 118, 114 },
|
||||
{ "Frame", "Post", 0.22, 2.45, 0.22, -1.22, 2.125, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "PostBrace", 0.16, 0.45, 0.48, -1.22, 1.175, 0.16, -1.22, 1, 0, -0.611, 0, 0, 92, 58, 36 },
|
||||
{ "Frame", "Post", 0.22, 2.45, 0.22, 1.22, 2.125, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "PostBrace", 0.16, 0.45, 0.48, 1.22, 1.175, 0.16, 1.22, 1, 0, -0.611, 0, 0, 92, 58, 36 },
|
||||
{ "Frame", "Beam", 2.9, 0.15, 0.24, 0, 3.425, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Frame", "Roof", 3.5, 0.12, 1.3, 0, 4.01, -0.65, 0, 3.95, 0, -0.611, 0, 0, 138, 88, 52 },
|
||||
{ "Frame", "Shingle", 3.56, 0.06, 0.25, 0, 4.1, -0.475, 0, 3.95, 0, -0.611, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Shingle", 3.56, 0.06, 0.25, 0, 4.1, -0.805, 0, 3.95, 0, -0.611, 0, 0, 92, 58, 36 },
|
||||
{ "Frame", "Shingle", 3.56, 0.06, 0.25, 0, 4.1, -1.135, 0, 3.95, 0, -0.611, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Roof", 3.5, 0.12, 1.3, 0, 4.01, 0.65, 0, 3.95, 0, 0.611, 0, 0, 138, 88, 52 },
|
||||
{ "Frame", "Shingle", 3.56, 0.06, 0.25, 0, 4.1, 0.475, 0, 3.95, 0, 0.611, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Shingle", 3.56, 0.06, 0.25, 0, 4.1, 0.805, 0, 3.95, 0, 0.611, 0, 0, 92, 58, 36 },
|
||||
{ "Frame", "Shingle", 3.56, 0.06, 0.25, 0, 4.1, 1.135, 0, 3.95, 0, 0.611, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Ridge", 3.6, 0.17, 0.2, 0, 4.035, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Frame", "Gable", 0.1, 0.15, 1.44, -1.32, 3.575, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Gable", 0.1, 0.15, 0.96, -1.32, 3.725, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Gable", 0.1, 0.13, 0.48, -1.32, 3.865, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Gable", 0.1, 0.15, 1.44, 1.32, 3.575, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Gable", 0.1, 0.15, 0.96, 1.32, 3.725, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Frame", "Gable", 0.1, 0.13, 0.48, 1.32, 3.865, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Crank", "Axle", 2.8, 0.14, 0.14, 0, 2.55, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crank", "RopeCoil", 0.8, 0.22, 0.22, 0, 2.55, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Crank", "CrankArm", 0.06, 0.43, 0.08, 1.45, 2.365, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Crank", "CrankHandle", 0.3, 0.1, 0.1, 1.63, 2.18, 0, 0, 0, 0, 0, 0, 0, 92, 58, 36 },
|
||||
{ "Crank", "Rope", 0.05, 0.84, 0.05, 0, 2.04, 0, 0, 0, 0, 0, 0, 0, 196, 168, 116 },
|
||||
{ "Bucket", "Bucket", 0.332, 0.35, 0.332, 0, 1.375, 0, 0, 0, 0, 0, 0, 0, 160, 104, 62 },
|
||||
{ "Bucket", "BucketR", 0.332, 0.35, 0.332, 0, 1.375, 0, 0, 0, 0, 0, 0.785, 0, 138, 88, 52 },
|
||||
{ "Bucket", "BucketBand", 0.357, 0.06, 0.357, 0, 1.45, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Bucket", "BucketBandR", 0.357, 0.06, 0.357, 0, 1.45, 0, 0, 0, 0, 0, 0.785, 0, 62, 62, 68 },
|
||||
{ "Bucket", "Handle", 0.05, 0.15, 0.05, -0.17, 1.575, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Bucket", "Handle", 0.05, 0.15, 0.05, 0.17, 1.575, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
{ "Bucket", "HandleTop", 0.34, 0.05, 0.05, 0, 1.64, 0, 0, 0, 0, 0, 0, 0, 62, 62, 68 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "decor_well"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,73 @@
|
||||
-- fish_carp: модель из Blockbench (fish_carp.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Body", "Fish_Snout", 0.15, 0.15, 0.12, 0, 0, -0.69, 0, 0, 0, 0, 0, 0, 176, 128, 60 },
|
||||
{ "Body", "Fish_Head", 0.21, 0.36, 0.27, 0, 0, -0.495, 0, 0, 0, 0, 0, 0, 176, 128, 60 },
|
||||
{ "Body", "Fish_Body", 0.24, 0.48, 0.54, 0, 0, -0.09, 0, 0, 0, 0, 0, 0, 176, 128, 60 },
|
||||
{ "Body", "Fish_Belly", 0.255, 0.15, 0.54, 0, -0.18, -0.15, 0, 0, 0, 0, 0, 0, 226, 196, 128 },
|
||||
{ "Body", "Fish_Rear", 0.195, 0.3, 0.27, 0, 0, 0.315, 0, 0, 0, 0, 0, 0, 176, 128, 60 },
|
||||
{ "Body", "Fish_Stalk", 0.135, 0.135, 0.12, 0, 0, 0.51, 0, 0, 0, 0, 0, 0, 176, 128, 60 },
|
||||
{ "Body", "Fish_Dorsal", 0.09, 0.15, 0.33, 0, 0.285, -0.045, 0, 0, 0, 0, 0, 0, 140, 94, 46 },
|
||||
{ "Body", "Fish_Gill", 0.255, 0.33, 0.05, 0, 0, -0.353, 0, 0, 0, 0, 0, 0, 140, 94, 46 },
|
||||
{ "Tail", "Fish_TailA", 0.09, 0.135, 0.39, 0, 0, 0.735, 0, 0, 0.555, 0.611, 0, 0, 140, 94, 46 },
|
||||
{ "Tail", "Fish_TailB", 0.09, 0.135, 0.39, 0, 0, 0.735, 0, 0, 0.555, -0.611, 0, 0, 140, 94, 46 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.075, 0.075, 0.113, 0.068, -0.54, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.075, 0.075, -0.112, 0.068, -0.54, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_Back", 0.15, 0.052, 0.555, 0, 0.221, -0.097, 0, 0, 0, 0, 0, 0, 118, 84, 40 },
|
||||
{ "Body", "Fish_Barbel", 0.05, 0.05, 0.165, -0.045, -0.06, -0.712, 0, -0.06, -0.675, -0.436, 0, 0, 140, 94, 46 },
|
||||
{ "Body", "Fish_Barbel", 0.05, 0.05, 0.165, 0.045, -0.06, -0.712, 0, -0.06, -0.675, -0.436, 0, 0, 140, 94, 46 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "fish_carp"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,74 @@
|
||||
-- fish_gold: модель из Blockbench (fish_gold.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Body", "Fish_Snout", 0.13, 0.13, 0.104, 0, 0, -0.598, 0, 0, 0, 0, 0, 0, 244, 148, 36 },
|
||||
{ "Body", "Fish_Head", 0.182, 0.312, 0.234, 0, 0, -0.429, 0, 0, 0, 0, 0, 0, 244, 148, 36 },
|
||||
{ "Body", "Fish_Body", 0.208, 0.416, 0.468, 0, 0, -0.078, 0, 0, 0, 0, 0, 0, 244, 148, 36 },
|
||||
{ "Body", "Fish_Belly", 0.221, 0.13, 0.468, 0, -0.156, -0.13, 0, 0, 0, 0, 0, 0, 255, 204, 112 },
|
||||
{ "Body", "Fish_Rear", 0.169, 0.26, 0.234, 0, 0, 0.273, 0, 0, 0, 0, 0, 0, 244, 148, 36 },
|
||||
{ "Body", "Fish_Stalk", 0.117, 0.117, 0.104, 0, 0, 0.442, 0, 0, 0, 0, 0, 0, 244, 148, 36 },
|
||||
{ "Body", "Fish_Dorsal", 0.078, 0.13, 0.286, 0, 0.247, -0.039, 0, 0, 0, 0, 0, 0, 248, 112, 44 },
|
||||
{ "Body", "Fish_Gill", 0.221, 0.286, 0.05, 0, 0, -0.305, 0, 0, 0, 0, 0, 0, 248, 112, 44 },
|
||||
{ "Tail", "Fish_TailA", 0.078, 0.117, 0.338, 0, 0, 0.637, 0, 0, 0.481, 0.611, 0, 0, 248, 112, 44 },
|
||||
{ "Tail", "Fish_TailB", 0.078, 0.117, 0.338, 0, 0, 0.637, 0, 0, 0.481, -0.611, 0, 0, 248, 112, 44 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.065, 0.065, 0.098, 0.059, -0.468, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.065, 0.065, -0.097, 0.059, -0.468, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Tail", "Fish_TailVeil", 0.05, 0.052, 0.364, 0, 0, 0.832, 0, 0, 0.481, 0.698, 0, 0, 248, 112, 44 },
|
||||
{ "Tail", "Fish_TailVeil", 0.05, 0.052, 0.364, 0, 0, 0.832, 0, 0, 0.481, -0.698, 0, 0, 248, 112, 44 },
|
||||
{ "Body", "Fish_Pectoral", 0.05, 0.078, 0.182, -0.117, -0.091, -0.065, 0, -0.091, -0.156, 0.436, 0, 0, 248, 112, 44 },
|
||||
{ "Body", "Fish_Pectoral", 0.05, 0.078, 0.182, 0.117, -0.091, -0.065, 0, -0.091, -0.156, 0.436, 0, 0, 248, 112, 44 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "fish_gold"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,77 @@
|
||||
-- fish_koi: модель из Blockbench (fish_koi.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Body", "Fish_Snout", 0.16, 0.16, 0.128, 0, 0, -0.736, 0, 0, 0, 0, 0, 0, 246, 244, 238 },
|
||||
{ "Body", "Fish_Head", 0.224, 0.384, 0.288, 0, 0, -0.528, 0, 0, 0, 0, 0, 0, 246, 244, 238 },
|
||||
{ "Body", "Fish_Body", 0.256, 0.512, 0.576, 0, 0, -0.096, 0, 0, 0, 0, 0, 0, 246, 244, 238 },
|
||||
{ "Body", "Fish_Belly", 0.272, 0.16, 0.576, 0, -0.192, -0.16, 0, 0, 0, 0, 0, 0, 246, 244, 238 },
|
||||
{ "Body", "Fish_Rear", 0.208, 0.32, 0.288, 0, 0, 0.336, 0, 0, 0, 0, 0, 0, 246, 244, 238 },
|
||||
{ "Body", "Fish_Stalk", 0.144, 0.144, 0.128, 0, 0, 0.544, 0, 0, 0, 0, 0, 0, 246, 244, 238 },
|
||||
{ "Body", "Fish_Dorsal", 0.096, 0.16, 0.352, 0, 0.304, -0.048, 0, 0, 0, 0, 0, 0, 250, 220, 200 },
|
||||
{ "Body", "Fish_Gill", 0.272, 0.352, 0.05, 0, 0, -0.376, 0, 0, 0, 0, 0, 0, 250, 220, 200 },
|
||||
{ "Tail", "Fish_TailA", 0.096, 0.144, 0.416, 0, 0, 0.784, 0, 0, 0.592, 0.611, 0, 0, 250, 220, 200 },
|
||||
{ "Tail", "Fish_TailB", 0.096, 0.144, 0.416, 0, 0, 0.784, 0, 0, 0.592, -0.611, 0, 0, 250, 220, 200 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.08, 0.08, 0.12, 0.072, -0.576, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.08, 0.08, -0.12, 0.072, -0.576, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_PatchA", 0.05, 0.208, 0.32, -0.13, 0.104, -0.352, 0, 0, 0, 0, 0, 0, 240, 104, 40 },
|
||||
{ "Body", "Fish_PatchB", 0.05, 0.208, 0.288, -0.12, 0.072, 0.176, 0, 0, 0, 0, 0, 0, 240, 104, 40 },
|
||||
{ "Body", "Fish_Spot", 0.05, 0.08, 0.08, -0.13, 0.12, -0.088, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_PatchA", 0.05, 0.208, 0.32, 0.13, 0.104, -0.352, 0, 0, 0, 0, 0, 0, 240, 104, 40 },
|
||||
{ "Body", "Fish_PatchB", 0.05, 0.208, 0.288, 0.12, 0.072, 0.176, 0, 0, 0, 0, 0, 0, 240, 104, 40 },
|
||||
{ "Body", "Fish_Spot", 0.05, 0.08, 0.08, 0.13, 0.12, -0.088, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_HeadPatch", 0.192, 0.05, 0.224, 0, 0.188, -0.528, 0, 0, 0, 0, 0, 0, 240, 104, 40 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "fish_koi"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -0,0 +1,75 @@
|
||||
-- fish_roach: модель из Blockbench (fish_roach.bbmodel), собранная из Part.
|
||||
-- СГЕНЕРИРОВАНО tools/bbmodel-to-luau.js — руками не править: правьте модель в Blockbench и генерируйте заново.
|
||||
-- Возвращает функцию build(parent): Model с подмоделями по группам Blockbench; рыба — в подмоделях Fish.
|
||||
-- PrimaryPart — невидимое основание в точке (0, 0, 0) модели (низ по центру), фасад смотрит в −Z.
|
||||
|
||||
-- { группа, имя, размер X Y Z, центр X Y Z, точка поворота X Y Z, поворот X Y Z (рад, порядок ZYX), цвет R G B }
|
||||
local CUBES = {
|
||||
{ "Body", "Fish_Snout", 0.12, 0.12, 0.096, 0, 0, -0.552, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Body", "Fish_Head", 0.168, 0.288, 0.216, 0, 0, -0.396, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Body", "Fish_Body", 0.192, 0.384, 0.432, 0, 0, -0.072, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Body", "Fish_Belly", 0.204, 0.12, 0.432, 0, -0.144, -0.12, 0, 0, 0, 0, 0, 0, 240, 244, 246 },
|
||||
{ "Body", "Fish_Rear", 0.156, 0.24, 0.216, 0, 0, 0.252, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Body", "Fish_Stalk", 0.108, 0.108, 0.096, 0, 0, 0.408, 0, 0, 0, 0, 0, 0, 182, 194, 204 },
|
||||
{ "Body", "Fish_Dorsal", 0.072, 0.12, 0.264, 0, 0.228, -0.036, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Body", "Fish_Gill", 0.204, 0.264, 0.05, 0, 0, -0.282, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Tail", "Fish_TailA", 0.072, 0.108, 0.312, 0, 0, 0.588, 0, 0, 0.444, 0.611, 0, 0, 216, 72, 60 },
|
||||
{ "Tail", "Fish_TailB", 0.072, 0.108, 0.312, 0, 0, 0.588, 0, 0, 0.444, -0.611, 0, 0, 216, 72, 60 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.06, 0.06, 0.09, 0.054, -0.432, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_Eye", 0.05, 0.06, 0.06, -0.09, 0.054, -0.432, 0, 0, 0, 0, 0, 0, 24, 24, 30 },
|
||||
{ "Body", "Fish_Back", 0.12, 0.054, 0.444, 0, 0.171, -0.078, 0, 0, 0, 0, 0, 0, 92, 114, 132 },
|
||||
{ "Body", "Fish_EyeRing", 0.05, 0.072, 0.06, -0.09, 0.054, -0.432, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Body", "Fish_EyeRing", 0.05, 0.072, 0.06, 0.09, 0.054, -0.432, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Body", "Fish_Pelvic", 0.05, 0.084, 0.132, -0.06, -0.198, 0.006, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
{ "Body", "Fish_Pelvic", 0.05, 0.084, 0.132, 0.06, -0.198, 0.006, 0, 0, 0, 0, 0, 0, 216, 72, 60 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
local model = Instance.new("Model")
|
||||
model.Name = "fish_roach"
|
||||
local base = Instance.new("Part")
|
||||
base.Name = "Base"
|
||||
base.Size = Vector3.new(1, 0.1, 1)
|
||||
base.CFrame = CFrame.new(0, 0.05, 0)
|
||||
base.Transparency = 1
|
||||
base.Anchored = true
|
||||
base.CanCollide = false
|
||||
base.CanQuery = false
|
||||
base.CanTouch = false
|
||||
base.Parent = model
|
||||
model.PrimaryPart = base
|
||||
local groups = {}
|
||||
local function sub(name, parentModel)
|
||||
local key = (parentModel and parentModel.Name .. "/" or "") .. name
|
||||
if not groups[key] then
|
||||
local g = Instance.new("Model")
|
||||
g.Name = name
|
||||
g.Parent = parentModel or model
|
||||
groups[key] = g
|
||||
end
|
||||
return groups[key]
|
||||
end
|
||||
for _, c in ipairs(CUBES) do
|
||||
local g = sub(c[1])
|
||||
if c[2]:find("Fish") or c[1]:find("Fish") then
|
||||
g = sub("Fish", g)
|
||||
end
|
||||
local rot = CFrame.Angles(0, 0, c[14]) * CFrame.Angles(0, c[13], 0) * CFrame.Angles(c[12], 0, 0)
|
||||
local origin = Vector3.new(c[9], c[10], c[11])
|
||||
local center = Vector3.new(c[6], c[7], c[8])
|
||||
local p = Instance.new("Part")
|
||||
p.Name = c[2]
|
||||
p.Anchored = true
|
||||
p.Size = Vector3.new(c[3], c[4], c[5])
|
||||
p.CFrame = CFrame.new(origin) * rot * CFrame.new(center - origin)
|
||||
p.Color = Color3.fromRGB(c[15], c[16], c[17])
|
||||
p.Material = c[2]:find("Glow") and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
p.TopSurface, p.BottomSurface = Enum.SurfaceType.Smooth, Enum.SurfaceType.Smooth
|
||||
-- мелкие и висящие детали не мешают ходить
|
||||
p.CanCollide = math.min(p.Size.X, p.Size.Y, p.Size.Z) >= 0.3 and math.max(p.Size.X, p.Size.Y, p.Size.Z) >= 1
|
||||
p.CastShadow = p.Size.Magnitude > 0.6
|
||||
p.Parent = g
|
||||
end
|
||||
model.Parent = parent
|
||||
return model
|
||||
end
|
||||
@@ -17,9 +17,9 @@ local CUBES = {
|
||||
{ "Frame", "LegB_L", 0.26, 0.4, 0.26, -2.75, 0.8, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "LegB_L", 0.34, 0.12, 0.34, -2.75, 1.06, 0.55, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "LegB_L", 0.3, 0.18, 0.3, -2.75, 1.21, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPost_L", 0.28, 2.05, 0.28, -2.75, 2.325, 0.55, -2.75, 1.3, 0.55, -0.175, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_L", 0.36, 0.15, 0.36, -2.75, 3.425, 0.55, -2.75, 1.3, 0.55, -0.175, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_L", 0.2, 0.15, 0.2, -2.75, 3.575, 0.55, -2.75, 1.3, 0.55, -0.175, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "BackPost_L", 0.28, 2.05, 0.28, -2.75, 2.325, 0.55, -2.75, 1.3, 0.55, 0.209, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_L", 0.36, 0.15, 0.36, -2.75, 3.425, 0.55, -2.75, 1.3, 0.55, 0.209, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_L", 0.2, 0.15, 0.2, -2.75, 3.575, 0.55, -2.75, 1.3, 0.55, 0.209, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "SideRail_L", 0.2, 0.23, 1.3, -2.75, 1.165, -0.1, 0, 0, 0, 0, 0, 0, 144, 92, 52 },
|
||||
{ "Frame", "Stretcher_L", 0.16, 0.12, 1.3, -2.75, 0.36, -0.1, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "ArmPost_L", 0.2, 0.75, 0.2, -2.75, 1.875, -0.65, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
@@ -42,9 +42,9 @@ local CUBES = {
|
||||
{ "Frame", "LegB_R", 0.26, 0.4, 0.26, 2.75, 0.8, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "LegB_R", 0.34, 0.12, 0.34, 2.75, 1.06, 0.55, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "LegB_R", 0.3, 0.18, 0.3, 2.75, 1.21, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPost_R", 0.28, 2.05, 0.28, 2.75, 2.325, 0.55, 2.75, 1.3, 0.55, -0.175, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_R", 0.36, 0.15, 0.36, 2.75, 3.425, 0.55, 2.75, 1.3, 0.55, -0.175, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_R", 0.2, 0.15, 0.2, 2.75, 3.575, 0.55, 2.75, 1.3, 0.55, -0.175, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "BackPost_R", 0.28, 2.05, 0.28, 2.75, 2.325, 0.55, 2.75, 1.3, 0.55, 0.209, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_R", 0.36, 0.15, 0.36, 2.75, 3.425, 0.55, 2.75, 1.3, 0.55, 0.209, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_R", 0.2, 0.15, 0.2, 2.75, 3.575, 0.55, 2.75, 1.3, 0.55, 0.209, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "SideRail_R", 0.2, 0.23, 1.3, 2.75, 1.165, -0.1, 0, 0, 0, 0, 0, 0, 144, 92, 52 },
|
||||
{ "Frame", "Stretcher_R", 0.16, 0.12, 1.3, 2.75, 0.36, -0.1, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "ArmPost_R", 0.2, 0.75, 0.2, 2.75, 1.875, -0.65, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
@@ -78,20 +78,20 @@ local CUBES = {
|
||||
{ "Seat", "SeatRivet", 0.1, 0.05, 0.1, 1.9, 1.545, -0.75, 0, 0, 0, 0, 0, 0, 206, 162, 70 },
|
||||
{ "Seat", "SeatRivet", 0.1, 0.05, 0.1, 1.9, 1.545, -0.27, 0, 0, 0, 0, 0, 0, 206, 162, 70 },
|
||||
{ "Seat", "SeatRivet", 0.1, 0.05, 0.1, 1.9, 1.545, 0.21, 0, 0, 0, 0, 0, 0, 206, 162, 70 },
|
||||
{ "Back", "BackRail_Low", 5.3, 0.25, 0.16, 0, 1.975, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackRail_Top", 5.5, 0.3, 0.2, 0, 3.2, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest", 2.4, 0.15, 0.16, 0, 3.425, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest2", 1, 0.1, 0.12, 0, 3.55, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_0", 0.32, 0.95, 0.1, -2.3, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_1", 0.32, 0.95, 0.1, -1.38, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_3", 0.32, 0.95, 0.1, 0.46, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_4", 0.32, 0.95, 0.1, 1.38, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_5", 0.32, 0.95, 0.1, 2.3, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackPanel", 1.5, 0.95, 0.14, 0, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 98, 60, 36 },
|
||||
{ "Back", "Medallion", 0.64, 0.4, 0.06, 0, 2.58, 0.45, 0, 1.3, 0.55, -0.175, 0, 0, 206, 162, 70 },
|
||||
{ "Back", "MedallionR", 0.44, 0.44, 0.05, 0, 2.58, 0.42, 0, 2.58, 0.44, -0.175, 0, 0.785, 160, 120, 46 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, -2.3, 2.6, 0.455, 0, 1.3, 0.55, -0.175, 0, 0, 58, 58, 64 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, 2.3, 2.6, 0.455, 0, 1.3, 0.55, -0.175, 0, 0, 58, 58, 64 },
|
||||
{ "Back", "BackRail_Low", 5.3, 0.25, 0.16, 0, 1.975, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackRail_Top", 5.5, 0.3, 0.2, 0, 3.2, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest", 2.4, 0.15, 0.16, 0, 3.425, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest2", 1, 0.1, 0.12, 0, 3.55, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_0", 0.32, 0.95, 0.1, -2.3, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_1", 0.32, 0.95, 0.1, -1.38, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_3", 0.32, 0.95, 0.1, 0.46, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_4", 0.32, 0.95, 0.1, 1.38, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_5", 0.32, 0.95, 0.1, 2.3, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackPanel", 1.5, 0.95, 0.14, 0, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 98, 60, 36 },
|
||||
{ "Back", "Medallion", 0.64, 0.4, 0.06, 0, 2.58, 0.45, 0, 1.3, 0.55, 0.209, 0, 0, 206, 162, 70 },
|
||||
{ "Back", "MedallionR", 0.44, 0.44, 0.05, 0, 2.579, 0.689, 0, 2.579, 0.689, 0.209, 0, 0.785, 160, 120, 46 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, -2.3, 2.6, 0.455, 0, 1.3, 0.55, 0.209, 0, 0, 58, 58, 64 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, 2.3, 2.6, 0.455, 0, 1.3, 0.55, 0.209, 0, 0, 58, 58, 64 },
|
||||
}
|
||||
|
||||
return function(parent)
|
||||
|
||||
@@ -17,9 +17,9 @@ local CUBES = {
|
||||
{ "Frame", "LegB_L", 0.26, 0.4, 0.26, -2.75, 0.8, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "LegB_L", 0.34, 0.12, 0.34, -2.75, 1.06, 0.55, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "LegB_L", 0.3, 0.18, 0.3, -2.75, 1.21, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPost_L", 0.28, 2.05, 0.28, -2.75, 2.325, 0.55, -2.75, 1.3, 0.55, -0.175, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_L", 0.36, 0.15, 0.36, -2.75, 3.425, 0.55, -2.75, 1.3, 0.55, -0.175, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_L", 0.2, 0.15, 0.2, -2.75, 3.575, 0.55, -2.75, 1.3, 0.55, -0.175, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "BackPost_L", 0.28, 2.05, 0.28, -2.75, 2.325, 0.55, -2.75, 1.3, 0.55, 0.209, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_L", 0.36, 0.15, 0.36, -2.75, 3.425, 0.55, -2.75, 1.3, 0.55, 0.209, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_L", 0.2, 0.15, 0.2, -2.75, 3.575, 0.55, -2.75, 1.3, 0.55, 0.209, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "SideRail_L", 0.2, 0.23, 1.3, -2.75, 1.165, -0.1, 0, 0, 0, 0, 0, 0, 144, 92, 52 },
|
||||
{ "Frame", "Stretcher_L", 0.16, 0.12, 1.3, -2.75, 0.36, -0.1, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "ArmPost_L", 0.2, 0.75, 0.2, -2.75, 1.875, -0.65, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
@@ -42,9 +42,9 @@ local CUBES = {
|
||||
{ "Frame", "LegB_R", 0.26, 0.4, 0.26, 2.75, 0.8, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "LegB_R", 0.34, 0.12, 0.34, 2.75, 1.06, 0.55, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "LegB_R", 0.3, 0.18, 0.3, 2.75, 1.21, 0.55, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPost_R", 0.28, 2.05, 0.28, 2.75, 2.325, 0.55, 2.75, 1.3, 0.55, -0.175, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_R", 0.36, 0.15, 0.36, 2.75, 3.425, 0.55, 2.75, 1.3, 0.55, -0.175, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_R", 0.2, 0.15, 0.2, 2.75, 3.575, 0.55, 2.75, 1.3, 0.55, -0.175, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "BackPost_R", 0.28, 2.05, 0.28, 2.75, 2.325, 0.55, 2.75, 1.3, 0.55, 0.209, 0, 0, 98, 60, 36 },
|
||||
{ "Frame", "BackPostCap_R", 0.36, 0.15, 0.36, 2.75, 3.425, 0.55, 2.75, 1.3, 0.55, 0.209, 0, 0, 206, 162, 70 },
|
||||
{ "Frame", "BackPostKnob_R", 0.2, 0.15, 0.2, 2.75, 3.575, 0.55, 2.75, 1.3, 0.55, 0.209, 0, 0, 160, 120, 46 },
|
||||
{ "Frame", "SideRail_R", 0.2, 0.23, 1.3, 2.75, 1.165, -0.1, 0, 0, 0, 0, 0, 0, 144, 92, 52 },
|
||||
{ "Frame", "Stretcher_R", 0.16, 0.12, 1.3, 2.75, 0.36, -0.1, 0, 0, 0, 0, 0, 0, 72, 44, 28 },
|
||||
{ "Frame", "ArmPost_R", 0.2, 0.75, 0.2, 2.75, 1.875, -0.65, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
@@ -78,20 +78,20 @@ local CUBES = {
|
||||
{ "Seat", "SeatRivet", 0.1, 0.05, 0.1, 1.9, 1.545, -0.75, 0, 0, 0, 0, 0, 0, 206, 162, 70 },
|
||||
{ "Seat", "SeatRivet", 0.1, 0.05, 0.1, 1.9, 1.545, -0.27, 0, 0, 0, 0, 0, 0, 206, 162, 70 },
|
||||
{ "Seat", "SeatRivet", 0.1, 0.05, 0.1, 1.9, 1.545, 0.21, 0, 0, 0, 0, 0, 0, 206, 162, 70 },
|
||||
{ "Back", "BackRail_Low", 5.3, 0.25, 0.16, 0, 1.975, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackRail_Top", 5.5, 0.3, 0.2, 0, 3.2, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest", 2.4, 0.15, 0.16, 0, 3.425, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest2", 1, 0.1, 0.12, 0, 3.55, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_0", 0.32, 0.95, 0.1, -2.3, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_1", 0.32, 0.95, 0.1, -1.38, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_3", 0.32, 0.95, 0.1, 0.46, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_4", 0.32, 0.95, 0.1, 1.38, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_5", 0.32, 0.95, 0.1, 2.3, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackPanel", 1.5, 0.95, 0.14, 0, 2.575, 0.55, 0, 1.3, 0.55, -0.175, 0, 0, 98, 60, 36 },
|
||||
{ "Back", "Medallion", 0.64, 0.4, 0.06, 0, 2.58, 0.45, 0, 1.3, 0.55, -0.175, 0, 0, 206, 162, 70 },
|
||||
{ "Back", "MedallionR", 0.44, 0.44, 0.05, 0, 2.58, 0.42, 0, 2.58, 0.44, -0.175, 0, 0.785, 160, 120, 46 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, -2.3, 2.6, 0.455, 0, 1.3, 0.55, -0.175, 0, 0, 58, 58, 64 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, 2.3, 2.6, 0.455, 0, 1.3, 0.55, -0.175, 0, 0, 58, 58, 64 },
|
||||
{ "Back", "BackRail_Low", 5.3, 0.25, 0.16, 0, 1.975, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackRail_Top", 5.5, 0.3, 0.2, 0, 3.2, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest", 2.4, 0.15, 0.16, 0, 3.425, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackRail_TopCrest2", 1, 0.1, 0.12, 0, 3.55, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_0", 0.32, 0.95, 0.1, -2.3, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_1", 0.32, 0.95, 0.1, -1.38, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_3", 0.32, 0.95, 0.1, 0.46, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackSlat_4", 0.32, 0.95, 0.1, 1.38, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 164, 108, 62 },
|
||||
{ "Back", "BackSlat_5", 0.32, 0.95, 0.1, 2.3, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 144, 92, 52 },
|
||||
{ "Back", "BackPanel", 1.5, 0.95, 0.14, 0, 2.575, 0.55, 0, 1.3, 0.55, 0.209, 0, 0, 98, 60, 36 },
|
||||
{ "Back", "Medallion", 0.64, 0.4, 0.06, 0, 2.58, 0.45, 0, 1.3, 0.55, 0.209, 0, 0, 206, 162, 70 },
|
||||
{ "Back", "MedallionR", 0.44, 0.44, 0.05, 0, 2.579, 0.689, 0, 2.579, 0.689, 0.209, 0, 0.785, 160, 120, 46 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, -2.3, 2.6, 0.455, 0, 1.3, 0.55, 0.209, 0, 0, 58, 58, 64 },
|
||||
{ "Back", "BackStrap", 0.2, 1.5, 0.05, 2.3, 2.6, 0.455, 0, 1.3, 0.55, 0.209, 0, 0, 58, 58, 64 },
|
||||
{ "Planter", "Tub", 1.5, 1.2, 1.5, 4, 0.6, -0.15, 0, 0, 0, 0, 0, 0, 144, 92, 52 },
|
||||
{ "Planter", "TubLip", 1.7, 0.12, 1.7, 4, 1.26, -0.15, 0, 0, 0, 0, 0, 0, 98, 60, 36 },
|
||||
{ "Planter", "TubBand", 1.58, 0.14, 1.58, 4, 0.22, -0.15, 0, 0, 0, 0, 0, 0, 58, 58, 64 },
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -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 ') : 'ошибок нет');
|
||||
@@ -0,0 +1,352 @@
|
||||
// Текстуры окон в стиле иконок (дерево, золотая оковка, пергамент, сургуч) для 9-slice в Roblox.
|
||||
// node tools/ui/make-ui.js → assets/ui/<имя>.png и assets/reference/ui_sheet.png
|
||||
// Размеры срезов (SliceCenter) каждого файла — в таблице SLICES внизу, их же повторяет src/ReplicatedStorage/UiImages.lua.
|
||||
const fs = require('fs'), path = require('path'), zlib = require('zlib');
|
||||
const ROOT = path.join(__dirname, '..', '..');
|
||||
const OUT = path.join(ROOT, 'assets', 'ui');
|
||||
fs.mkdirSync(OUT, { recursive: true });
|
||||
|
||||
// ---------- PNG
|
||||
function crc32(buf) {
|
||||
let crc = 0xffffffff;
|
||||
for (let n = 0; n < buf.length; n++) {
|
||||
let c = (crc ^ buf[n]) & 0xff;
|
||||
for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;
|
||||
crc = (crc >>> 8) ^ c;
|
||||
}
|
||||
return (crc ^ 0xffffffff) >>> 0;
|
||||
}
|
||||
function chunk(type, data) {
|
||||
const len = Buffer.alloc(4); len.writeUInt32BE(data.length);
|
||||
const td = Buffer.concat([Buffer.from(type, 'ascii'), data]);
|
||||
const crc = Buffer.alloc(4); crc.writeUInt32BE(crc32(td));
|
||||
return Buffer.concat([len, td, crc]);
|
||||
}
|
||||
function png(w, h, rgba) {
|
||||
const raw = Buffer.alloc((w * 4 + 1) * h);
|
||||
for (let y = 0; y < h; y++) rgba.copy(raw, y * (w * 4 + 1) + 1, y * w * 4, (y + 1) * w * 4);
|
||||
const ihdr = Buffer.alloc(13); ihdr.writeUInt32BE(w, 0); ihdr.writeUInt32BE(h, 4); ihdr[8] = 8; ihdr[9] = 6;
|
||||
return Buffer.concat([Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]), chunk('IHDR', ihdr), chunk('IDAT', zlib.deflateSync(raw, { level: 9 })), chunk('IEND', Buffer.alloc(0))]);
|
||||
}
|
||||
|
||||
// ---------- шум
|
||||
function hash(x, y, s = 0) { let h = (x * 374761393 + y * 668265263 + s * 982451653) | 0; h = (h ^ (h >>> 13)) * 1274126177; return ((h ^ (h >>> 16)) >>> 0) / 4294967296; }
|
||||
function vnoise(x, y, s = 0) {
|
||||
const xi = Math.floor(x), yi = Math.floor(y), xf = x - xi, yf = y - yi;
|
||||
const u = xf * xf * (3 - 2 * xf), v = yf * yf * (3 - 2 * yf);
|
||||
const a = hash(xi, yi, s), b = hash(xi + 1, yi, s), c = hash(xi, yi + 1, s), d = hash(xi + 1, yi + 1, s);
|
||||
return a + (b - a) * u + (c - a) * v + (a - b - c + d) * u * v;
|
||||
}
|
||||
const fbm = (x, y, s = 0) => vnoise(x, y, s) * 0.55 + vnoise(x * 2.1, y * 2.1, s + 7) * 0.3 + vnoise(x * 4.3, y * 4.3, s + 13) * 0.15;
|
||||
const clamp = (v, a = 0, b = 1) => Math.max(a, Math.min(b, v));
|
||||
const mix = (a, b, t) => a.map((v, i) => v + (b[i] - v) * t);
|
||||
|
||||
// ---------- холст: shade(x, y) → [r,g,b,a] или null; 4× сглаживание по краям фигур
|
||||
const SS = 4;
|
||||
function draw(w, h, layers) {
|
||||
const out = Buffer.alloc(w * h * 4);
|
||||
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
|
||||
let r = 0, g = 0, b = 0, a = 0;
|
||||
for (let sy = 0; sy < SS; sy++) for (let sx = 0; sx < SS; sx++) {
|
||||
const px = x + (sx + 0.5) / SS, py = y + (sy + 0.5) / SS;
|
||||
let col = [0, 0, 0], al = 0;
|
||||
for (const L of layers) { // слои снизу вверх, у каждого inside и цвет
|
||||
if (!L.inside(px, py)) continue;
|
||||
const c = L.color(px, py), ca = L.alpha ? L.alpha(px, py) : 1;
|
||||
col = mix(col, c, al === 0 ? 1 : ca); al = Math.max(al, ca);
|
||||
}
|
||||
r += col[0] * al; g += col[1] * al; b += col[2] * al; a += al;
|
||||
}
|
||||
const n = SS * SS, o = (y * w + x) * 4;
|
||||
if (a > 0) { out[o] = clamp(r / a, 0, 255); out[o + 1] = clamp(g / a, 0, 255); out[o + 2] = clamp(b / a, 0, 255); }
|
||||
out[o + 3] = Math.round(255 * a / n);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
// ---------- фигуры
|
||||
const rrect = (x0, y0, x1, y1, r) => (x, y) => {
|
||||
if (x < x0 || x > x1 || y < y0 || y > y1) return false;
|
||||
const cx = clamp(x, x0 + r, x1 - r), cy = clamp(y, y0 + r, y1 - r);
|
||||
return (x - cx) ** 2 + (y - cy) ** 2 <= r * r;
|
||||
};
|
||||
// расстояние до края скруглённого прямоугольника внутрь (для рамок и фасок)
|
||||
const rdist = (x0, y0, x1, y1, r) => (x, y) => {
|
||||
const cx = clamp(x, x0 + r, x1 - r), cy = clamp(y, y0 + r, y1 - r);
|
||||
const inCorner = (x < x0 + r || x > x1 - r) && (y < y0 + r || y > y1 - r);
|
||||
if (inCorner) return r - Math.hypot(x - cx, y - cy);
|
||||
return Math.min(x - x0, x1 - x, y - y0, y1 - y);
|
||||
};
|
||||
const circle = (cx, cy, r) => (x, y) => (x - cx) ** 2 + (y - cy) ** 2 <= r * r;
|
||||
const poly = pts => (x, y) => {
|
||||
let inside = false;
|
||||
for (let i = 0, j = pts.length - 1; i < pts.length; j = i++) {
|
||||
const [xi, yi] = pts[i], [xj, yj] = pts[j];
|
||||
if ((yi > y) !== (yj > y) && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) inside = !inside;
|
||||
}
|
||||
return inside;
|
||||
};
|
||||
const ALL = () => true;
|
||||
|
||||
// ---------- палитра (как в иконках и UiTheme)
|
||||
const P = {
|
||||
outline: [34, 22, 14], woodD: [58, 38, 24], wood: [96, 64, 38], woodL: [132, 90, 54],
|
||||
gold: [222, 172, 82], goldL: [255, 220, 130], goldD: [140, 98, 44],
|
||||
parch: [238, 222, 182], parchD: [196, 168, 118], ink: [52, 36, 24],
|
||||
crimson: [168, 44, 38], crimsonD: [104, 24, 22], green: [70, 128, 64], greenD: [38, 78, 36],
|
||||
};
|
||||
|
||||
// древесина: волокна вдоль оси (vertical — вдоль Y), доски шириной plank
|
||||
function woodColor(base, x, y, { vertical = false, plank = 32, seed = 1, contrast = 1 } = {}) {
|
||||
const u = vertical ? x : y, v = vertical ? y : x;
|
||||
const idx = Math.floor(u / plank), local = u - idx * plank;
|
||||
const tone = 0.88 + hash(idx, 3, seed) * 0.24;
|
||||
const grain = Math.sin((v * 0.05 + fbm(u * 0.15, v * 0.02 + idx * 5, seed) * 6) * 3.1) * 0.5 + 0.5;
|
||||
const fine = fbm(u * 0.6, v * 0.08, seed + 3);
|
||||
let k = tone * (0.86 + 0.14 * grain * contrast + (fine - 0.5) * 0.12 * contrast);
|
||||
if (local < 1.6 || local > plank - 1.2) k *= 0.55; // щель между досками
|
||||
return base.map(c => c * k);
|
||||
}
|
||||
|
||||
// ---------- текстуры
|
||||
const TEX = {};
|
||||
|
||||
// 1) деревянная панель окна: доски, золотая оковка 7 px, заклёпки в углах. Срез 32.
|
||||
TEX.panel_wood = { w: 128, h: 128, slice: 32, layers: (() => {
|
||||
const W = 128, d = rdist(1, 1, W - 1, W - 1, 14);
|
||||
return [
|
||||
{ inside: rrect(1, 1, W - 1, W - 1, 14), color: (x, y) => {
|
||||
const t = d(x, y);
|
||||
if (t < 2) return P.outline;
|
||||
if (t < 9) { // оковка: светлая сверху, фаска
|
||||
const f = (t - 2) / 7, top = 1 - y / W;
|
||||
const g = mix(P.goldD, P.goldL, clamp(Math.sin(f * Math.PI) * 0.8 + top * 0.3));
|
||||
return g;
|
||||
}
|
||||
if (t < 10.5) return P.outline;
|
||||
const shade = clamp((t - 10.5) / 10) * 0.25 + 0.75; // тень у оковки
|
||||
return woodColor(P.wood, x, y, { vertical: true, plank: 26, seed: 4 }).map(c => c * shade);
|
||||
} },
|
||||
// заклёпки в углах на оковке
|
||||
...[[12, 12], [W - 12, 12], [12, W - 12], [W - 12, W - 12]].map(([cx, cy]) => ({
|
||||
inside: circle(cx, cy, 6.5), color: (x, y) => {
|
||||
const r = Math.hypot(x - cx, y - cy);
|
||||
if (r > 5.2) return P.outline;
|
||||
const hl = clamp(1 - Math.hypot(x - cx + 2, y - cy + 2) / 5);
|
||||
return mix(P.goldD, [255, 240, 190], hl);
|
||||
} })),
|
||||
];
|
||||
})() };
|
||||
|
||||
// 2) пергаментная вставка с потёртыми краями. Срез 24.
|
||||
TEX.parchment = { w: 128, h: 128, slice: 24, layers: (() => {
|
||||
const W = 128;
|
||||
const edge = (x, y) => { // неровный край: расстояние до края минус шум
|
||||
const d = Math.min(x, y, W - x, W - y);
|
||||
return d - 3 - fbm(x * 0.18, y * 0.18, 9) * 4;
|
||||
};
|
||||
return [{ inside: (x, y) => edge(x, y) > 0, color: (x, y) => {
|
||||
const e = edge(x, y);
|
||||
if (e < 1.3) return [120, 86, 50];
|
||||
const burn = clamp(1 - (e - 1.3) / 14); // потемнение к краям
|
||||
const spots = fbm(x * 0.07, y * 0.07, 21);
|
||||
let c = mix(P.parch, P.parchD, burn * 0.85 + (spots - 0.5) * 0.25);
|
||||
const n = (hash(Math.floor(x), Math.floor(y), 5) - 0.5) * 8;
|
||||
return c.map(v => v + n);
|
||||
} }];
|
||||
})() };
|
||||
|
||||
// 3) тёмная дощатая подложка (тайл 128×128, бесшовный по горизонтали доски)
|
||||
TEX.planks_dark = { w: 128, h: 128, slice: 0, tile: true, layers: [{ inside: ALL, color: (x, y) => {
|
||||
// шум с периодом 128, чтобы тайл был бесшовным
|
||||
const c = woodColor(P.woodD, x, y, { vertical: false, plank: 32, seed: 8, contrast: 0.9 });
|
||||
return c;
|
||||
} }] };
|
||||
|
||||
// 4) лента-заголовок: багровая, с вырезами-«ласточкиными хвостами» и золотой каймой. Срез по бокам 44.
|
||||
TEX.ribbon = { w: 224, h: 64, slice: 44, sliceY: 20, layers: (() => {
|
||||
const W = 224, H = 64;
|
||||
const tailL = poly([[0, 14], [34, 14], [34, 58], [0, 58], [12, 36]]);
|
||||
const tailR = poly([[W, 14], [W - 34, 14], [W - 34, 58], [W, 58], [W - 12, 36]]);
|
||||
const body = (x, y) => x >= 20 && x <= W - 20 && y >= 4 && y <= 52;
|
||||
return [
|
||||
{ inside: (x, y) => tailL(x, y) || tailR(x, y), color: (x, y) => {
|
||||
const k = 0.7 + 0.3 * (1 - y / H);
|
||||
return P.crimsonD.map(c => c * k);
|
||||
} },
|
||||
{ inside: (x, y) => x >= 18 && x <= W - 18 && y >= 2 && y <= 54, color: (x, y) => {
|
||||
if (!body(x, y)) return P.outline;
|
||||
const t = Math.min(y - 4, 52 - y);
|
||||
if (t < 4) return mix(P.goldD, P.goldL, t / 4 * (1 - y / H * 0.5));
|
||||
if (t < 5.2) return P.outline;
|
||||
const k = 0.78 + 0.32 * Math.cos((y - 18) / 40 * Math.PI); // объём ткани
|
||||
return P.crimson.map(c => c * k);
|
||||
} },
|
||||
];
|
||||
})() };
|
||||
|
||||
// 5) кнопки 96×48: цвет, золотая кайма 3 px, фаска; «нажатая» — темнее, без блика. Срез 16.
|
||||
function button(base, dark, pressed) {
|
||||
const W = 96, H = 48, d = rdist(1, 1, W - 1, H - 1, 10);
|
||||
return { w: W, h: H, slice: 16, layers: [{ inside: rrect(1, 1, W - 1, H - 1, 10), color: (x, y) => {
|
||||
const t = d(x, y);
|
||||
if (t < 1.8) return P.outline;
|
||||
if (t < 4.5) return mix(P.goldD, P.goldL, pressed ? 0.25 : clamp(1 - y / H + 0.2));
|
||||
if (t < 5.6) return P.outline;
|
||||
const v = (y - 5) / (H - 10);
|
||||
let c = pressed ? mix(dark, base, clamp(v * 0.8)) : mix(base.map(q => Math.min(255, q * 1.25)), dark, clamp(v));
|
||||
if (!pressed && y < 14 && t > 6) c = mix(c, [255, 255, 255], 0.12 * (1 - (y - 6) / 8)); // блик сверху
|
||||
return c;
|
||||
} }] };
|
||||
}
|
||||
TEX.btn_wood = button(P.woodL, P.woodD, false);
|
||||
TEX.btn_wood_down = button(P.woodL, P.woodD, true);
|
||||
TEX.btn_green = button(P.green, P.greenD, false);
|
||||
TEX.btn_green_down = button(P.green, P.greenD, true);
|
||||
TEX.btn_red = button(P.crimson, P.crimsonD, false);
|
||||
TEX.btn_red_down = button(P.crimson, P.crimsonD, true);
|
||||
TEX.btn_gold = button([226, 176, 80], [150, 104, 40], false);
|
||||
TEX.btn_gold_down = button([226, 176, 80], [150, 104, 40], true);
|
||||
|
||||
// 6) вкладки 96×48: скругление только сверху. Активная — золото, неактивная — тёмное дерево. Срез 16.
|
||||
function tab(active) {
|
||||
const W = 96, H = 48;
|
||||
const shape = (x, y) => rrect(1, 1, W - 1, H + 12, 12)(x, y) && y <= H;
|
||||
const d = rdist(1, 1, W - 1, H + 12, 12);
|
||||
return { w: W, h: H, slice: 16, layers: [{ inside: shape, color: (x, y) => {
|
||||
const t = d(x, y);
|
||||
if (t < 1.8) return P.outline;
|
||||
if (t < 4) return active ? P.goldL : P.goldD;
|
||||
if (t < 5) return P.outline;
|
||||
const v = y / H;
|
||||
return active ? mix([250, 214, 130], [196, 140, 60], v) : woodColor(mix(P.wood, P.woodD, v * 0.6), x, y, { plank: 60, seed: 12 });
|
||||
} }] };
|
||||
}
|
||||
TEX.tab_on = tab(true);
|
||||
TEX.tab_off = tab(false);
|
||||
|
||||
// 7) слот: углублённая ячейка (тень внутри). Срез 20.
|
||||
TEX.slot = { w: 96, h: 96, slice: 20, layers: (() => {
|
||||
const d = rdist(1, 1, 95, 95, 12);
|
||||
return [{ inside: rrect(1, 1, 95, 95, 12), color: (x, y) => {
|
||||
const t = d(x, y);
|
||||
if (t < 2) return P.outline;
|
||||
if (t < 3.5) return P.goldD;
|
||||
const inner = clamp((t - 3.5) / 10); // тень внутрь
|
||||
const topShadow = clamp(1 - (y - 4) / 18) * 0.35;
|
||||
return [30, 22, 16].map((c, i) => c * (0.7 + 0.5 * inner) * (1 - topShadow) + [8, 6, 4][i]);
|
||||
} }];
|
||||
})() };
|
||||
|
||||
// 8) рамка карточки (светлая, красится в цвет редкости через ImageColor3): внутри прозрачная. Срез 20.
|
||||
TEX.card_frame = { w: 96, h: 96, slice: 20, layers: (() => {
|
||||
const d = rdist(1, 1, 95, 95, 12);
|
||||
return [
|
||||
{ inside: (x, y) => rrect(1, 1, 95, 95, 12)(x, y) && d(x, y) < 8, color: (x, y) => {
|
||||
const t = d(x, y);
|
||||
if (t < 1.6 || t > 6.6) return [70, 70, 70];
|
||||
const k = 0.75 + 0.25 * Math.sin((t - 1.6) / 5 * Math.PI);
|
||||
return [255, 255, 255].map(c => c * k);
|
||||
} },
|
||||
// уголки-ромбики
|
||||
...[[10, 10], [86, 10], [10, 86], [86, 86]].map(([cx, cy]) => ({
|
||||
inside: poly([[cx, cy - 7], [cx + 7, cy], [cx, cy + 7], [cx - 7, cy]]),
|
||||
color: (x, y) => (Math.abs(x - cx) + Math.abs(y - cy) > 5.5 ? [60, 60, 60] : [255, 255, 255]),
|
||||
})),
|
||||
];
|
||||
})() };
|
||||
|
||||
// 9) полоса прогресса: рамка (тёмный жёлоб в золоте) и заливка (светлая, красится). Срез 12.
|
||||
TEX.bar_frame = { w: 96, h: 24, slice: 12, layers: (() => {
|
||||
const d = rdist(1, 1, 95, 23, 11);
|
||||
return [{ inside: rrect(1, 1, 95, 23, 11), color: (x, y) => {
|
||||
const t = d(x, y);
|
||||
if (t < 1.6) return P.outline;
|
||||
if (t < 3.6) return mix(P.goldD, P.gold, 1 - y / 24);
|
||||
if (t < 4.4) return P.outline;
|
||||
return [22, 15, 10].map(c => c * (0.8 + 0.4 * (y / 24)));
|
||||
} }];
|
||||
})() };
|
||||
TEX.bar_fill = { w: 96, h: 24, slice: 10, layers: (() => {
|
||||
return [{ inside: rrect(0, 0, 96, 24, 10), color: (x, y) => {
|
||||
const v = y / 24;
|
||||
let k = 1 - v * 0.35;
|
||||
if (y < 8) k = mix([k], [1.15], (8 - y) / 8 * 0.6)[0];
|
||||
return [255, 255, 255].map(c => clamp(c * k, 0, 255));
|
||||
} }];
|
||||
})() };
|
||||
|
||||
// 10) разделитель с завитком по центру (не растягивается в середине: картинка ScaleType.Fit)
|
||||
TEX.divider = { w: 256, h: 24, slice: 0, layers: (() => {
|
||||
const line = (x, y) => Math.abs(y - 12) < 1.6 && x > 6 && x < 250 && Math.abs(x - 128) > 22;
|
||||
const fade = x => clamp(Math.min(x - 6, 250 - x) / 40);
|
||||
const curl = (x, y) => {
|
||||
const dx = Math.abs(x - 128);
|
||||
const r1 = Math.hypot(dx - 10, y - 12);
|
||||
return (r1 > 5 && r1 < 8 && !(dx < 10 && y < 12)) || poly([[128, 3], [135, 12], [128, 21], [121, 12]])(x, y);
|
||||
};
|
||||
return [
|
||||
{ inside: (x, y) => line(x, y) || curl(x, y), color: () => P.gold, alpha: x => (Math.abs(x - 128) < 22 ? 1 : fade(x)) },
|
||||
];
|
||||
})() };
|
||||
|
||||
// 11) уголок-орнамент (левый верхний; остальные — поворотом в Roblox)
|
||||
TEX.corner = { w: 64, h: 64, slice: 0, layers: (() => {
|
||||
const arm = (x, y) => (y > 6 && y < 11 && x > 6 && x < 58 - y * 0.2) || (x > 6 && x < 11 && y > 6 && y < 58 - x * 0.2);
|
||||
const swirl = (x, y) => { const r = Math.hypot(x - 22, y - 22); return r > 6 && r < 10; };
|
||||
const gem = circle(13, 13, 7);
|
||||
return [
|
||||
{ inside: (x, y) => arm(x, y) || swirl(x, y), color: (x, y) => mix(P.goldL, P.goldD, (x + y) / 100) },
|
||||
{ inside: gem, color: (x, y) => mix([230, 80, 70], P.crimsonD, Math.hypot(x - 11, y - 11) / 8) },
|
||||
];
|
||||
})() };
|
||||
|
||||
// 12) пустая сумка: иллюстрация для пустого состояния (корзина с удочкой)
|
||||
TEX.empty_basket = { w: 192, h: 160, slice: 0, layers: (() => {
|
||||
const basket = poly([[40, 70], [152, 70], [138, 150], [54, 150]]);
|
||||
return [
|
||||
{ inside: (x, y) => Math.abs((x - 176) * 0.75 + (y - 10) * 0.66) < 3 && x > 84 && x < 178 && y > 8 && y < 112, color: () => P.woodL }, // удочка
|
||||
{ inside: (x, y) => Math.abs(x - 177) < 0.9 && y > 10 && y < 60, color: () => [240, 236, 220] }, // леска
|
||||
{ inside: circle(177, 66, 6), color: (x, y) => (y < 66 ? [214, 66, 56] : [250, 248, 240]) }, // поплавок
|
||||
{ inside: basket, color: (x, y) => {
|
||||
const row = Math.floor((y - 70) / 13), col = Math.floor((x + (row % 2) * 9) / 18);
|
||||
const k = 0.8 + ((row + col) % 2) * 0.2;
|
||||
const edge = !poly([[44, 73], [148, 73], [135, 147], [57, 147]])(x, y);
|
||||
return edge ? P.outline : [196, 150, 84].map(c => c * k);
|
||||
} },
|
||||
{ inside: (x, y) => ((x - 96) / 60) ** 2 + ((y - 70) / 12) ** 2 <= 1, color: (x, y) => (((x - 96) / 52) ** 2 + ((y - 70) / 8) ** 2 <= 1 ? [44, 30, 20] : [150, 108, 56]) },
|
||||
];
|
||||
})() };
|
||||
|
||||
// ---------- запись и превью
|
||||
const names = Object.keys(TEX);
|
||||
const sheetW = 1200, pad = 16;
|
||||
let cx = pad, cy = pad, rowH = 0;
|
||||
const placed = [];
|
||||
for (const n of names) {
|
||||
const t = TEX[n];
|
||||
const img = draw(t.w, t.h, t.layers);
|
||||
fs.writeFileSync(path.join(OUT, n + '.png'), png(t.w, t.h, img));
|
||||
const dw = t.w * (t.w <= 96 ? 1.5 : 1), dh = t.h * (t.w <= 96 ? 1.5 : 1);
|
||||
if (cx + dw > sheetW - pad) { cx = pad; cy += rowH + pad; rowH = 0; }
|
||||
placed.push({ img, t, x: cx, y: cy, s: dw / t.w });
|
||||
cx += dw + pad; rowH = Math.max(rowH, dh);
|
||||
}
|
||||
const sheetH = cy + rowH + pad;
|
||||
const sheet = Buffer.alloc(sheetW * sheetH * 4);
|
||||
for (let y = 0; y < sheetH; y++) for (let x = 0; x < sheetW; x++) { // фон — шахматка серо-синяя, чтобы видна прозрачность
|
||||
const o = (y * sheetW + x) * 4, k = ((x >> 4) + (y >> 4)) % 2 ? 70 : 84;
|
||||
sheet[o] = k; sheet[o + 1] = k + 6; sheet[o + 2] = k + 14; sheet[o + 3] = 255;
|
||||
}
|
||||
for (const p of placed) {
|
||||
const W = Math.round(p.t.w * p.s), H = Math.round(p.t.h * p.s);
|
||||
for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) {
|
||||
const sx = Math.min(p.t.w - 1, Math.floor(x / p.s)), sy = Math.min(p.t.h - 1, Math.floor(y / p.s));
|
||||
const s = (sy * p.t.w + sx) * 4, d = ((p.y + y) * sheetW + p.x + x) * 4, a = p.img[s + 3] / 255;
|
||||
for (let j = 0; j < 3; j++) sheet[d + j] = sheet[d + j] * (1 - a) + p.img[s + j] * a;
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(path.join(ROOT, 'assets', 'reference', 'ui_sheet.png'), png(sheetW, sheetH, sheet));
|
||||
const slices = {};
|
||||
for (const n of names) slices[n] = { w: TEX[n].w, h: TEX[n].h, slice: TEX[n].slice, sliceY: TEX[n].sliceY, tile: !!TEX[n].tile };
|
||||
console.log(JSON.stringify(slices));
|
||||
@@ -0,0 +1,555 @@
|
||||
// Фэнтези-набор окон (резное дерево, филигрань, знамя, сургуч): SVG → PNG через headless Chrome.
|
||||
// node tools/ui3/make-ui3.js → assets/ui3/*.png, assets/reference/ui3_style_sheet.png, ui3_mock_bag.png
|
||||
// Срезы 9-slice каждого файла — в SLICES (внизу); их же потом повторит UiImages.lua.
|
||||
const fs = require('fs'), path = require('path'), { execFileSync } = require('child_process');
|
||||
const ROOT = path.join(__dirname, '..', '..');
|
||||
const OUT = path.join(ROOT, 'assets', 'ui3');
|
||||
const TMP = path.join(require('os').tmpdir(), 'ui3');
|
||||
fs.mkdirSync(OUT, { recursive: true });
|
||||
fs.mkdirSync(TMP, { recursive: true });
|
||||
const CHROME = ['C:/Program Files/Google/Chrome/Application/chrome.exe', 'C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe'].find(p => fs.existsSync(p));
|
||||
|
||||
function shot(html, w, h, out) {
|
||||
const f = path.join(TMP, path.basename(out) + '.html');
|
||||
fs.writeFileSync(f, `<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;background:transparent;overflow:hidden}</style></head><body>${html}</body></html>`);
|
||||
execFileSync(CHROME, ['--headless=new', '--disable-gpu', '--hide-scrollbars', '--force-device-scale-factor=1', '--default-background-color=00000000',
|
||||
`--window-size=${w},${h}`, `--screenshot=${out}`, 'file:///' + f.replace(/\\/g, '/')], { stdio: 'ignore' });
|
||||
}
|
||||
const svg = (w, h, body) => `<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}">${DEFS}${body}</svg>`;
|
||||
|
||||
// ---------- общие градиенты и фильтры
|
||||
const DEFS = `<defs>
|
||||
<linearGradient id="gold" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#fff4c2"/><stop offset=".22" stop-color="#f2c75c"/><stop offset=".5" stop-color="#b07a26"/>
|
||||
<stop offset=".72" stop-color="#f6d47c"/><stop offset="1" stop-color="#6e4712"/></linearGradient>
|
||||
<linearGradient id="goldD" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0" stop-color="#ffe9a0"/><stop offset=".45" stop-color="#c8902e"/><stop offset="1" stop-color="#5c3a0e"/></linearGradient>
|
||||
<linearGradient id="iron" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#a7adb5"/><stop offset=".45" stop-color="#5d636b"/><stop offset="1" stop-color="#2a2d31"/></linearGradient>
|
||||
<linearGradient id="walnut" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#7a5030"/><stop offset=".5" stop-color="#5a3a20"/><stop offset="1" stop-color="#3a2412"/></linearGradient>
|
||||
<linearGradient id="walnutL" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#a87447"/><stop offset="1" stop-color="#6b4526"/></linearGradient>
|
||||
<linearGradient id="crimson" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#c8443a"/><stop offset=".55" stop-color="#8e2320"/><stop offset="1" stop-color="#5a1312"/></linearGradient>
|
||||
<linearGradient id="emerald" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#5fb35a"/><stop offset=".5" stop-color="#2e6e2c"/><stop offset="1" stop-color="#173d16"/></linearGradient>
|
||||
<radialGradient id="gemG" cx=".35" cy=".3" r=".75"><stop offset="0" stop-color="#d8ffd0"/><stop offset=".25" stop-color="#4fc36a"/><stop offset=".7" stop-color="#0f6a2c"/><stop offset="1" stop-color="#062b12"/></radialGradient>
|
||||
<radialGradient id="gemR" cx=".35" cy=".3" r=".75"><stop offset="0" stop-color="#ffd8d0"/><stop offset=".25" stop-color="#e2463c"/><stop offset=".7" stop-color="#7a0f12"/><stop offset="1" stop-color="#2e0506"/></radialGradient>
|
||||
<radialGradient id="dome" cx=".35" cy=".3" r=".8"><stop offset="0" stop-color="#fff6d0"/><stop offset=".4" stop-color="#d9a849"/><stop offset="1" stop-color="#4d300a"/></radialGradient>
|
||||
<radialGradient id="domeI" cx=".35" cy=".3" r=".8"><stop offset="0" stop-color="#eef2f6"/><stop offset=".45" stop-color="#7b828b"/><stop offset="1" stop-color="#1c1e21"/></radialGradient>
|
||||
<radialGradient id="wax" cx=".4" cy=".35" r=".7"><stop offset="0" stop-color="#e2584c"/><stop offset=".6" stop-color="#9a1f1c"/><stop offset="1" stop-color="#4e0a0a"/></radialGradient>
|
||||
<radialGradient id="vign" cx=".5" cy=".5" r=".7"><stop offset=".55" stop-color="#000" stop-opacity="0"/><stop offset="1" stop-color="#000" stop-opacity=".55"/></radialGradient>
|
||||
<filter id="grainH" x="0" y="0" width="100%" height="100%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.006 0.14" numOctaves="4" seed="7"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 .1 0 0 0 0 .055 0 0 0 0 .02 0 0 0 -2.2 1.25"/>
|
||||
<feComposite in2="SourceGraphic" operator="in"/></filter>
|
||||
<filter id="grainV" x="0" y="0" width="100%" height="100%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.14 0.006" numOctaves="4" seed="11"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 .1 0 0 0 0 .055 0 0 0 0 .02 0 0 0 -2.2 1.25"/>
|
||||
<feComposite in2="SourceGraphic" operator="in"/></filter>
|
||||
<filter id="speck" x="0" y="0" width="100%" height="100%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2" seed="3"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.4 .9"/>
|
||||
<feComposite in2="SourceGraphic" operator="in"/></filter>
|
||||
<filter id="bevel" x="-10%" y="-10%" width="120%" height="120%">
|
||||
<feGaussianBlur in="SourceAlpha" stdDeviation="1.6" result="b"/>
|
||||
<feSpecularLighting in="b" surfaceScale="3.5" specularConstant=".9" specularExponent="16" lighting-color="#fff" result="s"><feDistantLight azimuth="235" elevation="42"/></feSpecularLighting>
|
||||
<feComposite in="s" in2="SourceAlpha" operator="in" result="s2"/>
|
||||
<feComposite in="SourceGraphic" in2="s2" operator="arithmetic" k1="0" k2="1" k3=".7" k4="0"/></filter>
|
||||
<filter id="bevelSoft" x="-10%" y="-10%" width="120%" height="120%">
|
||||
<feGaussianBlur in="SourceAlpha" stdDeviation="3" result="b"/>
|
||||
<feSpecularLighting in="b" surfaceScale="5" specularConstant=".5" specularExponent="28" lighting-color="#ffe9c8" result="s"><feDistantLight azimuth="235" elevation="35"/></feSpecularLighting>
|
||||
<feComposite in="s" in2="SourceAlpha" operator="in" result="s2"/>
|
||||
<feComposite in="SourceGraphic" in2="s2" operator="arithmetic" k1="0" k2="1" k3=".22" k4="0"/></filter>
|
||||
<filter id="drop" x="-20%" y="-20%" width="140%" height="140%"><feDropShadow dx="0" dy="3" stdDeviation="3" flood-color="#000" flood-opacity=".6"/></filter>
|
||||
<filter id="dropS" x="-20%" y="-20%" width="140%" height="140%"><feDropShadow dx="0" dy="1.5" stdDeviation="1.2" flood-color="#000" flood-opacity=".7"/></filter>
|
||||
<filter id="inner" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feFlood flood-color="#000" flood-opacity=".85"/><feComposite in2="SourceAlpha" operator="out"/>
|
||||
<feGaussianBlur stdDeviation="7"/><feComposite in2="SourceAlpha" operator="in"/>
|
||||
<feComposite in2="SourceGraphic" operator="over"/></filter>
|
||||
<filter id="ragged" x="-5%" y="-5%" width="110%" height="110%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.04" numOctaves="3" seed="5" result="n"/>
|
||||
<feDisplacementMap in="SourceGraphic" in2="n" scale="14" xChannelSelector="R" yChannelSelector="G"/></filter>
|
||||
<filter id="waxEdge" x="-10%" y="-10%" width="120%" height="120%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.06" numOctaves="2" seed="9" result="n"/>
|
||||
<feDisplacementMap in="SourceGraphic" in2="n" scale="12" xChannelSelector="R" yChannelSelector="G"/></filter>
|
||||
<filter id="stains" x="0" y="0" width="100%" height="100%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.018" numOctaves="4" seed="21"/>
|
||||
<feColorMatrix type="matrix" values="0 0 0 0 .42 0 0 0 0 .27 0 0 0 0 .1 0 0 0 -3 1.55"/>
|
||||
<feComposite in2="SourceGraphic" operator="in"/></filter>
|
||||
</defs>`;
|
||||
|
||||
// ---------- детали
|
||||
const rivet = (x, y, r = 5, iron = false) => `<g filter="url(#dropS)"><circle cx="${x}" cy="${y}" r="${r}" fill="url(#${iron ? 'domeI' : 'dome'})" stroke="#2a1606" stroke-width="1"/></g>`;
|
||||
// лист с прожилкой: (x,y) — основание, угол a (градусы), длина l
|
||||
const leaf = (x, y, a, l = 22, fill = 'url(#goldD)') => `<g transform="translate(${x} ${y}) rotate(${a})">
|
||||
<path d="M0 0 C ${l * 0.3} ${-l * 0.32}, ${l * 0.75} ${-l * 0.3}, ${l} 0 C ${l * 0.75} ${l * 0.3}, ${l * 0.3} ${l * 0.32}, 0 0 Z" fill="${fill}" stroke="#3a2306" stroke-width="1.2"/>
|
||||
<path d="M2 0 L ${l * 0.9} 0" stroke="#5c3a0e" stroke-width="1" opacity=".8"/></g>`;
|
||||
// кельтский узел-трикветр вокруг камня: каждая дуга — тёмная подложка и золото поверх (эффект плетения)
|
||||
function triquetra(cx, cy, R, gem = 'gemG') {
|
||||
const arcs = [0, 120, 240].map(a => {
|
||||
const r = (a - 90) * Math.PI / 180;
|
||||
const px = cx + Math.cos(r) * R * 0.55, py = cy + Math.sin(r) * R * 0.55;
|
||||
return `<circle cx="${px}" cy="${py}" r="${R * 0.62}" fill="none"/>`;
|
||||
});
|
||||
const ring = `<circle cx="${cx}" cy="${cy}" r="${R * 0.98}" fill="none"/>`;
|
||||
const all = arcs.join('') + ring;
|
||||
return `<g filter="url(#drop)">
|
||||
<g stroke="#2a1606" stroke-width="${R * 0.24}">${all}</g>
|
||||
<g stroke="url(#gold)" stroke-width="${R * 0.14}" filter="url(#bevel)">${all}</g>
|
||||
<circle cx="${cx}" cy="${cy}" r="${R * 0.36}" fill="url(#gold)" stroke="#2a1606" stroke-width="1.5"/>
|
||||
<circle cx="${cx}" cy="${cy}" r="${R * 0.27}" fill="url(#${gem})" stroke="#1a0c02" stroke-width="1"/>
|
||||
<ellipse cx="${cx - R * 0.09}" cy="${cy - R * 0.11}" rx="${R * 0.08}" ry="${R * 0.05}" fill="#fff" opacity=".8"/></g>`;
|
||||
}
|
||||
// филигранный уголок (левый верхний, область size×size): кованая скоба с завитками, листья и узел
|
||||
function filigreeCorner(size) {
|
||||
const s = size;
|
||||
return `<g>
|
||||
<path d="M10 ${s * 0.92} L10 22 Q10 10 22 10 L${s * 0.92} 10" fill="none" stroke="#2a1606" stroke-width="14" stroke-linecap="round"/>
|
||||
<path d="M10 ${s * 0.92} L10 22 Q10 10 22 10 L${s * 0.92} 10" fill="none" stroke="url(#gold)" stroke-width="8" stroke-linecap="round" filter="url(#bevel)"/>
|
||||
<path d="M${s * 0.92} 10 q 14 2 12 16 q -2 10 -12 6" fill="none" stroke="url(#gold)" stroke-width="4" stroke-linecap="round"/>
|
||||
<path d="M10 ${s * 0.92} q 2 14 16 12 q 10 -2 6 -12" fill="none" stroke="url(#gold)" stroke-width="4" stroke-linecap="round"/>
|
||||
<path d="M34 ${s * 0.78} C 30 ${s * 0.55}, 30 ${s * 0.42}, 46 ${s * 0.36}" fill="none" stroke="#c8902e" stroke-width="3"/>
|
||||
<path d="M${s * 0.78} 34 C ${s * 0.55} 30, ${s * 0.42} 30, ${s * 0.36} 46" fill="none" stroke="#c8902e" stroke-width="3"/>
|
||||
${leaf(34, s * 0.7, 200, 20)}${leaf(36, s * 0.56, -20, 18)}${leaf(s * 0.7, 34, -70, 20)}${leaf(s * 0.56, 36, 110, 18)}
|
||||
${triquetra(s * 0.36, s * 0.36, s * 0.24)}
|
||||
${rivet(10, s * 0.62, 4.5)}${rivet(s * 0.62, 10, 4.5)}
|
||||
</g>`;
|
||||
}
|
||||
const mirror = (inner, w, h, sx, sy) => `<g transform="translate(${sx < 0 ? w : 0} ${sy < 0 ? h : 0}) scale(${sx} ${sy})">${inner}</g>`;
|
||||
|
||||
// ---------- 1) рама окна 512×512, срез 140
|
||||
function frameWindow() {
|
||||
const W = 512, H = 512;
|
||||
const corner = filigreeCorner(140);
|
||||
return svg(W, H, `
|
||||
<rect x="6" y="6" width="500" height="500" rx="26" fill="#120a05" filter="url(#drop)"/>
|
||||
<rect x="8" y="8" width="496" height="496" rx="24" fill="url(#walnut)"/>
|
||||
<rect x="8" y="8" width="496" height="496" rx="24" fill="#000" filter="url(#grainH)" opacity=".85"/>
|
||||
<!-- резная рейка: светлое дерево с двумя желобками и золотой бусиной -->
|
||||
<path fill-rule="evenodd" fill="url(#walnutL)" filter="url(#bevelSoft)" d="M22 22 h468 v468 h-468 Z M62 62 v388 h388 v-388 Z"/>
|
||||
<path fill-rule="evenodd" fill="#000" opacity=".55" filter="url(#grainH)" d="M22 22 h468 v468 h-468 Z M62 62 v388 h388 v-388 Z"/>
|
||||
<rect x="30" y="30" width="452" height="452" rx="12" fill="none" stroke="#1e1108" stroke-width="2.5" opacity=".85"/>
|
||||
<rect x="31.5" y="31.5" width="449" height="449" rx="11" fill="none" stroke="#c99a5e" stroke-width="1" opacity=".5"/>
|
||||
<rect x="42" y="42" width="428" height="428" rx="8" fill="none" stroke="#2a1606" stroke-width="7"/>
|
||||
<rect x="42" y="42" width="428" height="428" rx="8" fill="none" stroke="url(#gold)" stroke-width="3.5" filter="url(#bevel)"/>
|
||||
<rect x="54" y="54" width="404" height="404" rx="6" fill="none" stroke="#1e1108" stroke-width="2.5" opacity=".85"/>
|
||||
<!-- внешний золотой обод -->
|
||||
<rect x="12" y="12" width="488" height="488" rx="22" fill="none" stroke="#2a1606" stroke-width="8"/>
|
||||
<rect x="12" y="12" width="488" height="488" rx="22" fill="none" stroke="url(#gold)" stroke-width="4.5" filter="url(#bevel)"/>
|
||||
<!-- середина: тёмная кожа с виньеткой и тенью от рамы -->
|
||||
<rect x="64" y="64" width="384" height="384" rx="4" fill="#24170d" filter="url(#inner)"/>
|
||||
<rect x="64" y="64" width="384" height="384" rx="4" fill="#000" opacity=".5" filter="url(#speck)"/>
|
||||
<rect x="64" y="64" width="384" height="384" rx="4" fill="url(#vign)"/>
|
||||
<rect x="64" y="64" width="384" height="384" rx="4" fill="none" stroke="url(#gold)" stroke-width="2"/>
|
||||
${corner}${mirror(corner, W, H, -1, 1)}${mirror(corner, W, H, 1, -1)}${mirror(corner, W, H, -1, -1)}
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 2) знамя-заголовок 640×200 (срез по бокам 210): древко с навершиями, ткань с вышивкой, кисти
|
||||
function banner() {
|
||||
const W = 640, H = 200;
|
||||
const tassel = x => `<g filter="url(#drop)">
|
||||
<path d="M${x} 150 v16" stroke="url(#gold)" stroke-width="3"/>
|
||||
<circle cx="${x}" cy="168" r="6" fill="url(#dome)" stroke="#3a2306"/>
|
||||
<path d="M${x - 8} 172 Q${x} 168 ${x + 8} 172 L${x + 10} 196 L${x - 10} 196 Z" fill="url(#gold)" stroke="#3a2306" stroke-width="1.2"/>
|
||||
${[-6, -3, 0, 3, 6].map(d => `<path d="M${x + d} 176 L${x + d * 1.4} 195" stroke="#7a4f14" stroke-width="1"/>`).join('')}</g>`;
|
||||
return svg(W, H, `
|
||||
<!-- ткань: прямоугольник, по бокам опущенные «хвосты» -->
|
||||
<g filter="url(#drop)">
|
||||
<path d="M70 34 H570 V136 Q570 140 566 141 L600 150 L592 120 L600 92 L570 92 Z" fill="#5a1312" opacity="0"/>
|
||||
<path d="M44 30 H596 V128 L572 150 L548 128 H92 L68 150 L44 128 Z" fill="url(#crimson)" stroke="#2a0606" stroke-width="3"/>
|
||||
</g>
|
||||
<path d="M44 30 H596 V128 L572 150 L548 128 H92 L68 150 L44 128 Z" fill="#000" opacity=".25" filter="url(#speck)"/>
|
||||
<!-- складки ткани -->
|
||||
<path d="M44 30 H596 V60 H44 Z" fill="#fff" opacity=".07"/>
|
||||
<!-- вышитая золотая кайма -->
|
||||
<path d="M56 42 H584 V122 L572 134 L560 122 H80 L68 134 L56 122 Z" fill="none" stroke="#2a0606" stroke-width="6"/>
|
||||
<path d="M56 42 H584 V122 L572 134 L560 122 H80 L68 134 L56 122 Z" fill="none" stroke="url(#gold)" stroke-width="3" filter="url(#bevel)"/>
|
||||
<path d="M64 50 H576 V116 H64 Z" fill="none" stroke="#e8b85a" stroke-width="1" stroke-dasharray="2 4" opacity=".7"/>
|
||||
${leaf(84, 80, 30, 16)}${leaf(84, 80, -30, 16)}${leaf(556, 80, 150, 16)}${leaf(556, 80, 210, 16)}
|
||||
<circle cx="84" cy="80" r="5" fill="url(#gemR)" stroke="#2a0606"/><circle cx="556" cy="80" r="5" fill="url(#gemR)" stroke="#2a0606"/>
|
||||
${tassel(68)}${tassel(572)}
|
||||
<!-- древко -->
|
||||
<g filter="url(#drop)">
|
||||
<rect x="16" y="18" width="608" height="16" rx="8" fill="url(#walnutL)" stroke="#1e1108" stroke-width="2"/>
|
||||
<rect x="16" y="18" width="608" height="16" rx="8" fill="#000" opacity=".5" filter="url(#grainH)"/>
|
||||
<rect x="22" y="21" width="596" height="3" rx="1.5" fill="#fff" opacity=".18"/>
|
||||
<path d="M18 26 L2 26 L-2 18 L-2 34 Z" fill="url(#gold)"/>
|
||||
<circle cx="16" cy="26" r="11" fill="url(#dome)" stroke="#3a2306" stroke-width="1.5"/>
|
||||
<circle cx="624" cy="26" r="11" fill="url(#dome)" stroke="#3a2306" stroke-width="1.5"/>
|
||||
<path d="M5 26 L-6 26" stroke="url(#gold)" stroke-width="6" stroke-linecap="round"/>
|
||||
</g>
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 3) кнопки 256×96 (срез 44): резная табличка со скошенными углами
|
||||
function plaque(kind, pressed) {
|
||||
const W = 256, H = 96;
|
||||
const fills = { wood: 'url(#walnutL)', green: 'url(#emerald)', red: 'url(#crimson)', gold: 'url(#gold)' };
|
||||
const shape = 'M24 6 H232 L250 24 V72 L232 90 H24 L6 72 V24 Z';
|
||||
const inner = 'M28 16 H228 L240 28 V68 L228 80 H28 L16 68 V28 Z';
|
||||
const dy = pressed ? 2 : 0;
|
||||
const grain = kind === 'wood' ? `<path d="${shape}" fill="#000" opacity=".55" filter="url(#grainH)"/>` : `<path d="${shape}" fill="#000" opacity=".22" filter="url(#speck)"/>`;
|
||||
const stitch = kind === 'red' ? `<path d="${inner}" fill="none" stroke="#f0c070" stroke-width="1.6" stroke-dasharray="5 4" opacity=".85"/>` : '';
|
||||
const caps = [[24, 6, 0], [232, 6, 90], [232, 90, 180], [24, 90, 270]].map(([x, y, a]) =>
|
||||
`<g transform="translate(${x} ${y}) rotate(${a})"><path d="M-2 0 L14 0 L0 14 Z" fill="url(#gold)" stroke="#2a1606" stroke-width="1"/></g>`).join('');
|
||||
return svg(W, H, `<g transform="translate(0 ${dy})">
|
||||
<path d="${shape}" fill="#140a04" transform="translate(0 ${pressed ? 0 : 3})" opacity=".8"/>
|
||||
<path d="${shape}" fill="${fills[kind]}" stroke="#1a0d05" stroke-width="2.5" ${pressed ? '' : 'filter="url(#bevelSoft)"'}/>
|
||||
${grain}
|
||||
${pressed ? `<path d="${shape}" fill="#000" opacity=".28"/>` : `<path d="M24 6 H232 L246 20 H10 Z" fill="#fff" opacity=".16"/>`}
|
||||
<path d="${inner}" fill="none" stroke="#1a0d05" stroke-width="2" opacity=".7"/>
|
||||
<path d="${inner}" fill="none" stroke="${kind === 'gold' ? '#fff3c0' : 'url(#gold)'}" stroke-width="1.2" transform="translate(0 1)" opacity=".9"/>
|
||||
${stitch}
|
||||
<path d="${shape}" fill="none" stroke="#2a1606" stroke-width="6"/>
|
||||
<path d="${shape}" fill="none" stroke="url(#gold)" stroke-width="3" filter="url(#bevel)"/>
|
||||
${caps}
|
||||
${rivet(14, 48, 4)}${rivet(242, 48, 4)}
|
||||
</g>`);
|
||||
}
|
||||
|
||||
// ---------- 4) вкладки 256×96 (срез 44): кожа со строчкой / пергамент с золотом
|
||||
function tab(active) {
|
||||
const W = 256, H = 96;
|
||||
const shape = 'M8 96 V30 Q8 8 30 8 H226 Q248 8 248 30 V96 Z';
|
||||
return svg(W, H, `
|
||||
<path d="${shape}" fill="${active ? '#e9d3a0' : '#5b3a22'}" stroke="#1a0d05" stroke-width="2.5" filter="url(#bevelSoft)"/>
|
||||
${active ? `<path d="${shape}" fill="#8a5a24" opacity=".6" filter="url(#stains)"/>` : `<path d="${shape}" fill="#000" opacity=".5" filter="url(#grainH)"/>`}
|
||||
<path d="M20 96 V34 Q20 20 34 20 H222 Q236 20 236 34 V96" fill="none" stroke="${active ? '#7a4f14' : '#d9a85c'}" stroke-width="1.6" stroke-dasharray="5 4" opacity=".85"/>
|
||||
<path d="${shape}" fill="none" stroke="#2a1606" stroke-width="6"/>
|
||||
<path d="${shape}" fill="none" stroke="${active ? 'url(#gold)' : '#8a5a2c'}" stroke-width="3"/>
|
||||
${active ? `${leaf(128, 14, 160, 14)}${leaf(128, 14, 20, 14)}<circle cx="128" cy="14" r="4.5" fill="url(#gemR)" stroke="#2a0606"/>` : ''}
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 5) ячейка 192×192 (срез 52): утопленное гнездо в резном дереве, кованые уголки
|
||||
function slot() {
|
||||
const W = 192;
|
||||
const br = `<g filter="url(#dropS)"><path d="M8 40 V14 Q8 8 14 8 H40 L40 16 H16 V40 Z" fill="url(#iron)" stroke="#111" stroke-width="1.5"/>${rivet(20, 20, 3.5, true)}</g>`;
|
||||
return svg(W, W, `
|
||||
<rect x="4" y="4" width="184" height="184" rx="18" fill="url(#walnut)" stroke="#120a05" stroke-width="3" filter="url(#bevelSoft)"/>
|
||||
<rect x="4" y="4" width="184" height="184" rx="18" fill="#000" opacity=".5" filter="url(#grainV)"/>
|
||||
<rect x="18" y="18" width="156" height="156" rx="10" fill="#160d07" filter="url(#inner)"/>
|
||||
<rect x="18" y="18" width="156" height="156" rx="10" fill="#000" opacity=".4" filter="url(#speck)"/>
|
||||
<rect x="18" y="18" width="156" height="156" rx="10" fill="none" stroke="#c8902e" stroke-width="1.5" opacity=".7"/>
|
||||
${br}${mirror(br, W, W, -1, 1)}${mirror(br, W, W, 1, -1)}${mirror(br, W, W, -1, -1)}
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 6) разделитель 512×48: золотая лоза с листьями и узлом в центре
|
||||
function divider() {
|
||||
const W = 512, H = 48;
|
||||
let leaves = '';
|
||||
for (let i = 0; i < 6; i++) {
|
||||
const x = 60 + i * 30, a = i % 2 ? 210 : 150;
|
||||
leaves += leaf(256 - 50 - i * 30, 24 + (i % 2 ? 4 : -4), i % 2 ? 160 : 200, 14 - i);
|
||||
leaves += leaf(256 + 50 + i * 30, 24 + (i % 2 ? 4 : -4), i % 2 ? 20 : -20, 14 - i);
|
||||
}
|
||||
return svg(W, H, `
|
||||
<defs><linearGradient id="fade" x1="0" x2="1"><stop offset="0" stop-color="#fff" stop-opacity="0"/><stop offset=".3" stop-color="#fff"/><stop offset=".7" stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient>
|
||||
<mask id="fm"><rect width="${W}" height="${H}" fill="url(#fade)"/></mask></defs>
|
||||
<g mask="url(#fm)" filter="url(#dropS)">
|
||||
<path d="M10 24 C 90 14, 160 34, 230 24 M282 24 C 352 14, 422 34, 502 24" fill="none" stroke="#2a1606" stroke-width="5"/>
|
||||
<path d="M10 24 C 90 14, 160 34, 230 24 M282 24 C 352 14, 422 34, 502 24" fill="none" stroke="url(#gold)" stroke-width="2.5"/>
|
||||
${leaves}
|
||||
</g>
|
||||
${triquetra(256, 24, 20, 'gemR')}
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 7) сургучная печать-крестик 160×160
|
||||
function seal() {
|
||||
return svg(160, 160, `
|
||||
<g filter="url(#drop)"><circle cx="80" cy="82" r="62" fill="url(#wax)" filter="url(#waxEdge)"/></g>
|
||||
<circle cx="80" cy="80" r="46" fill="none" stroke="#4e0a0a" stroke-width="5" opacity=".8"/>
|
||||
<circle cx="80" cy="80" r="46" fill="none" stroke="#e86a5c" stroke-width="1.5" transform="translate(-1 -1)" opacity=".7"/>
|
||||
<g filter="url(#bevel)"><path d="M58 58 L102 102 M102 58 L58 102" stroke="#7a1414" stroke-width="12" stroke-linecap="round"/></g>
|
||||
<path d="M58 58 L102 102 M102 58 L58 102" stroke="#ff9a8a" stroke-width="2" stroke-linecap="round" transform="translate(-2 -2)" opacity=".55"/>
|
||||
${[0, 45, 90, 135, 180, 225, 270, 315].map(a => { const r = a * Math.PI / 180; return `<circle cx="${80 + Math.cos(r) * 37}" cy="${80 + Math.sin(r) * 37}" r="2.4" fill="#e86a5c" opacity=".75"/>`; }).join('')}
|
||||
<ellipse cx="60" cy="50" rx="16" ry="8" fill="#fff" opacity=".22" transform="rotate(-30 60 50)"/>
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 8) кованая оправа полосы 384×64 (срез 52) и заливка 384×40 (срез 20)
|
||||
function barFrame() {
|
||||
return svg(384, 64, `
|
||||
<rect x="4" y="6" width="376" height="52" rx="12" fill="url(#iron)" stroke="#0e0f11" stroke-width="2.5" filter="url(#bevel)"/>
|
||||
<rect x="4" y="6" width="376" height="52" rx="12" fill="#000" opacity=".25" filter="url(#speck)"/>
|
||||
<rect x="22" y="18" width="340" height="28" rx="8" fill="#0b0604" filter="url(#inner)"/>
|
||||
<rect x="22" y="18" width="340" height="28" rx="8" fill="none" stroke="url(#gold)" stroke-width="2"/>
|
||||
${rivet(13, 32, 5, true)}${rivet(371, 32, 5, true)}
|
||||
<path d="M6 32 h8 M370 32 h8" stroke="#000" opacity=".3"/>
|
||||
`);
|
||||
}
|
||||
function barFill() {
|
||||
return svg(384, 40, `
|
||||
<defs><linearGradient id="liq" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffffff"/><stop offset=".35" stop-color="#f2f2f2"/><stop offset=".6" stop-color="#bdbdbd"/><stop offset="1" stop-color="#8a8a8a"/></linearGradient></defs>
|
||||
<rect x="2" y="2" width="380" height="36" rx="10" fill="url(#liq)"/>
|
||||
<rect x="10" y="6" width="364" height="7" rx="3.5" fill="#fff" opacity=".7"/>
|
||||
<rect x="2" y="2" width="380" height="36" rx="10" fill="#000" opacity=".12" filter="url(#speck)"/>
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 9) медальон под иконку 160×160: резное кольцо с золотым ободом и листьями
|
||||
function medallion() {
|
||||
let leaves = '';
|
||||
for (let i = 0; i < 12; i++) {
|
||||
const a = i * 30, r = a * Math.PI / 180;
|
||||
leaves += leaf(80 + Math.cos(r) * 62, 80 + Math.sin(r) * 62, a + 100, 14);
|
||||
}
|
||||
return svg(160, 160, `
|
||||
<g filter="url(#drop)"><circle cx="80" cy="80" r="74" fill="url(#walnut)" stroke="#120a05" stroke-width="3"/></g>
|
||||
<circle cx="80" cy="80" r="74" fill="#000" opacity=".5" filter="url(#grainV)"/>
|
||||
${leaves}
|
||||
<circle cx="80" cy="80" r="54" fill="none" stroke="#2a1606" stroke-width="9"/>
|
||||
<circle cx="80" cy="80" r="54" fill="none" stroke="url(#gold)" stroke-width="5" filter="url(#bevel)"/>
|
||||
<circle cx="80" cy="80" r="49" fill="#1a0f08" filter="url(#inner)"/>
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- 10) обожжённый пергамент 512×512 (срез 110)
|
||||
function parchment() {
|
||||
return svg(512, 512, `
|
||||
<defs><radialGradient id="burn" cx=".5" cy=".5" r=".72"><stop offset=".62" stop-color="#5a3010" stop-opacity="0"/><stop offset=".86" stop-color="#5a3010" stop-opacity=".55"/><stop offset="1" stop-color="#2a1406" stop-opacity=".95"/></radialGradient></defs>
|
||||
<g filter="url(#ragged)">
|
||||
<rect x="16" y="16" width="480" height="480" rx="10" fill="#ead7a6"/>
|
||||
<rect x="16" y="16" width="480" height="480" rx="10" fill="#000" filter="url(#stains)" opacity=".7"/>
|
||||
<rect x="16" y="16" width="480" height="480" rx="10" fill="url(#burn)"/>
|
||||
<rect x="16" y="16" width="480" height="480" rx="10" fill="none" stroke="#2a1406" stroke-width="5"/>
|
||||
</g>
|
||||
<rect x="16" y="16" width="480" height="480" fill="#000" opacity=".12" filter="url(#speck)"/>
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- главный экран
|
||||
// 11) малая резная рамка 256×256 (срез 64): панели HUD, таблица игроков, нижняя панель, тосты
|
||||
function frameSmall() {
|
||||
const W = 256;
|
||||
const c = `<g>${triquetra(26, 26, 17)}${leaf(46, 18, 0, 14)}${leaf(18, 46, 90, 14)}</g>`;
|
||||
return svg(W, W, `
|
||||
<rect x="4" y="4" width="248" height="248" rx="16" fill="#120a05" filter="url(#drop)"/>
|
||||
<rect x="5" y="5" width="246" height="246" rx="15" fill="url(#walnut)"/>
|
||||
<rect x="5" y="5" width="246" height="246" rx="15" fill="#000" filter="url(#grainH)" opacity=".85"/>
|
||||
<path fill-rule="evenodd" fill="url(#walnutL)" filter="url(#bevelSoft)" d="M14 14 h228 v228 h-228 Z M34 34 v188 h188 v-188 Z"/>
|
||||
<path fill-rule="evenodd" fill="#000" opacity=".5" filter="url(#grainH)" d="M14 14 h228 v228 h-228 Z M34 34 v188 h188 v-188 Z"/>
|
||||
<rect x="24" y="24" width="208" height="208" rx="5" fill="none" stroke="#2a1606" stroke-width="5"/>
|
||||
<rect x="24" y="24" width="208" height="208" rx="5" fill="none" stroke="url(#gold)" stroke-width="2.4" filter="url(#bevel)"/>
|
||||
<rect x="8" y="8" width="240" height="240" rx="13" fill="none" stroke="#2a1606" stroke-width="5"/>
|
||||
<rect x="8" y="8" width="240" height="240" rx="13" fill="none" stroke="url(#gold)" stroke-width="2.8" filter="url(#bevel)"/>
|
||||
<rect x="36" y="36" width="184" height="184" rx="3" fill="#24170d" filter="url(#inner)"/>
|
||||
<rect x="36" y="36" width="184" height="184" rx="3" fill="#000" opacity=".45" filter="url(#speck)"/>
|
||||
${c}${mirror(c, W, W, -1, 1)}${mirror(c, W, W, 1, -1)}${mirror(c, W, W, -1, -1)}
|
||||
`);
|
||||
}
|
||||
// 12) золотой ромб-медальон уровня 128×128
|
||||
function diamond() {
|
||||
return svg(128, 128, `
|
||||
<g filter="url(#drop)"><path d="M64 4 L124 64 L64 124 L4 64 Z" fill="url(#gold)" stroke="#2a1606" stroke-width="3" filter="url(#bevel)"/></g>
|
||||
<path d="M64 18 L110 64 L64 110 L18 64 Z" fill="none" stroke="#2a1606" stroke-width="3"/>
|
||||
<path d="M64 24 L104 64 L64 104 L24 64 Z" fill="url(#walnut)" stroke="#f6d47c" stroke-width="1.5" filter="url(#inner)"/>
|
||||
${leaf(64, 10, 90, 10)}${leaf(64, 118, 270, 10)}${leaf(10, 64, 0, 10)}${leaf(118, 64, 180, 10)}
|
||||
${rivet(64, 8, 4)}${rivet(64, 120, 4)}${rivet(8, 64, 4)}${rivet(120, 64, 4)}
|
||||
`);
|
||||
}
|
||||
// 13) табличка-«фишка» 160×56 (срез 26): деревянная, с золотым ободком
|
||||
function chip() {
|
||||
const shape = 'M14 4 H146 Q156 4 156 14 V42 Q156 52 146 52 H14 Q4 52 4 42 V14 Q4 4 14 4 Z';
|
||||
return svg(160, 56, `
|
||||
<path d="${shape}" fill="#120a05" transform="translate(0 2)" opacity=".8"/>
|
||||
<path d="${shape}" fill="url(#walnut)" stroke="#1a0d05" stroke-width="2"/>
|
||||
<path d="${shape}" fill="#000" opacity=".5" filter="url(#grainH)"/>
|
||||
<path d="M10 10 H150 V46 H10 Z" fill="#1a0f08" opacity=".55" filter="url(#inner)"/>
|
||||
<path d="${shape}" fill="none" stroke="url(#gold)" stroke-width="2.2" filter="url(#bevel)"/>
|
||||
`);
|
||||
}
|
||||
// 14) плашка меню 192×192: резной квадрат с медальоном-гнездом под иконку вверху и полем подписи внизу
|
||||
function menuBtn(pressed) {
|
||||
const W = 192;
|
||||
const c = `<g>${rivet(20, 20, 6)}</g>`;
|
||||
return svg(W, W, `<g transform="translate(0 ${pressed ? 3 : 0})">
|
||||
<rect x="6" y="${pressed ? 6 : 9}" width="180" height="180" rx="22" fill="#0e0703" opacity=".85"/>
|
||||
<rect x="6" y="6" width="180" height="176" rx="22" fill="url(#walnutL)" stroke="#1a0d05" stroke-width="3" ${pressed ? '' : 'filter="url(#bevelSoft)"'}/>
|
||||
<rect x="6" y="6" width="180" height="176" rx="22" fill="#000" opacity=".5" filter="url(#grainV)"/>
|
||||
${pressed ? '<rect x="6" y="6" width="180" height="176" rx="22" fill="#000" opacity=".3"/>' : ''}
|
||||
<rect x="14" y="14" width="164" height="160" rx="16" fill="none" stroke="#2a1606" stroke-width="5"/>
|
||||
<rect x="14" y="14" width="164" height="160" rx="16" fill="none" stroke="url(#gold)" stroke-width="2.5" filter="url(#bevel)"/>
|
||||
<circle cx="96" cy="78" r="54" fill="#2a1606"/>
|
||||
<circle cx="96" cy="78" r="51" fill="none" stroke="url(#gold)" stroke-width="5" filter="url(#bevel)"/>
|
||||
<circle cx="96" cy="78" r="46" fill="#1d120a" filter="url(#inner)"/>
|
||||
<rect x="28" y="138" width="136" height="30" rx="8" fill="#1a0f08" opacity=".6" filter="url(#inner)"/>
|
||||
${leaf(42, 78, 180, 16)}${leaf(150, 78, 0, 16)}
|
||||
${c}${mirror(c, W, W, -1, 1)}
|
||||
</g>`);
|
||||
}
|
||||
// 15) маленький сургучный кружок 64×64 (клавиша) и печать-бейдж без знака 64×64
|
||||
function waxDot(color) {
|
||||
const g = color === 'gold' ? 'url(#dome)' : 'url(#wax)';
|
||||
return svg(64, 64, `
|
||||
<g filter="url(#dropS)"><circle cx="32" cy="33" r="25" fill="${g}" filter="url(#waxEdge)"/></g>
|
||||
<circle cx="32" cy="32" r="17" fill="none" stroke="${color === 'gold' ? '#5c3a0e' : '#4e0a0a'}" stroke-width="2.5" opacity=".8"/>
|
||||
<ellipse cx="24" cy="22" rx="7" ry="4" fill="#fff" opacity=".25" transform="rotate(-30 24 22)"/>
|
||||
`);
|
||||
}
|
||||
// 16) валик свитка 512×56 (срез 60): деревянный цилиндр с золотыми навершиями
|
||||
function roller() {
|
||||
return svg(512, 56, `
|
||||
<defs><linearGradient id="cyl" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#5a3a20"/><stop offset=".3" stop-color="#b98450"/><stop offset=".55" stop-color="#7a5030"/><stop offset="1" stop-color="#2e1d10"/></linearGradient></defs>
|
||||
<g filter="url(#drop)">
|
||||
<rect x="30" y="14" width="452" height="28" rx="14" fill="url(#cyl)" stroke="#1a0d05" stroke-width="2"/>
|
||||
<rect x="30" y="14" width="452" height="28" rx="14" fill="#000" opacity=".35" filter="url(#grainH)"/>
|
||||
<rect x="8" y="8" width="30" height="40" rx="8" fill="url(#gold)" stroke="#2a1606" stroke-width="2" filter="url(#bevel)"/>
|
||||
<rect x="474" y="8" width="30" height="40" rx="8" fill="url(#gold)" stroke="#2a1606" stroke-width="2" filter="url(#bevel)"/>
|
||||
<circle cx="10" cy="28" r="8" fill="url(#dome)" stroke="#2a1606"/><circle cx="502" cy="28" r="8" fill="url(#dome)" stroke="#2a1606"/>
|
||||
</g>
|
||||
`);
|
||||
}
|
||||
|
||||
// ---------- сборка
|
||||
const ASSETS = {
|
||||
frame_window: [512, 512, frameWindow(), 140],
|
||||
banner: [640, 200, banner(), 210],
|
||||
btn_wood: [256, 96, plaque('wood', false), 44], btn_wood_down: [256, 96, plaque('wood', true), 44],
|
||||
btn_green: [256, 96, plaque('green', false), 44], btn_green_down: [256, 96, plaque('green', true), 44],
|
||||
btn_red: [256, 96, plaque('red', false), 44], btn_red_down: [256, 96, plaque('red', true), 44],
|
||||
btn_gold: [256, 96, plaque('gold', false), 44], btn_gold_down: [256, 96, plaque('gold', true), 44],
|
||||
tab_on: [256, 96, tab(true), 44], tab_off: [256, 96, tab(false), 44],
|
||||
slot: [192, 192, slot(), 52], divider: [512, 48, divider(), 0], seal: [160, 160, seal(), 0],
|
||||
bar_frame: [384, 64, barFrame(), 52], bar_fill: [384, 40, barFill(), 20], medallion: [160, 160, medallion(), 0],
|
||||
parchment: [512, 512, parchment(), 110],
|
||||
frame_small: [256, 256, frameSmall(), 64], diamond: [128, 128, diamond(), 0], chip: [160, 56, chip(), 26],
|
||||
menu_btn: [192, 192, menuBtn(false), 0], menu_btn_down: [192, 192, menuBtn(true), 0],
|
||||
wax_dot: [64, 64, waxDot('red'), 0], gold_dot: [64, 64, waxDot('gold'), 0], roller: [512, 56, roller(), 60],
|
||||
};
|
||||
const only = process.argv[2];
|
||||
for (const [name, [w, h, s]] of Object.entries(ASSETS)) {
|
||||
if (only && only !== name && only !== 'sheet') continue;
|
||||
if (only === 'sheet') break;
|
||||
shot(s, w, h, path.join(OUT, name + '.png'));
|
||||
}
|
||||
fs.writeFileSync(path.join(__dirname, 'slices.json'), JSON.stringify(Object.fromEntries(Object.entries(ASSETS).map(([n, [w, h, , sl]]) => [n, { w, h, slice: sl }])), null, 1));
|
||||
|
||||
// ---------- лист стиля и макет «Сумки» (HTML с border-image = то же, что 9-slice в Roblox)
|
||||
const u = n => 'file:///' + path.join(OUT, n + '.png').replace(/\\/g, '/');
|
||||
const ic = n => 'file:///' + path.join(ROOT, 'assets', 'icons', n + '.png').replace(/\\/g, '/');
|
||||
const nine = (n, slice, scale = 1) => `border-style:solid;border-width:${slice * scale}px;border-image:url(${u(n)}) ${slice} fill stretch;`;
|
||||
const FONT = `font-family:'Merriweather','Georgia','Times New Roman',serif;font-weight:900`;
|
||||
const cell = (label, inner) => `<div style="display:flex;flex-direction:column;align-items:center;gap:6px;margin:10px"><div>${inner}</div><div style="color:#c9b288;font:13px Georgia">${label}</div></div>`;
|
||||
const btnH = (n, t, w = 200, color = '#fff2cc') => `<div style="box-sizing:border-box;width:${w}px;height:64px;${nine(n, 44, 0.66)}display:flex;align-items:center;justify-content:center;color:${color};${FONT};font-size:19px;text-shadow:0 2px 2px #000">${t}</div>`;
|
||||
const sheet = `<div style="width:1400px;padding:20px;box-sizing:border-box;background:#1b1410 radial-gradient(circle at 50% 30%,#3a2a1e,#120c08);display:flex;flex-wrap:wrap;align-items:flex-end">
|
||||
${cell('рама окна (9-slice)', `<div style="box-sizing:border-box;width:420px;height:300px;${nine('frame_window', 140, 0.7)}"></div>`)}
|
||||
${cell('знамя-заголовок', `<div style="box-sizing:border-box;width:440px;height:138px;${nine('banner', 210, 0.69)}border-top-width:138px;border-bottom-width:0;border-image-slice:200 210 0 210 fill;position:relative"><div style="position:absolute;left:0;right:0;top:-110px;text-align:center;color:#ffe08a;${FONT};font-size:30px;text-shadow:0 2px 3px #000">Сумка</div></div>`)}
|
||||
${cell('кнопки: дерево, зелёная, багровая, золотая', `<div style="display:grid;grid-template-columns:repeat(2,200px);gap:10px">${btnH('btn_wood', 'Надеть')}${btnH('btn_green', 'Продать всё')}${btnH('btn_red', 'Отмена')}${btnH('btn_gold', 'Купить', 200, '#3a2306')}</div>`)}
|
||||
${cell('нажатая', btnH('btn_green_down', 'Продать всё'))}
|
||||
${cell('вкладки', `<div style="display:flex;gap:8px">${['tab_on', 'tab_off'].map((t, i) => `<div style="box-sizing:border-box;width:180px;height:60px;${nine(t, 44, 0.6)}border-bottom-width:0;display:flex;align-items:center;justify-content:center;color:${i ? '#f0dcb0' : '#3a2306'};${FONT};font-size:18px">${i ? 'Коллекция' : 'Улов'}</div>`).join('')}</div>`)}
|
||||
${cell('ячейка', `<div style="box-sizing:border-box;width:120px;height:140px;${nine('slot', 52, 0.6)}display:flex;align-items:center;justify-content:center"><img src="${ic('fish')}" width="70"></div>`)}
|
||||
${cell('медальон', `<div style="width:110px;height:110px;background:url(${u('medallion')}) center/contain no-repeat;display:flex;align-items:center;justify-content:center"><img src="${ic('bag')}" width="56"></div>`)}
|
||||
${cell('печать-крестик', `<img src="${u('seal')}" width="90">`)}
|
||||
${cell('полоса прогресса', `<div style="position:relative;width:340px;height:52px"><div style="position:absolute;inset:0;box-sizing:border-box;${nine('bar_frame', 52, 0.6)}"></div><div style="position:absolute;left:14px;top:12px;width:200px;height:28px;${nine('bar_fill', 20, 0.6)}box-sizing:border-box;filter:sepia(1) saturate(4) hue-rotate(60deg) brightness(.85)"></div></div>`)}
|
||||
${cell('разделитель', `<img src="${u('divider')}" width="420">`)}
|
||||
${cell('пергамент', `<div style="box-sizing:border-box;width:300px;height:160px;${nine('parchment', 110, 0.5)}display:flex;align-items:center;justify-content:center;color:#3a2306;${FONT};font-size:18px">Можно выручить ≈ 182</div>`)}
|
||||
</div>`;
|
||||
|
||||
// макет окна «Сумка» 900×620, на фоне игры
|
||||
const fishes = [['fish', 'Щука', '2.99 кг', '37', '#5aa0ff'], ['fish', 'Линь', '2.62 кг', '33', '#6fdc6f'], ['fish', 'Лещ', '2.25 кг', '30', '#6fdc6f'],
|
||||
['fish', 'Окунь', '1.88 кг', '26', '#6fdc6f'], ['fish', 'Ёрш', '1.51 кг', '22', '#e8e8e8'], ['fish', 'Плотва', '1.14 кг', '19', '#ff8fd8'], ['fish', 'Карась', '0.77 кг', '15', '#e8e8e8']];
|
||||
const slotHtml = (f) => `<div style="box-sizing:border-box;width:118px;height:138px;${nine('slot', 52, 0.5)}position:relative;display:flex;flex-direction:column;align-items:center">
|
||||
${f ? `<div style="position:absolute;inset:-26px;border:3px solid ${f[4]};border-radius:12px;box-shadow:0 0 10px ${f[4]}88 inset;pointer-events:none"></div>
|
||||
<img src="${ic(f[0])}" width="56" style="margin-top:-14px;filter:drop-shadow(0 2px 2px #000)">
|
||||
<div style="color:${f[4]};${FONT};font-size:15px;text-shadow:0 1px 2px #000">${f[1]}</div><div style="color:#cdb48a;font:12px Georgia">${f[2]}</div>
|
||||
<div style="margin-top:4px;box-sizing:border-box;width:96px;height:32px;${nine('btn_green', 44, 0.3)}display:flex;align-items:center;justify-content:center;color:#fff2cc;${FONT};font-size:15px;text-shadow:0 1px 2px #000"><img src="${ic('coin')}" width="16" style="margin-right:5px">${f[3]}</div>`
|
||||
: `<img src="${ic('fish')}" width="50" style="opacity:.1;margin-top:10px">`}</div>`;
|
||||
const mock = `<div style="width:1100px;height:760px;position:relative;background:#2a3a2a url(${'file:///' + path.join(ROOT, 'assets', 'reference', 'ui2_bag_fish_7_pc.jpg').replace(/\\/g, '/')}) center/cover">
|
||||
<div style="position:absolute;inset:0;background:rgba(0,0,0,.35)"></div>
|
||||
<div style="position:absolute;left:100px;top:90px;width:900px;height:620px;box-sizing:border-box;${nine('frame_window', 140, 0.75)}">
|
||||
<div style="position:absolute;left:-80px;right:-80px;top:-160px;height:140px;box-sizing:border-box;${nine('banner', 210, 0.62)}border-top-width:124px;border-bottom-width:0;border-image-slice:200 210 0 210 fill;margin:0 auto;width:420px"></div>
|
||||
<div style="position:absolute;left:0;right:0;top:-128px;text-align:center;color:#ffe08a;${FONT};font-size:30px;text-shadow:0 2px 3px #000"><img src="${ic('bag')}" width="34" style="vertical-align:-6px;margin-right:8px">Сумка</div>
|
||||
<img src="${u('seal')}" width="76" style="position:absolute;right:-118px;top:-130px">
|
||||
<div style="position:absolute;left:-40px;right:-40px;top:-48px;display:flex;gap:8px">
|
||||
<div style="box-sizing:border-box;flex:1;height:52px;${nine('tab_on', 44, 0.55)}border-bottom-width:0;display:flex;align-items:center;justify-content:center;gap:8px;color:#3a2306;${FONT};font-size:19px"><img src="${ic('fish')}" width="28">Улов</div>
|
||||
<div style="box-sizing:border-box;flex:1;height:52px;${nine('tab_off', 44, 0.55)}border-bottom-width:0;display:flex;align-items:center;justify-content:center;gap:8px;color:#f0dcb0;${FONT};font-size:19px"><img src="${ic('book')}" width="26">Коллекция</div>
|
||||
</div>
|
||||
<div style="position:absolute;left:-40px;right:-40px;top:14px;bottom:-40px">
|
||||
<div style="display:flex;align-items:center;gap:12px;height:44px">
|
||||
<div style="width:52px;height:52px;background:url(${u('medallion')}) center/contain no-repeat;display:flex;align-items:center;justify-content:center"><img src="${ic('bag')}" width="28"></div>
|
||||
<div style="color:#ffe08a;${FONT};font-size:20px;text-shadow:0 2px 2px #000">Улов 7 / 12</div>
|
||||
<div style="flex:1;position:relative;height:30px"><div style="position:absolute;inset:0;box-sizing:border-box;${nine('bar_frame', 52, 0.3)}"></div><div style="position:absolute;left:10px;top:8px;width:56%;height:14px;${nine('bar_fill', 20, 0.35)}box-sizing:border-box;filter:sepia(1) saturate(5) hue-rotate(55deg) brightness(.8)"></div></div>
|
||||
</div>
|
||||
<img src="${u('divider')}" style="width:100%;height:30px;object-fit:contain;margin:4px 0">
|
||||
<div style="display:grid;grid-template-columns:repeat(6,118px);gap:10px 12px;justify-content:center">${fishes.map(slotHtml).join('')}${[0, 0, 0, 0, 0].map(() => slotHtml(null)).join('')}</div>
|
||||
</div>
|
||||
<div style="position:absolute;left:-40px;right:-40px;bottom:-34px;height:66px;box-sizing:border-box;${nine('parchment', 110, 0.3)}display:flex;align-items:center;gap:10px;padding:0 6px">
|
||||
<img src="${ic('coin')}" width="36"><div style="color:#4a2e10;font:13px Georgia">Можно выручить<br><span style="${FONT};font-size:22px;color:#3a2306">≈ 182</span></div>
|
||||
<div style="margin-left:auto">${btnH('btn_green', `<img src="${ic('coin')}" width="22" style="margin-right:8px">Продать всё`, 230)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
shot(sheet, 1400, 770, path.join(ROOT, 'assets', 'reference', 'ui3_style_sheet.png'));
|
||||
shot(mock, 1100, 760, path.join(ROOT, 'assets', 'reference', 'ui3_mock_bag.png'));
|
||||
console.log('готово', Object.keys(ASSETS).length, 'текстур');
|
||||
|
||||
// ---------- лист 2: главный экран из новых картинок (1280×720 поверх снимка игры)
|
||||
{
|
||||
const chipH = (icon, t, color = '#f0dcb0') => `<div style="box-sizing:border-box;height:30px;${nine('chip', 26, 0.55)}display:inline-flex;align-items:center;gap:5px;color:${color};font:bold 13px Georgia;text-shadow:0 1px 2px #000;margin:0 4px 0 0"><img src="${ic(icon)}" width="18" style="margin:-8px 0">${t}</div>`;
|
||||
const menu = (icon, label, key, badge) => `<div style="position:relative;width:70px;height:70px;background:url(${u('menu_btn')}) center/contain no-repeat">
|
||||
<img src="${ic(icon)}" width="30" style="position:absolute;left:20px;top:13px">
|
||||
<div style="position:absolute;left:0;right:0;top:48px;text-align:center;color:#ffe9b8;font:bold 11px Georgia;text-shadow:0 1px 2px #000">${label}</div>
|
||||
${key ? `<div style="position:absolute;right:-3px;top:-3px;width:20px;height:20px;background:url(${u('gold_dot')}) center/contain;color:#3a2306;font:bold 10px Georgia;display:flex;align-items:center;justify-content:center">${key}</div>` : ''}
|
||||
${badge ? `<div style="position:absolute;left:-5px;top:-5px;width:22px;height:22px;background:url(${u('wax_dot')}) center/contain;color:#fff;font:bold 12px Georgia;display:flex;align-items:center;justify-content:center">!</div>` : ''}</div>`;
|
||||
const hud = `<div style="width:1280px;height:720px;position:relative;background:url(${'file:///' + path.join(ROOT, 'assets', 'reference', 'hud3_tablet_hud.jpg').replace(/\\/g, '/')}) center/cover;overflow:hidden">
|
||||
<!-- панель игрока -->
|
||||
<div style="position:absolute;left:12px;top:10px;width:300px;height:150px;box-sizing:border-box;${nine('frame_small', 64, 0.42)}">
|
||||
<div style="position:absolute;left:-14px;top:-14px;width:58px;height:58px;background:url(${u('diamond')}) center/contain;display:flex;align-items:center;justify-content:center;color:#ffe08a;font:900 20px Georgia;text-shadow:0 1px 2px #000">1</div>
|
||||
<div style="position:absolute;left:56px;top:-14px;display:flex;align-items:center;gap:6px"><img src="${ic('coin')}" width="26"><span style="color:#eef2f6;font:900 24px Georgia;text-shadow:0 2px 2px #000">1 250</span></div>
|
||||
<div style="position:absolute;left:56px;right:-14px;top:18px;height:22px"><div style="position:absolute;inset:0;box-sizing:border-box;${nine('bar_frame', 52, 0.22)}"></div><div style="position:absolute;left:8px;top:6px;width:45%;height:10px;${nine('bar_fill', 20, 0.25)}box-sizing:border-box;filter:sepia(1) saturate(3) brightness(1)"></div><div style="position:absolute;inset:0;text-align:center;color:#fff;font:bold 10px Georgia;line-height:22px;text-shadow:0 1px 2px #000">23 / 50 XP</div></div>
|
||||
<div style="position:absolute;left:-14px;top:50px;white-space:nowrap">${chipH('clover', 'Удача 100%', '#a8f0a0')}${chipH('bag', '3 / 12')}</div>
|
||||
<div style="position:absolute;left:-14px;top:84px;white-space:nowrap">${chipH('guild', 'F')}${chipH('seal', '0/30')}${chipH('pearl', '5')}</div>
|
||||
</div>
|
||||
<!-- меню -->
|
||||
<div style="position:absolute;left:12px;top:168px;width:300px;height:168px;box-sizing:border-box;${nine('frame_small', 64, 0.42)}">
|
||||
<div style="position:absolute;left:-16px;top:-16px;display:grid;grid-template-columns:repeat(4,70px);gap:4px">${menu('bag', 'Сумка', 'B', true)}${menu('book', 'Рыбы', 'C')}${menu('map', 'Миры', 'M')}${menu('scroll', 'Задания', 'Q', true)}${menu('crystal', 'Донат')}${menu('horn', 'Звук')}${menu('guild', 'Гильдия', 'G')}</div>
|
||||
</div>
|
||||
<!-- подсказка обучения -->
|
||||
<div style="position:absolute;left:440px;top:4px;width:400px;height:96px;box-sizing:border-box;${nine('banner', 210, 0.45)}border-top-width:90px;border-bottom-width:0;border-image-slice:200 210 0 210 fill"></div>
|
||||
<div style="position:absolute;left:440px;top:30px;width:400px;text-align:center;color:#ffe08a;font:900 22px Georgia;text-shadow:0 2px 3px #000">Иди в портал «Тихое озеро»</div>
|
||||
<!-- тост -->
|
||||
<div style="position:absolute;left:480px;top:112px;width:320px;height:46px;box-sizing:border-box;${nine('parchment', 110, 0.2)}display:flex;align-items:center;justify-content:center;gap:8px;color:#3a2306;font:bold 16px Georgia"><img src="${ic('fish')}" width="24">Поймана Щука! +37</div>
|
||||
<!-- таблица игроков -->
|
||||
<div style="position:absolute;right:12px;top:10px;width:300px;height:84px;box-sizing:border-box;${nine('frame_small', 64, 0.36)}color:#f0dcb0;font:bold 12px Georgia">
|
||||
<div style="position:absolute;left:-10px;right:-10px;top:-12px;display:flex;justify-content:space-between;color:#ffd678"><span><img src="${ic('guild')}" width="16" style="vertical-align:-3px"> Игроки</span><span>Ур.</span><span>Серебро</span><span>Улов</span></div>
|
||||
<div style="position:absolute;left:-10px;right:-10px;top:12px;display:flex;justify-content:space-between"><span style="color:#ffe08a">pwdwildfire</span><span>1</span><span>1 250</span><span>3</span></div>
|
||||
</div>
|
||||
<!-- погода -->
|
||||
<div style="position:absolute;right:12px;top:102px;width:250px;height:58px;box-sizing:border-box;${nine('chip', 26, 1)}"></div>
|
||||
<div style="position:absolute;right:222px;top:96px;width:70px;height:70px;background:url(${u('medallion')}) center/contain;display:flex;align-items:center;justify-content:center"><img src="${ic('sun')}" width="34"></div>
|
||||
<div style="position:absolute;right:40px;top:108px;color:#f0dcb0;font:900 15px Georgia;text-shadow:0 1px 2px #000">Ясно · 09:30<br><span style="font:12px Georgia;color:#a8e090">Спокойная погода</span></div>
|
||||
<!-- свиток «Цели» -->
|
||||
<div style="position:absolute;right:16px;top:176px;width:290px">
|
||||
<div style="height:28px;background:url(${u('roller')}) center/100% 100%"></div>
|
||||
<div style="margin:-6px 14px;height:150px;box-sizing:border-box;${nine('parchment', 110, 0.16)}padding:4px 6px;color:#3a2306;font:bold 13px Georgia">
|
||||
<div style="font:900 16px Georgia;color:#7a1414;margin-bottom:4px"><img src="${ic('target')}" width="18" style="vertical-align:-3px"> Цели</div>
|
||||
Поймай 3 рыбы · 1/3<div style="height:8px;margin:3px 0 7px;background:#5a3a20;border-radius:4px"><div style="width:33%;height:100%;background:#c8902e;border-radius:4px"></div></div>
|
||||
Бамбуковая удочка · ур. 3<div style="height:8px;margin:3px 0 7px;background:#5a3a20;border-radius:4px"><div style="width:60%;height:100%;background:#4f7fb0;border-radius:4px"></div></div>
|
||||
</div>
|
||||
<div style="height:28px;background:url(${u('roller')}) center/100% 100%"></div>
|
||||
</div>
|
||||
<!-- нижняя панель -->
|
||||
<div style="position:absolute;left:400px;bottom:8px;width:480px;height:86px;box-sizing:border-box;${nine('frame_small', 64, 0.36)}">
|
||||
<div style="position:absolute;left:-12px;top:-12px;display:flex;gap:6px;align-items:center">
|
||||
${[1, 2, 3].map(n => `<div style="position:relative;width:62px;height:62px;box-sizing:border-box;${nine('slot', 52, 0.3)}">${n === 1 ? `<img src="${ic('rod')}" width="40" style="position:absolute;left:-4px;top:-4px">` : ''}<div style="position:absolute;left:12px;bottom:-24px;width:18px;height:18px;background:url(${u('gold_dot')}) center/contain;color:#3a2306;font:bold 10px Georgia;text-align:center;line-height:18px">${n}</div></div>`).join('')}
|
||||
<div style="width:150px;height:56px;box-sizing:border-box;${nine('btn_wood', 44, 0.4)}display:flex;align-items:center;justify-content:center;color:#fff2cc;font:900 15px Georgia;text-shadow:0 1px 2px #000">Старая удочка</div>
|
||||
<div style="width:120px;height:56px;box-sizing:border-box;${nine('btn_wood', 44, 0.4)}display:flex;align-items:center;justify-content:center;gap:4px;color:#fff2cc;font:900 14px Georgia;text-shadow:0 1px 2px #000"><img src="${ic('worm')}" width="22">Наживка</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- рюкзак: ПК-плашка и телефонный медальон -->
|
||||
<div style="position:absolute;right:12px;bottom:12px;width:180px;height:66px;box-sizing:border-box;${nine('btn_wood', 44, 0.6)}display:flex;align-items:center;gap:8px;color:#fff2cc;font:900 18px Georgia;text-shadow:0 1px 2px #000"><img src="${ic('bag')}" width="38" style="margin-left:-10px">Рюкзак<span style="font:bold 12px Georgia;color:#e0c890">3/12</span></div>
|
||||
<div style="position:absolute;right:220px;bottom:14px;width:64px;height:64px;background:url(${u('medallion')}) center/contain;display:flex;align-items:center;justify-content:center"><img src="${ic('bag')}" width="30"></div>
|
||||
<div style="position:absolute;right:226px;bottom:6px;width:52px;height:18px;box-sizing:border-box;${nine('chip', 26, 0.3)}color:#ffd678;font:bold 11px Georgia;text-align:center;line-height:6px">3/12</div>
|
||||
<!-- шкала клёва -->
|
||||
<div style="position:absolute;left:440px;top:560px;width:400px;height:44px;box-sizing:border-box;${nine('bar_frame', 52, 0.5)}"></div>
|
||||
<div style="position:absolute;left:600px;top:572px;width:90px;height:20px;background:rgba(80,200,90,.75);border-radius:6px"></div>
|
||||
<div style="position:absolute;left:640px;top:562px;width:6px;height:40px;background:#fff2b0;border:2px solid #3a2306;border-radius:3px"></div>
|
||||
</div>`;
|
||||
shot(hud, 1280, 720, path.join(ROOT, 'assets', 'reference', 'ui3_style_sheet2.png'));
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
{
|
||||
"frame_window": {
|
||||
"w": 512,
|
||||
"h": 512,
|
||||
"slice": 140
|
||||
},
|
||||
"banner": {
|
||||
"w": 640,
|
||||
"h": 200,
|
||||
"slice": 210
|
||||
},
|
||||
"btn_wood": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_wood_down": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_green": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_green_down": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_red": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_red_down": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_gold": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"btn_gold_down": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"tab_on": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"tab_off": {
|
||||
"w": 256,
|
||||
"h": 96,
|
||||
"slice": 44
|
||||
},
|
||||
"slot": {
|
||||
"w": 192,
|
||||
"h": 192,
|
||||
"slice": 52
|
||||
},
|
||||
"divider": {
|
||||
"w": 512,
|
||||
"h": 48,
|
||||
"slice": 0
|
||||
},
|
||||
"seal": {
|
||||
"w": 160,
|
||||
"h": 160,
|
||||
"slice": 0
|
||||
},
|
||||
"bar_frame": {
|
||||
"w": 384,
|
||||
"h": 64,
|
||||
"slice": 52
|
||||
},
|
||||
"bar_fill": {
|
||||
"w": 384,
|
||||
"h": 40,
|
||||
"slice": 20
|
||||
},
|
||||
"medallion": {
|
||||
"w": 160,
|
||||
"h": 160,
|
||||
"slice": 0
|
||||
},
|
||||
"parchment": {
|
||||
"w": 512,
|
||||
"h": 512,
|
||||
"slice": 110
|
||||
},
|
||||
"frame_small": {
|
||||
"w": 256,
|
||||
"h": 256,
|
||||
"slice": 64
|
||||
},
|
||||
"diamond": {
|
||||
"w": 128,
|
||||
"h": 128,
|
||||
"slice": 0
|
||||
},
|
||||
"chip": {
|
||||
"w": 160,
|
||||
"h": 56,
|
||||
"slice": 26
|
||||
},
|
||||
"menu_btn": {
|
||||
"w": 192,
|
||||
"h": 192,
|
||||
"slice": 0
|
||||
},
|
||||
"menu_btn_down": {
|
||||
"w": 192,
|
||||
"h": 192,
|
||||
"slice": 0
|
||||
},
|
||||
"wax_dot": {
|
||||
"w": 64,
|
||||
"h": 64,
|
||||
"slice": 0
|
||||
},
|
||||
"gold_dot": {
|
||||
"w": 64,
|
||||
"h": 64,
|
||||
"slice": 0
|
||||
},
|
||||
"roller": {
|
||||
"w": 512,
|
||||
"h": 56,
|
||||
"slice": 60
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user