12
This commit is contained in:
1 parent
1d5300eb96
commit
306cbfcbef
15 files changed
+4645
-1157
No files matched your search
@@ -13,9 +13,16 @@ Config.Worlds = {
|
||||
id = "World1", name = "Тихое озеро", icon = "🌊", level = 1, mult = 1,
|
||||
center = Vector3.new(0, 0, 1500), color = Color3.fromRGB(60, 200, 255),
|
||||
desc = "Спокойное лесное озеро. Отличное место, чтобы начать.",
|
||||
clock = 14.5, water = Color3.fromRGB(10, 55, 70),
|
||||
clock = 16.4, water = Color3.fromRGB(38, 172, 166),
|
||||
waterY = 0,
|
||||
lakes = { { 0, 0, 55 }, { -45, 15, 40 }, { 45, -10, 42 }, { 10, -42, 34 }, { -22, 40, 28 } }, -- { x, z, радиус } от центра
|
||||
lakes = { { 0, -15, 62 }, { -42, 8, 34 }, { 44, 2, 36 }, { 0, 22, 30 }, { 48, -50, 22 } }, -- { x, z, радиус } от центра
|
||||
-- внешний вид только этого мира (применяет клиент при входе, при выходе возвращает как было)
|
||||
waterTransparency = 0.6, waveSize = 0.12, tint = Color3.fromRGB(255, 240, 222),
|
||||
-- земля мира залита материалом Snow (ровный, без травинок), дорожки — Salt; здесь они перекрашиваются
|
||||
terrainColors = {
|
||||
Snow = Color3.fromRGB(122, 182, 74), Salt = Color3.fromRGB(176, 136, 90),
|
||||
Mud = Color3.fromRGB(78, 110, 92), Sand = Color3.fromRGB(205, 190, 140),
|
||||
},
|
||||
},
|
||||
{
|
||||
id = "World2", name = "Тропический остров", icon = "🏝", level = 8, mult = 4,
|
||||
|
||||
@@ -50,64 +50,14 @@ terrain.WaterReflectance = 0.08
|
||||
terrain.WaterWaveSize = 0.3
|
||||
terrain.WaterWaveSpeed = 12
|
||||
|
||||
---------------------------------------------------------------- МИР 1: террейн (строится всегда)
|
||||
---------------------------------------------------------------- МИР 1: «Тихое озеро»
|
||||
-- Уровень собирает модуль World1Builder: один раз в Studio (тогда он лежит в Workspace.World1Map
|
||||
-- вместе с террейном и правится руками как обычные модели) или здесь при запуске, если готового
|
||||
-- уровня в плейсе нет. Сам уровень и NPC подключаются ниже, после создания папки FishingMap.
|
||||
|
||||
local W = V(0, 0, 1500) -- центр Мира 1
|
||||
local GROUND_Y = 4 -- верх земли
|
||||
local WATER_Y = 0 -- поверхность воды
|
||||
|
||||
-- озеро из нескольких кругов: { x, z, радиус }
|
||||
local LAKES = Config.Worlds[1].lakes
|
||||
|
||||
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), Enum.Material.Grass)
|
||||
-- холмы по краям
|
||||
for _, h in ipairs({ { -190, 160, 50 }, { 185, 175, 45 }, { -175, -175, 60 }, { 190, -150, 55 }, { 0, -215, 50 }, { -215, 0, 40 }, { 215, 30, 42 } }) do
|
||||
terrain:FillBall(W + V(h[1], -14, h[2]), h[3], Enum.Material.Grass)
|
||||
end
|
||||
-- порядок важен: песок → выемка → ил → вода
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 11, Enum.Material.Sand)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 7, Enum.Material.Air)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 2, Enum.Material.Air)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -18, l[2])), 12, l[3], Enum.Material.Mud)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||
end
|
||||
-- то же самое напрямую по вокселям: вода ниже WATER_Y, воздух выше.
|
||||
-- Fill* с Air иногда оставляет песок над водой, и озеро выглядит сухим.
|
||||
local function carveLake(l)
|
||||
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||
local size = mats.Size
|
||||
local corner = region.CFrame.Position - region.Size / 2
|
||||
local center = W + V(l[1], 0, l[2])
|
||||
for x = 1, size.X do
|
||||
for y = 1, size.Y do
|
||||
for z = 1, size.Z do
|
||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
||||
local water = c.Y < WATER_Y
|
||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
||||
occ[x][y][z] = water and 1 or 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
terrain:WriteVoxels(region, 4, mats, occ)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
carveLake(l)
|
||||
end
|
||||
-- дорожка от точки прибытия к причалу и площадка
|
||||
terrain:FillBlock(CFrame.new(W + V(0, 2, 86)), V(8, 4, 14), Enum.Material.Ground)
|
||||
terrain:FillCylinder(CFrame.new(W + V(0, 2, 96)), 4, 12, Enum.Material.Cobblestone)
|
||||
local World1Builder = require(script.Parent:WaitForChild("World1Builder"))
|
||||
local world1Prebuilt = Workspace:FindFirstChild("World1Map")
|
||||
local GROUND_Y = 4 -- верх земли в мирах (запасная высота для groundY)
|
||||
|
||||
---------------------------------------------------------------- точка появления в лобби
|
||||
|
||||
@@ -777,105 +727,38 @@ do
|
||||
Color3.fromRGB(255, 245, 225), { TextXAlignment = Enum.TextXAlignment.Left })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО (детали)
|
||||
|
||||
local function inLake(x, z, extra)
|
||||
for _, l in ipairs(LAKES) do
|
||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
||||
return true
|
||||
---------------------------------------------------------------- МИР 1: ТИХОЕ ОЗЕРО
|
||||
do
|
||||
-- готовый уровень из плейса или собранный сейчас; кладём в FishingMap — там игра ищет маркеры
|
||||
local w1map = world1Prebuilt or World1Builder.build(map)
|
||||
w1map.Parent = map
|
||||
-- NPC стоят на маркерах — их можно двигать в Studio
|
||||
local seller = w1map:FindFirstChild("World1NpcSeller", true)
|
||||
if seller then
|
||||
npc("Скупщик Гриша", seller.CFrame, {
|
||||
skin = Color3.fromRGB(234, 190, 150), shirt = Color3.fromRGB(236, 228, 210),
|
||||
pants = Color3.fromRGB(70, 110, 76), hat = Color3.fromRGB(226, 196, 122),
|
||||
})
|
||||
end
|
||||
local grandpa = w1map:FindFirstChild("World1NpcGrandpa", true)
|
||||
if grandpa then
|
||||
npc("Дед Петрович", grandpa.CFrame, {
|
||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
||||
}, "Talk", "Поговорить")
|
||||
end
|
||||
-- доска «Кто водится в озере»: текст пишем при запуске, чтобы он совпадал с текущим списком рыб
|
||||
local board = w1map:FindFirstChild("World1Bestiary", true)
|
||||
if board and not board:FindFirstChildOfClass("SurfaceGui") then
|
||||
local lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
||||
local r = Config.Rarities[f.rarity]
|
||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- прибытие
|
||||
-- всё рядом с главным причалом: прибытие → арка → причал, по бокам портал, скупка и дед
|
||||
local arrive = W + V(0, GROUND_Y, 94)
|
||||
marker("World1Spawn", CFrame.lookAt(arrive + V(0, 1, 0), arrive + V(0, 1, -10)))
|
||||
arch(CFrame.new(W + V(0, GROUND_Y, 82)), 14, 11, "🌊 ТИХОЕ ОЗЕРО", Color3.fromRGB(80, 200, 255))
|
||||
portal(CFrame.lookAt(W + V(-22, GROUND_Y, 96), arrive), "🏠 В лобби", Color3.fromRGB(255, 200, 80), "Lobby")
|
||||
-- точки для линии-подсказки: конец главного причала и место перед скупкой
|
||||
marker("GuideFishSpot", CFrame.new(W + V(0, GROUND_Y + 0.5, 42)))
|
||||
marker("GuideSell", CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive) * CFrame.new(0, 0, -10))
|
||||
local w1Counter = stall(CFrame.lookAt(W + V(26, GROUND_Y, 98), arrive), {
|
||||
title = "💰 СКУПКА",
|
||||
titleColor = Color3.fromRGB(150, 255, 160),
|
||||
wall = Color3.fromRGB(150, 115, 80),
|
||||
stripeA = Color3.fromRGB(50, 150, 80),
|
||||
stripeB = Color3.fromRGB(245, 240, 230),
|
||||
glow = Color3.fromRGB(80, 230, 120),
|
||||
action = "Sell",
|
||||
promptText = "Продать всю рыбу",
|
||||
promptObject = "Скупка",
|
||||
npcName = "Скупщик Гриша",
|
||||
npcColors = { skin = Color3.fromRGB(200, 150, 110), shirt = Color3.fromRGB(70, 130, 80), pants = Color3.fromRGB(60, 50, 40), hat = Color3.fromRGB(200, 170, 110) },
|
||||
})
|
||||
w1Counter:SetAttribute("GuideTarget", "Sell") -- прилавок подсвечивается на шаге обучения
|
||||
|
||||
-- доска «Кто водится в озере»
|
||||
do
|
||||
local pos = W + V(-15, GROUND_Y, 80)
|
||||
local cf = CFrame.lookAt(pos, arrive)
|
||||
for _, x in ipairs({ -6, 6 }) do
|
||||
P({ Size = V(0.8, 11, 0.8), CFrame = cf * CFrame.new(x, 5.5, 0.3), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 40) })
|
||||
end
|
||||
local board = P({ Size = V(13, 10, 0.5), CFrame = cf * CFrame.new(0, 7, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(70, 48, 32) })
|
||||
local lines = { "<font color=\"#9BE7FF\">🐟 КТО ВОДИТСЯ В ОЗЕРЕ</font>" }
|
||||
for _, f in ipairs(Config.Zones.World1.fish) do
|
||||
local r = Config.Rarities[f.rarity]
|
||||
table.insert(lines, ("<font color=\"#%s\">%s — %s</font>"):format(r.color:ToHex(), f.name, r.name))
|
||||
end
|
||||
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
||||
end
|
||||
|
||||
-- костёр с брёвнами
|
||||
do
|
||||
local c = W + V(-8, GROUND_Y, 110)
|
||||
for i = 0, 7 do
|
||||
local a = i / 8 * math.pi * 2
|
||||
ball(c + V(math.cos(a) * 2.2, 0.3, math.sin(a) * 2.2), 1, { Color = Color3.fromRGB(120, 120, 125), Material = Enum.Material.Rock })
|
||||
end
|
||||
for i = 0, 2 do
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(3, 0.6, 0.6), CFrame = CFrame.new(c + V(0, 0.4, 0)) * CFrame.Angles(0, i * math.pi / 3, 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(90, 60, 35) })
|
||||
end
|
||||
local fireBase = P({ Size = V(1, 1, 1), Position = c + V(0, 0.8, 0), Transparency = 1, CanCollide = false })
|
||||
local fire = Instance.new("Fire")
|
||||
fire.Size = 5
|
||||
fire.Heat = 9
|
||||
fire.Parent = fireBase
|
||||
local light = Instance.new("PointLight")
|
||||
light.Color = Color3.fromRGB(255, 160, 80)
|
||||
light.Range = 20
|
||||
light.Brightness = 2
|
||||
light.Parent = fireBase
|
||||
for _, a in ipairs({ 0, 2.1, 4.2 }) do
|
||||
local p = c + V(math.cos(a) * 6, 0.6, math.sin(a) * 6)
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(5, 1.4, 1.4), CFrame = CFrame.lookAt(p, c) * CFrame.Angles(0, math.rad(90), 0) * CFrame.Angles(0, math.rad(90), 0), Material = Enum.Material.Wood, Color = Color3.fromRGB(115, 80, 50) })
|
||||
surfaceText(board, Enum.NormalId.Front, table.concat(lines, "\n"), Color3.new(1, 1, 1))
|
||||
end
|
||||
end
|
||||
|
||||
-- дед-рыбак с подсказками
|
||||
npc("Дед Петрович", CFrame.lookAt(W + V(12, GROUND_Y + 3, 86), arrive + V(0, 3, 0)), {
|
||||
skin = Color3.fromRGB(225, 175, 140), shirt = Color3.fromRGB(110, 120, 80), pants = Color3.fromRGB(70, 60, 45), hat = Color3.fromRGB(90, 110, 60),
|
||||
}, "Talk", "Поговорить")
|
||||
|
||||
-- домик рыбака
|
||||
do
|
||||
local cf = CFrame.lookAt(W + V(-44, GROUND_Y, 98), W + V(0, GROUND_Y, 98))
|
||||
local logC = Color3.fromRGB(130, 90, 55)
|
||||
P({ Size = V(14, 1, 12), CFrame = cf * CFrame.new(0, 0.5, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(110, 80, 50) })
|
||||
P({ Size = V(14, 8, 1), CFrame = cf * CFrame.new(0, 5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P({ Size = V(1, 8, 12), CFrame = cf * CFrame.new(s * 6.5, 5, 0), Material = Enum.Material.Wood, Color = logC })
|
||||
P({ Size = V(5, 8, 1), CFrame = cf * CFrame.new(s * 4.5, 5, -5.5), Material = Enum.Material.Wood, Color = logC })
|
||||
P({ Size = V(16, 1, 8.8), CFrame = cf * CFrame.new(0, 11.2, s * 3.4) * CFrame.Angles(math.rad(-s * 38), 0, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 60, 45) })
|
||||
end
|
||||
P({ Size = V(4, 2, 1), CFrame = cf * CFrame.new(0, 8, -5.5), Material = Enum.Material.Wood, Color = logC })
|
||||
P({ Size = V(2.2, 2, 0.3), CFrame = cf * CFrame.new(-4.5, 5.5, -6.05), Material = Enum.Material.Glass, Color = Color3.fromRGB(255, 225, 150), Transparency = 0.2 })
|
||||
P({ Size = V(14, 3, 1), CFrame = cf * CFrame.new(0, 10.5, 5.5), Material = Enum.Material.Wood, Color = logC })
|
||||
end
|
||||
|
||||
-- причалы
|
||||
-- причал (используется в Мире 2): настил и сваи; возвращает настил
|
||||
local function pier(center, size)
|
||||
local deck = P({ Size = size, Position = center, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(150, 110, 70) })
|
||||
local alongZ = size.Z > size.X
|
||||
@@ -889,126 +772,6 @@ local function pier(center, size)
|
||||
end
|
||||
return deck
|
||||
end
|
||||
-- { центр от W, размер }
|
||||
local PIERS = {
|
||||
{ V(0, GROUND_Y + 0.2, 58), V(8, 0.6, 42) },
|
||||
{ V(-86, GROUND_Y + 0.2, 15), V(34, 0.6, 7) },
|
||||
{ V(86, GROUND_Y + 0.2, -10), V(34, 0.6, 7) },
|
||||
}
|
||||
for i, p in ipairs(PIERS) do
|
||||
local deck = pier(W + p[1], p[2])
|
||||
if i == 1 then
|
||||
deck:SetAttribute("GuideTarget", "Pier") -- главный причал подсвечивается на шаге обучения
|
||||
end
|
||||
end
|
||||
|
||||
lamp(W + V(-3.5, GROUND_Y + 0.5, 40), Color3.fromRGB(255, 220, 160))
|
||||
lamp(W + V(-70, GROUND_Y + 0.5, 18), Color3.fromRGB(255, 220, 160))
|
||||
lamp(W + V(70, GROUND_Y + 0.5, -13), Color3.fromRGB(255, 220, 160))
|
||||
|
||||
-- лодка у западного причала
|
||||
do
|
||||
local cf = CFrame.new(W + V(-74, WATER_Y + 0.3, 24)) * CFrame.Angles(0, math.rad(15), 0)
|
||||
local hull = Color3.fromRGB(170, 70, 50)
|
||||
P({ Size = V(4, 0.5, 9), CFrame = cf, Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P({ Size = V(0.4, 1.4, 9), CFrame = cf * CFrame.new(s * 2, 0.7, 0), Material = Enum.Material.Wood, Color = hull })
|
||||
P({ Size = V(4.4, 1.4, 0.4), CFrame = cf * CFrame.new(0, 0.7, s * 4.5), Material = Enum.Material.Wood, Color = hull })
|
||||
end
|
||||
P({ Size = V(4, 0.3, 1.2), CFrame = cf * CFrame.new(0, 1, 0), Material = Enum.Material.WoodPlanks, Color = Color3.fromRGB(140, 100, 65) })
|
||||
end
|
||||
|
||||
-- кувшинки и камыши
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 7 do
|
||||
local a, d = rng:NextNumber(0, math.pi * 2), rng:NextNumber(6, l[3] - 5)
|
||||
local x, z = l[1] + math.cos(a) * d, l[2] + math.sin(a) * d
|
||||
local size = rng:NextNumber(2, 3.5)
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.28, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(70, 150, 60), CanCollide = false })
|
||||
if rng:NextNumber() < 0.4 then
|
||||
ball(W + V(x + 0.3, WATER_Y + 0.55, z), 0.7, { Color = Color3.fromRGB(255, 150, 190), CanCollide = false })
|
||||
end
|
||||
end
|
||||
for _ = 1, 9 do
|
||||
local a = rng:NextNumber(0, math.pi * 2)
|
||||
local x, z = l[1] + math.cos(a) * (l[3] + 1.2), l[2] + math.sin(a) * (l[3] + 1.2)
|
||||
local inOther = false
|
||||
for _, o in ipairs(LAKES) do
|
||||
if o ~= l and (V(x, 0, z) - V(o[1], 0, o[2])).Magnitude < o[3] + 1 then
|
||||
inOther = true
|
||||
end
|
||||
end
|
||||
if not inOther and not (math.abs(x) < 6 and z > 30) then
|
||||
for _ = 1, 5 do
|
||||
local h = rng:NextNumber(3, 5)
|
||||
local p = W + V(x + rng:NextNumber(-1.2, 1.2), WATER_Y + h / 2 - 0.5, z + rng:NextNumber(-1.2, 1.2))
|
||||
P({ Size = V(0.18, h, 0.18), Position = p, Color = Color3.fromRGB(85, 130, 50), CanCollide = false })
|
||||
P({ Size = V(0.35, 0.9, 0.35), Position = p + V(0, h / 2 - 0.3, 0), Color = Color3.fromRGB(110, 70, 40), CanCollide = false })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- деревья, кусты, камни
|
||||
local function freeSpot(x, z)
|
||||
if inLake(x, z, 14) then
|
||||
return false
|
||||
end
|
||||
if (V(x, 0, z) - V(0, 0, 94)).Magnitude < 36 then
|
||||
return false
|
||||
end
|
||||
if math.abs(x) < 9 and z > 60 and z < 125 then
|
||||
return false
|
||||
end
|
||||
if (V(x, 0, z) - V(-44, 0, 98)).Magnitude < 14 then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
local placed = 0
|
||||
for _ = 1, 400 do
|
||||
if placed >= 110 then
|
||||
break
|
||||
end
|
||||
local x, z = rng:NextNumber(-230, 230), rng:NextNumber(-230, 230)
|
||||
if freeSpot(x, z) then
|
||||
local y = groundY(W.X + x, W.Z + z)
|
||||
local roll = rng:NextNumber()
|
||||
tree(W + V(x, y - 0.5, z), roll < 0.35 and "pine" or (roll < 0.5 and "birch" or "round"))
|
||||
placed += 1
|
||||
end
|
||||
end
|
||||
for _ = 1, 60 do
|
||||
local x, z = rng:NextNumber(-200, 200), rng:NextNumber(-200, 200)
|
||||
if freeSpot(x, z) then
|
||||
bush(W + V(x, groundY(W.X + x, W.Z + z) - 0.6, z))
|
||||
end
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 4 do
|
||||
local a = rng:NextNumber(0, math.pi * 2)
|
||||
local x, z = l[1] + math.cos(a) * (l[3] + 8), l[2] + math.sin(a) * (l[3] + 8)
|
||||
if not inLake(x, z, 3) and not (math.abs(x) < 8 and z > 30) then
|
||||
local s = rng:NextNumber(2.5, 5)
|
||||
P({ Size = V(s, s * 0.7, s * 0.9), CFrame = CFrame.new(W + V(x, groundY(W.X + x, W.Z + z), z)) * CFrame.Angles(rng:NextNumber(0, 1), rng:NextNumber(0, 6), rng:NextNumber(0, 1)), Material = Enum.Material.Rock, Color = Color3.fromRGB(125, 125, 130) })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- фонари вдоль дорожки
|
||||
lamp(W + V(6, GROUND_Y, 90))
|
||||
lamp(W + V(-6, GROUND_Y, 90))
|
||||
|
||||
-- невидимые стены по краю мира
|
||||
for _, w in ipairs({
|
||||
{ V(0, 0, 245), V(500, 120, 2) },
|
||||
{ V(0, 0, -245), V(500, 120, 2) },
|
||||
{ V(245, 0, 0), V(2, 120, 500) },
|
||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
||||
}) do
|
||||
P({ Size = w[2], Position = W + w[1] + V(0, 40, 0), Transparency = 1 })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- помощники для новых миров
|
||||
|
||||
@@ -1471,7 +1234,7 @@ do
|
||||
local below, above = lakeState(l)
|
||||
if not planes[i] and not lakeOk(below, above) then
|
||||
warn(("[MapBuilder] Озеро %d Мира 1: под водой %s, над водой %s — заливаю заново"):format(i, tostring(below), tostring(above)))
|
||||
carveLake(l)
|
||||
World1Builder.carveLake(l)
|
||||
below, above = lakeState(l)
|
||||
if not lakeOk(below, above) then
|
||||
warn(("[MapBuilder] Озеро %d Мира 1: всё ещё %s / %s — ставлю запасную поверхность воды"):format(i, tostring(below), tostring(above)))
|
||||
@@ -1480,8 +1243,11 @@ do
|
||||
end
|
||||
end
|
||||
end
|
||||
ensureLakeWater()
|
||||
task.delay(5, ensureLakeWater)
|
||||
-- уровень, собранный и поправленный руками в Studio, не трогаем: озеро там могли поменять намеренно
|
||||
if not world1Prebuilt then
|
||||
ensureLakeWater()
|
||||
task.delay(5, ensureLakeWater)
|
||||
end
|
||||
if not terrainHasWater(w2.center + V(180, -4, 0)) then
|
||||
warn("[MapBuilder] Вода в террейне Мира 2 не создалась — ставлю запасную поверхность воды")
|
||||
waterPlane(w2.center + V(0, w2.waterY, 0), 500, Color3.fromRGB(40, 180, 190))
|
||||
|
||||
@@ -1122,7 +1122,7 @@ local function teleportTo(player, worldId)
|
||||
markerName = world.id .. "Spawn"
|
||||
end
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
local m = map and map:FindFirstChild(markerName)
|
||||
local m = map and map:FindFirstChild(markerName, true) -- маркеры могут лежать в папках уровня (World1Map)
|
||||
if m then
|
||||
stopFishing(player, true)
|
||||
char:PivotTo(m.CFrame + Vector3.new(0, 3, 0))
|
||||
|
||||
@@ -1539,10 +1539,31 @@ local lastWorldId = "none"
|
||||
local terrain = workspace.Terrain
|
||||
local defaultWater = Color3.fromRGB(10, 55, 70)
|
||||
|
||||
-- то, что мир может поменять под себя (вода, оттенок, цвета травы и песка); остальные миры — как в MapBuilder
|
||||
local DEFAULT_LOOK = { waterTransparency = 0.15, waveSize = 0.3, tint = Color3.new(1, 1, 1) }
|
||||
local defaultTerrainColors = nil
|
||||
|
||||
local function applyAmbience(world)
|
||||
local clock = (world and world.clock) or 14.5
|
||||
TweenService:Create(Lighting, TweenInfo.new(2), { ClockTime = clock }):Play()
|
||||
terrain.WaterColor = (world and world.water) or defaultWater
|
||||
terrain.WaterTransparency = (world and world.waterTransparency) or DEFAULT_LOOK.waterTransparency
|
||||
terrain.WaterWaveSize = (world and world.waveSize) or DEFAULT_LOOK.waveSize
|
||||
local cc = Lighting:FindFirstChildOfClass("ColorCorrectionEffect")
|
||||
if cc then
|
||||
TweenService:Create(cc, TweenInfo.new(2), { TintColor = (world and world.tint) or DEFAULT_LOOK.tint }):Play()
|
||||
end
|
||||
-- цвета материалов террейна общие для всей карты, поэтому меняем их только у себя и возвращаем при выходе
|
||||
if not defaultTerrainColors then
|
||||
defaultTerrainColors = {}
|
||||
for _, name in ipairs({ "Snow", "Salt", "Mud", "Sand" }) do
|
||||
defaultTerrainColors[name] = terrain:GetMaterialColor(Enum.Material[name])
|
||||
end
|
||||
end
|
||||
local colors = (world and world.terrainColors) or {}
|
||||
for name, def in pairs(defaultTerrainColors) do
|
||||
terrain:SetMaterialColor(Enum.Material[name], colors[name] or def)
|
||||
end
|
||||
local atm = Lighting:FindFirstChildOfClass("Atmosphere")
|
||||
if atm then
|
||||
local frost = world and world.id == "World3"
|
||||
@@ -1554,6 +1575,58 @@ local function applyAmbience(world)
|
||||
snow.Rate = (world and world.id == "World3") and 140 or 0
|
||||
end
|
||||
|
||||
-- тёмные силуэты рыб под прозрачной водой «Тихого озера», медленно плавают по кругу (только у этого игрока)
|
||||
do
|
||||
local w1 = Config.Worlds[1]
|
||||
local fishList = Config.Zones.World1.fish
|
||||
local frng = Random.new(11)
|
||||
local folder = new("Folder", { Name = "FishShadows", Parent = workspace })
|
||||
local swimmers = {}
|
||||
for i = 1, 10 do
|
||||
local l = w1.lakes[(i - 1) % #w1.lakes + 1]
|
||||
local ok, model = pcall(Models.buildFish, fishList[(i - 1) % #fishList + 1].id, nil, frng:NextNumber(1.3, 2), true)
|
||||
if ok and model then
|
||||
for _, d in ipairs(model:GetDescendants()) do
|
||||
if d:IsA("BasePart") then
|
||||
d.Color = Color3.fromRGB(22, 70, 74)
|
||||
d.Material = Enum.Material.SmoothPlastic
|
||||
d.Transparency = 0.5
|
||||
d.CanCollide, d.CanQuery, d.CanTouch, d.CastShadow = false, false, false, false
|
||||
elseif d:IsA("Decal") or d:IsA("ParticleEmitter") or d:IsA("Light") then
|
||||
d:Destroy()
|
||||
end
|
||||
end
|
||||
model.Parent = folder
|
||||
table.insert(swimmers, {
|
||||
model = model,
|
||||
c = w1.center + Vector3.new(l[1] + frng:NextNumber(-l[3], l[3]) * 0.25, w1.waterY - frng:NextNumber(1.4, 2.4), l[2] + frng:NextNumber(-l[3], l[3]) * 0.25),
|
||||
r = l[3] * frng:NextNumber(0.25, 0.55), a = frng:NextNumber(0, math.pi * 2),
|
||||
w = frng:NextNumber(0.08, 0.18) * (frng:NextNumber() < 0.5 and -1 or 1),
|
||||
})
|
||||
end
|
||||
end
|
||||
local acc = 0
|
||||
RunService.Heartbeat:Connect(function(dt)
|
||||
acc += dt
|
||||
if acc < 1 / 30 then
|
||||
return
|
||||
end
|
||||
local step = acc
|
||||
acc = 0
|
||||
local w = currentWorld()
|
||||
if not (w and w.id == "World1") then
|
||||
return
|
||||
end
|
||||
for _, s in ipairs(swimmers) do
|
||||
s.a += s.w * step
|
||||
local pos = s.c + Vector3.new(math.cos(s.a) * s.r, math.sin(s.a * 3) * 0.2, math.sin(s.a) * s.r)
|
||||
local dir = Vector3.new(-math.sin(s.a), 0, math.cos(s.a)) * math.sign(s.w)
|
||||
-- голова рыбы смотрит в +X модели, поэтому разворачиваем на 90°
|
||||
s.model:PivotTo(CFrame.lookAt(pos, pos + dir) * CFrame.Angles(0, math.rad(90), 0))
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
task.spawn(function()
|
||||
while true do
|
||||
local w = currentWorld()
|
||||
@@ -1587,7 +1660,6 @@ end)
|
||||
-- белые «стрелки» бегут по земле от игрока к цели текущего шага (см. Config.TutorialDone)
|
||||
|
||||
local GUIDE_N, GUIDE_GAP, GUIDE_SPEED = 32, 3, 7 -- сколько стрелок, шаг между ними, скорость бега
|
||||
local W1 = Config.Worlds[1].center
|
||||
local guideStep = 0 -- шаг, отправленный на сервер (атрибут Tutorial может прийти чуть позже)
|
||||
|
||||
-- крупная мультяшная подсказка под уведомлениями: покачивается, при смене шага «выпрыгивает»
|
||||
@@ -1645,7 +1717,7 @@ end
|
||||
|
||||
local function guideMarker(name)
|
||||
local map = workspace:FindFirstChild("FishingMap")
|
||||
local m = map and map:FindFirstChild(name)
|
||||
local m = map and map:FindFirstChild(name, true) -- маркеры могут лежать в папках уровня (World1Map)
|
||||
return m and m.Position
|
||||
end
|
||||
|
||||
@@ -1776,13 +1848,7 @@ local function guideRoute(step, pos, world)
|
||||
elseif step == 2 and inW1 then
|
||||
return { guideMarker("GuideFishSpot") }, "🎣 Зажми ЛКМ у воды", "Pier"
|
||||
elseif step == 3 and inW1 then
|
||||
local route = {}
|
||||
local rel = pos - W1
|
||||
if math.abs(rel.X) < 6 and rel.Z < 80 then
|
||||
table.insert(route, W1 + Vector3.new(0, 4.5, 84)) -- сначала сойти с причала
|
||||
end
|
||||
table.insert(route, guideMarker("GuideSell"))
|
||||
return route, "💰 Продай рыбу", "Sell"
|
||||
return { guideMarker("GuideSell") }, "💰 Продай рыбу", "Sell" -- лавка у самого причала, идём напрямую
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
@@ -0,0 +1,1000 @@
|
||||
<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
|
||||
<Item class="ModuleScript" referent="RBX1"><Properties><string name="Name">World1Builder</string><ProtectedString name="Source"><![CDATA[-- World1Builder (ModuleScript) -> ServerScriptService
|
||||
-- Генератор локации «Тихое озеро» (Мир 1). Им ОДИН РАЗ собирают уровень прямо в Roblox Studio,
|
||||
-- в режиме редактирования, а дальше уровень правится руками как обычные детали и модели.
|
||||
-- Команда для Command Bar (строка внизу Studio):
|
||||
-- require(game.ServerScriptService.World1Builder:Clone()).bake()
|
||||
-- bake() стирает старую папку Workspace.World1Map и террейн этого мира и строит всё заново.
|
||||
-- Если папки World1Map в плейсе нет, MapBuilder при запуске игры строит уровень этим же модулем.
|
||||
--
|
||||
-- Что нужно игре от уровня (не удаляйте и не переименовывайте):
|
||||
-- маркеры World1Spawn, GuideFishSpot, GuideSell, World1NpcSeller, World1NpcGrandpa — невидимые
|
||||
-- плитки; их можно двигать, NPC и точка появления встанут туда при запуске;
|
||||
-- атрибут GuideTarget = "Pier" (модель MainDock) и "Sell" (модель BaitShop) — подсветка в обучении;
|
||||
-- ProximityPrompt с атрибутом Action = "Sell" на прилавке и портал «В лобби» (Action = "Portal");
|
||||
-- деталь World1Bestiary — доска «Кто водится в озере», текст на неё пишет MapBuilder при запуске.
|
||||
-- Форма воды для заброса берётся из FishConfig (Worlds[1].lakes) — если меняете озеро руками,
|
||||
-- поправьте там круги, иначе игра будет считать водой старые места.
|
||||
|
||||
local Workspace = game:GetService("Workspace")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
|
||||
|
||||
local V = Vector3.new
|
||||
local terrain = Workspace.Terrain
|
||||
local W1 = Config.Worlds[1]
|
||||
local W = W1.center -- центр Мира 1
|
||||
local GROUND_Y = 4 -- верх земли
|
||||
local WATER_Y = W1.waterY -- поверхность воды
|
||||
local LAKES = W1.lakes -- озеро из кругов { x, z, радиус } от W
|
||||
|
||||
-- холмы: { x, z, радиус, высота центра шара } — верх холма = высота центра + радиус
|
||||
local HILLS = {
|
||||
{ -78, -138, 62, -22 }, -- холм с вышкой
|
||||
{ -175, -55, 58, -34 }, { 175, -165, 62, -30 }, { -175, 160, 52, -32 },
|
||||
{ 180, 130, 48, -30 }, { 10, -225, 60, -34 }, { -60, 175, 45, -28 }, { 95, 190, 40, -26 },
|
||||
}
|
||||
-- тропинка на холм к вышке (точки от W)
|
||||
local HILL_PATH = { { -22, -76 }, { -40, -92 }, { -28, -106 }, { -52, -114 }, { -44, -127 }, { -66, -131 } }
|
||||
-- «трава» — материал Snow: у него нет травинок и почти нет рисунка, получается ровная мультяшная
|
||||
-- поверхность. В зелёный (а дорожки из Salt — в коричневый) его красит клиент только в этом мире.
|
||||
local GROUND_MAT, PATH_MAT = Enum.Material.Snow, Enum.Material.Salt
|
||||
|
||||
local Builder = {}
|
||||
|
||||
-- вода ниже WATER_Y и воздух над ней прямо по вокселям (Fill* с Air иногда оставляет песок над водой)
|
||||
function Builder.carveLake(l)
|
||||
local region = Region3.new(W + V(l[1] - l[3], WATER_Y - 12, l[2] - l[3]), W + V(l[1] + l[3], WATER_Y + 16, l[2] + l[3])):ExpandToGrid(4)
|
||||
local mats, occ = terrain:ReadVoxels(region, 4)
|
||||
local size = mats.Size
|
||||
local corner = region.CFrame.Position - region.Size / 2
|
||||
local center = W + V(l[1], 0, l[2])
|
||||
for x = 1, size.X do
|
||||
for y = 1, size.Y do
|
||||
for z = 1, size.Z do
|
||||
local c = corner + V(x - 0.5, y - 0.5, z - 0.5) * 4
|
||||
if (V(c.X, 0, c.Z) - center).Magnitude <= l[3] then
|
||||
local water = c.Y < WATER_Y
|
||||
mats[x][y][z] = water and Enum.Material.Water or Enum.Material.Air
|
||||
occ[x][y][z] = water and 1 or 0
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
terrain:WriteVoxels(region, 4, mats, occ)
|
||||
end
|
||||
|
||||
-- высота земли с учётом холмов: считаем по формуле (лучи по только что залитому террейну ненадёжны)
|
||||
local function hillY(x, z)
|
||||
local y = GROUND_Y
|
||||
for _, h in ipairs(HILLS) do
|
||||
local d2 = (x - h[1]) ^ 2 + (z - h[2]) ^ 2
|
||||
if d2 < h[3] ^ 2 then
|
||||
y = math.max(y, h[4] + math.sqrt(h[3] ^ 2 - d2))
|
||||
end
|
||||
end
|
||||
return y
|
||||
end
|
||||
|
||||
local function inLake(x, z, extra)
|
||||
for _, l in ipairs(LAKES) do
|
||||
if (V(x, 0, z) - V(l[1], 0, l[2])).Magnitude < l[3] + (extra or 0) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- террейн
|
||||
local function buildTerrain()
|
||||
terrain:FillBlock(CFrame.new(W + V(0, -10, 0)), V(500, 28, 500), GROUND_MAT)
|
||||
for _, h in ipairs(HILLS) do
|
||||
terrain:FillBall(W + V(h[1], h[4], h[2]), h[3], GROUND_MAT)
|
||||
end
|
||||
-- порядок важен: узкая песчаная кромка → выемка → ил → вода
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -10, l[2])), 28, l[3] + 3, Enum.Material.Sand)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 11, l[2])), 18, l[3] + 2, Enum.Material.Air)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], 10, l[2])), 20, l[3] + 1, Enum.Material.Air)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -18, l[2])), 12, l[3], Enum.Material.Mud)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
terrain:FillCylinder(CFrame.new(W + V(l[1], -6, l[2])), 12, l[3], Enum.Material.Water)
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
Builder.carveLake(l)
|
||||
end
|
||||
-- земляные дорожки: меняем материал травы на материал дорожки, объём не меняется
|
||||
local function dirtPath(points, width)
|
||||
for i = 2, #points do
|
||||
local a, b = points[i - 1], points[i]
|
||||
local len = math.sqrt((b[1] - a[1]) ^ 2 + (b[2] - a[2]) ^ 2)
|
||||
for s = 0, len, 2 do
|
||||
local x, z = a[1] + (b[1] - a[1]) * s / len, a[2] + (b[2] - a[2]) * s / len
|
||||
local half = V(width / 2, 3, width / 2)
|
||||
local p = W + V(x, hillY(x, z), z)
|
||||
terrain:ReplaceMaterial(Region3.new(p - half, p + half):ExpandToGrid(4), 4, GROUND_MAT, PATH_MAT)
|
||||
end
|
||||
end
|
||||
end
|
||||
dirtPath(HILL_PATH, 4)
|
||||
dirtPath({ { 0, 84 }, { 0, 64 } }, 6) -- площадка у корня причала
|
||||
dirtPath({ { 8, -84 }, { 8, -100 } }, 4) -- к домику у мостков
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- детали
|
||||
-- parent — куда положить папку World1Map (Workspace при сборке в Studio, FishingMap при запуске игры)
|
||||
function Builder.build(parent)
|
||||
buildTerrain()
|
||||
|
||||
local rng = Random.new(7)
|
||||
local map = Instance.new("Folder")
|
||||
map.Name = "World1Map"
|
||||
|
||||
-------------------------------------------------- помощники
|
||||
local function P(props)
|
||||
local p = Instance.new("Part")
|
||||
if props.Shape then
|
||||
p.Shape = props.Shape
|
||||
end
|
||||
p.Anchored = true
|
||||
p.TopSurface = Enum.SurfaceType.Smooth
|
||||
p.BottomSurface = Enum.SurfaceType.Smooth
|
||||
for k, v in pairs(props) do
|
||||
if k ~= "Parent" and k ~= "Shape" then
|
||||
p[k] = v
|
||||
end
|
||||
end
|
||||
p.Parent = props.Parent or map
|
||||
return p
|
||||
end
|
||||
local function vcyl(pos, h, d, props)
|
||||
props.Shape = Enum.PartType.Cylinder
|
||||
props.Size = V(h, d, d)
|
||||
props.CFrame = CFrame.new(pos) * CFrame.Angles(0, 0, math.rad(90))
|
||||
return P(props)
|
||||
end
|
||||
local function ball(pos, d, props)
|
||||
props.Shape = Enum.PartType.Ball
|
||||
props.Size = V(d, d, d)
|
||||
props.Position = pos
|
||||
return P(props)
|
||||
end
|
||||
-- цилиндр между двумя точками (брёвна, балки, перила, вёсла)
|
||||
local function rod(a, b, d, props)
|
||||
props.Shape = Enum.PartType.Cylinder
|
||||
props.Size = V(math.max(0.05, (b - a).Magnitude), d, d)
|
||||
props.CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.rad(90), 0)
|
||||
return P(props)
|
||||
end
|
||||
local function surfaceText(part, face, text, color)
|
||||
local sg = Instance.new("SurfaceGui")
|
||||
sg.Face = face
|
||||
sg.SizingMode = Enum.SurfaceGuiSizingMode.PixelsPerStud
|
||||
sg.PixelsPerStud = 40
|
||||
sg.LightInfluence = 0
|
||||
sg.Parent = part
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Size = UDim2.fromScale(1, 1)
|
||||
t.BackgroundTransparency = 1
|
||||
t.Font = Enum.Font.FredokaOne
|
||||
t.TextScaled = true
|
||||
t.TextColor3 = color
|
||||
t.TextStrokeTransparency = 1
|
||||
t.Text = text
|
||||
t.Parent = sg
|
||||
end
|
||||
local function prompt(target, actionText, objectText, action)
|
||||
local pp = Instance.new("ProximityPrompt")
|
||||
pp.ActionText = actionText
|
||||
pp.ObjectText = objectText
|
||||
pp.HoldDuration = 0
|
||||
pp.MaxActivationDistance = 14
|
||||
pp.RequiresLineOfSight = false
|
||||
pp:SetAttribute("Action", action)
|
||||
pp.Parent = target
|
||||
return pp
|
||||
end
|
||||
local function marker(name, cf)
|
||||
return P({ Name = name, Size = V(4, 1, 4), CFrame = cf, Transparency = 1, CanCollide = false, CanQuery = false, CanTouch = false })
|
||||
end
|
||||
|
||||
local COL = {
|
||||
plank = Color3.fromRGB(196, 140, 88), plankDark = Color3.fromRGB(160, 110, 68),
|
||||
log = Color3.fromRGB(156, 102, 60), logDark = Color3.fromRGB(105, 70, 44),
|
||||
rope = Color3.fromRGB(218, 184, 128), roof = Color3.fromRGB(62, 104, 78), stone = Color3.fromRGB(150, 146, 150),
|
||||
rock = Color3.fromRGB(150, 146, 162), rockDark = Color3.fromRGB(112, 108, 128), moss = Color3.fromRGB(108, 152, 72),
|
||||
pine = Color3.fromRGB(58, 126, 70), pineDark = Color3.fromRGB(30, 82, 52),
|
||||
leaf = Color3.fromRGB(110, 170, 64), leafDark = Color3.fromRGB(72, 136, 56),
|
||||
glow = Color3.fromRGB(255, 200, 120), awnA = Color3.fromRGB(46, 106, 72), awnB = Color3.fromRGB(242, 232, 204),
|
||||
banner = Color3.fromRGB(40, 92, 62), metal = Color3.fromRGB(48, 44, 42), water = Color3.fromRGB(70, 200, 195),
|
||||
}
|
||||
local WOOD, PLANKS, SMOOTH = Enum.Material.Wood, Enum.Material.WoodPlanks, Enum.Material.SmoothPlastic
|
||||
-- куб, повёрнутый вершиной вверх: три грани сходятся в острый пик (ёлки, горы, обломки скал)
|
||||
local CUBE_UP = CFrame.Angles(math.rad(-35.264), 0, 0) * CFrame.Angles(0, 0, math.rad(45))
|
||||
|
||||
-- столб с кронштейном и висящим фонарём; facing — куда смотрит кронштейн
|
||||
local function postLantern(base, facing, h)
|
||||
h = h or 8
|
||||
local top = base + V(0, h, 0)
|
||||
vcyl(base + V(0, h / 2, 0), h, 0.8, { Color = COL.logDark, Material = WOOD })
|
||||
rod(top - V(0, 0.3, 0), top + facing * 2.4 - V(0, 0.3, 0), 0.35, { Color = COL.logDark, Material = WOOD })
|
||||
local hang = top + facing * 2 - V(0, 1.8, 0)
|
||||
rod(hang + V(0, 0.9, 0), top + facing * 2 - V(0, 0.3, 0), 0.08, { Color = COL.metal, Material = Enum.Material.Metal, CanCollide = false })
|
||||
P({ Size = V(1.2, 0.3, 1.2), Position = hang + V(0, 0.85, 0), Color = COL.metal, Material = Enum.Material.Metal, CanCollide = false })
|
||||
local glass = P({ Size = V(0.9, 1.3, 0.9), Position = hang, Color = COL.glow, Material = Enum.Material.Neon, CanCollide = false, CastShadow = false })
|
||||
P({ Size = V(1.2, 0.3, 1.2), Position = hang - V(0, 0.8, 0), Color = COL.metal, Material = Enum.Material.Metal, CanCollide = false })
|
||||
local light = Instance.new("PointLight")
|
||||
light.Range = 18
|
||||
light.Brightness = 1.5
|
||||
light.Color = COL.glow
|
||||
light.Parent = glass
|
||||
end
|
||||
|
||||
-- low-poly ёлка: ствол и ярусы-«ромбы» (кубы вершиной вверх), к верху меньше
|
||||
local function pine(pos, h, tiers)
|
||||
tiers = tiers or 3
|
||||
vcyl(pos + V(0, h * 0.15, 0), h * 0.3, math.max(0.8, h * 0.07), { Color = COL.logDark, Material = WOOD, CastShadow = false })
|
||||
local shade = rng:NextNumber(0, 0.3)
|
||||
for i = 0, tiers - 1 do
|
||||
local t = tiers > 1 and i / (tiers - 1) or 1
|
||||
local s = h * (0.42 - 0.22 * t)
|
||||
P({
|
||||
Size = V(s, s, s),
|
||||
CFrame = CFrame.new(pos + V(0, h * (0.34 + 0.48 * t), 0)) * CFrame.Angles(0, rng:NextNumber(0, 6.28), 0) * CUBE_UP,
|
||||
Color = COL.pineDark:Lerp(COL.pine, 0.2 + 0.5 * t + shade), Material = SMOOTH, CanCollide = false,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- круглое лиственное дерево
|
||||
local function leafy(pos, s)
|
||||
vcyl(pos + V(0, s * 0.4, 0), s * 0.8, s * 0.14, { Color = COL.log, Material = WOOD })
|
||||
local c = COL.leafDark:Lerp(COL.leaf, rng:NextNumber(0.3, 1))
|
||||
ball(pos + V(0, s * 1.05, 0), s * 0.95, { Color = c, Material = SMOOTH, CanCollide = false })
|
||||
ball(pos + V(s * 0.38, s * 0.85, s * 0.1), s * 0.65, { Color = c:Lerp(COL.leaf, 0.3), Material = SMOOTH, CanCollide = false })
|
||||
ball(pos + V(-s * 0.35, s * 0.9, -s * 0.2), s * 0.6, { Color = c:Lerp(COL.leafDark, 0.3), Material = SMOOTH, CanCollide = false })
|
||||
end
|
||||
|
||||
-- угловатый low-poly камень
|
||||
local function rock(pos, s, col)
|
||||
return P({
|
||||
Size = V(s, s * rng:NextNumber(0.55, 0.85), s * rng:NextNumber(0.7, 1)),
|
||||
CFrame = CFrame.new(pos) * CFrame.Angles(rng:NextNumber(-0.4, 0.4), rng:NextNumber(0, 6.28), rng:NextNumber(-0.4, 0.4)),
|
||||
Color = (col or COL.rock):Lerp(COL.rockDark, rng:NextNumber(0, 0.6)), Material = SMOOTH,
|
||||
})
|
||||
end
|
||||
-- острый обломок скалы (куб вершиной вверх), наполовину утоплен
|
||||
local function crag(pos, s)
|
||||
return P({
|
||||
Size = V(s, s, s),
|
||||
CFrame = CFrame.new(pos) * CFrame.Angles(rng:NextNumber(-0.2, 0.2), rng:NextNumber(0, 6.28), rng:NextNumber(-0.2, 0.2)) * CUBE_UP,
|
||||
Color = COL.rock:Lerp(COL.rockDark, rng:NextNumber(0, 0.6)), Material = SMOOTH,
|
||||
})
|
||||
end
|
||||
|
||||
-- рогоз: несколько стеблей с коричневыми «початками» и листья
|
||||
local function cattails(pos)
|
||||
for _ = 1, rng:NextInteger(3, 6) do
|
||||
local p = pos + V(rng:NextNumber(-1.3, 1.3), 0, rng:NextNumber(-1.3, 1.3))
|
||||
local top = p + V(rng:NextNumber(-0.4, 0.4), rng:NextNumber(3.5, 6), rng:NextNumber(-0.4, 0.4))
|
||||
rod(p, top, 0.16, { Color = Color3.fromRGB(96, 140, 62), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||
local dir = (top - p).Unit
|
||||
rod(top - dir * 2, top - dir * 0.6, 0.5, { Color = Color3.fromRGB(122, 74, 40), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||
end
|
||||
for _ = 1, 3 do
|
||||
P({
|
||||
Size = V(0.35, rng:NextNumber(3, 4.5), 0.08),
|
||||
CFrame = CFrame.new(pos + V(0, 1.6, 0)) * CFrame.Angles(0, rng:NextNumber(0, 6.28), rng:NextNumber(-0.35, 0.35)),
|
||||
Color = Color3.fromRGB(110, 160, 70), Material = SMOOTH, CanCollide = false, CastShadow = false,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- круглая свая с намотанным канатом; y0 — низ (под водой), top — верх сваи
|
||||
local function ropePost(x, z, y0, top, d, parent)
|
||||
d = d or 1.6
|
||||
vcyl(W + V(x, (y0 + top) / 2, z), top - y0, d, { Color = COL.log, Material = WOOD, Parent = parent })
|
||||
vcyl(W + V(x, top + 0.1, z), 0.2, d * 0.9, { Color = COL.plankDark, Material = WOOD, Parent = parent })
|
||||
for i = 1, 3 do
|
||||
vcyl(W + V(x, top - 0.5 - i * 0.38, z), 0.3, d + 0.25, { Color = COL.rope, Material = Enum.Material.Fabric, CanCollide = false, Parent = parent })
|
||||
end
|
||||
end
|
||||
|
||||
-- маленькие мостки: доски поперёк и сваи
|
||||
local function smallDock(x, z0, z1, w, y)
|
||||
local dir = z1 > z0 and 1 or -1
|
||||
for z = z0, z1, dir * 1.6 do
|
||||
P({ Size = V(w, 0.45, 1.45), Position = W + V(x, y - 0.22, z), Color = COL.plank:Lerp(COL.plankDark, rng:NextNumber(0, 0.6)), Material = PLANKS })
|
||||
end
|
||||
for z = z0 + dir * 2, z1, dir * 6 do
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
vcyl(W + V(x + s * (w / 2 - 0.3), y - 4, z), 8, 0.8, { Color = COL.logDark, Material = WOOD })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- бревенчатый дом: стены из брёвен, двускатная зелёная крыша, тёплые окна, труба с дымом, крыльцо.
|
||||
-- cf — центр пола на земле, сторона -Z (LookVector) — фасад с дверью
|
||||
local function logCabin(name, cf, w, d, wallH)
|
||||
local house = Instance.new("Model")
|
||||
house.Name = name
|
||||
house.Parent = map
|
||||
local function part(props)
|
||||
props.Parent = house
|
||||
return P(props)
|
||||
end
|
||||
local LOG = 1.25
|
||||
local rows = math.floor(wallH / LOG)
|
||||
local wallTop = 1 + rows * LOG
|
||||
local function at(x, y, z)
|
||||
return (cf * CFrame.new(x, y, z)).Position
|
||||
end
|
||||
part({ Size = V(w + 1.5, 1, d + 1.5), CFrame = cf * CFrame.new(0, 0.5, 0), Color = COL.stone, Material = Enum.Material.Slate })
|
||||
for r = 0, rows - 1 do
|
||||
local y = 1 + LOG / 2 + r * LOG
|
||||
local col = (r % 2 == 0) and COL.log or COL.log:Lerp(COL.logDark, 0.3)
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
rod(at(-w / 2 - 0.9, y, s * d / 2), at(w / 2 + 0.9, y, s * d / 2), LOG, { Color = col, Material = WOOD, Parent = house })
|
||||
rod(at(s * w / 2, y, -d / 2 - 0.9), at(s * w / 2, y, d / 2 + 0.9), LOG, { Color = col, Material = WOOD, Parent = house })
|
||||
end
|
||||
end
|
||||
-- фронтоны (по бокам) — брёвна всё короче к коньку
|
||||
local a = math.rad(34)
|
||||
local rise = (d / 2) * math.tan(a)
|
||||
for k = 0, math.floor(rise / LOG) - 1 do
|
||||
local y = wallTop + LOG / 2 + k * LOG
|
||||
local half = (d / 2) * (1 - (k + 1) * LOG / rise)
|
||||
if half > 0.6 then
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
rod(at(s * w / 2, y, -half), at(s * w / 2, y, half), LOG, { Color = COL.log:Lerp(COL.logDark, 0.15), Material = WOOD, Parent = house })
|
||||
end
|
||||
end
|
||||
end
|
||||
-- крыша: два ската, конёк вдоль X
|
||||
local run = d / 2 + 1.6
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Size = V(w + 3, 0.7, run / math.cos(a)), CFrame = cf * CFrame.new(0, wallTop + run * math.tan(a) / 2 + 0.35, s * run / 2) * CFrame.Angles(s * a, 0, 0), Color = COL.roof, Material = SMOOTH })
|
||||
end
|
||||
part({ Size = V(w + 3.2, 0.6, 0.9), CFrame = cf * CFrame.new(0, wallTop + run * math.tan(a) + 0.2, 0), Color = COL.roof:Lerp(Color3.new(0, 0, 0), 0.25), Material = SMOOTH })
|
||||
-- дверь и окна с тёплым светом
|
||||
part({ Size = V(3, 5.2, 0.5), CFrame = cf * CFrame.new(0, 3.6, -d / 2 - 0.7), Color = COL.logDark, Material = PLANKS })
|
||||
for i, wdw in ipairs({ { -w / 4, -d / 2 - 0.65, 0 }, { w / 4, -d / 2 - 0.65, 0 }, { -w / 2 - 0.65, 0, 90 }, { w / 2 + 0.65, 0, 90 } }) do
|
||||
local wcf = cf * CFrame.new(wdw[1], 4.6, wdw[2]) * CFrame.Angles(0, math.rad(wdw[3]), 0)
|
||||
part({ Size = V(3, 2.6, 0.4), CFrame = wcf, Color = COL.logDark, Material = WOOD })
|
||||
local g = part({ Size = V(2.4, 2, 0.45), CFrame = wcf, Color = COL.glow, Material = Enum.Material.Neon, CastShadow = false })
|
||||
part({ Size = V(0.2, 2, 0.5), CFrame = wcf, Color = COL.logDark, Material = WOOD })
|
||||
if i == 1 then
|
||||
local l = Instance.new("PointLight")
|
||||
l.Range = 14
|
||||
l.Brightness = 1
|
||||
l.Color = COL.glow
|
||||
l.Parent = g
|
||||
end
|
||||
end
|
||||
-- крыльцо
|
||||
part({ Size = V(w * 0.55, 0.6, 4), CFrame = cf * CFrame.new(0, 1.1, -d / 2 - 2.8), Color = COL.plank, Material = PLANKS })
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
vcyl(at(s * w * 0.25, 4.2, -d / 2 - 4.4), 6.2, 0.6, { Color = COL.log, Material = WOOD, Parent = house })
|
||||
end
|
||||
part({ Size = V(w * 0.62, 0.5, 4.8), CFrame = cf * CFrame.new(0, 7.3, -d / 2 - 2.6) * CFrame.Angles(-math.rad(14), 0, 0), Color = COL.roof, Material = SMOOTH })
|
||||
-- труба с дымом
|
||||
local ch = at(w / 2 - 2.2, 0, d / 4)
|
||||
local chTop = wallTop + rise + 3
|
||||
part({ Size = V(2.2, chTop, 2.2), Position = ch + V(0, chTop / 2, 0), Color = Color3.fromRGB(150, 110, 95), Material = Enum.Material.Brick })
|
||||
local smokeAt = part({ Size = V(1, 1, 1), Position = ch + V(0, chTop + 0.5, 0), Transparency = 1, CanCollide = false, CanQuery = false })
|
||||
local smoke = Instance.new("ParticleEmitter")
|
||||
smoke.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||
smoke.Color = ColorSequence.new(Color3.fromRGB(235, 235, 235))
|
||||
smoke.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, 1.5), NumberSequenceKeypoint.new(1, 6) })
|
||||
smoke.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.4), NumberSequenceKeypoint.new(1, 1) })
|
||||
smoke.Lifetime = NumberRange.new(4, 6)
|
||||
smoke.Rate = 4
|
||||
smoke.Speed = NumberRange.new(2, 3)
|
||||
smoke.SpreadAngle = Vector2.new(10, 10)
|
||||
smoke.Acceleration = V(1, 0.4, 0)
|
||||
smoke.Parent = smokeAt
|
||||
end
|
||||
|
||||
-------------------------------------------------- прибытие, причал, лавка
|
||||
local DOCK = { z0 = 64, z1 = 36, w = 12 } -- от берега (z0) в воду (z1), по оси X = 0
|
||||
local DECK_Y = GROUND_Y + 0.6 -- верх настила
|
||||
local spawnAt = W + V(0, DECK_Y, 60)
|
||||
marker("World1Spawn", CFrame.lookAt(spawnAt + V(0, 1, 0), spawnAt + V(0, 1, -10)))
|
||||
marker("GuideFishSpot", CFrame.new(W + V(0, DECK_Y + 0.5, DOCK.z1 + 3)))
|
||||
|
||||
-- главный причал: доски поперёк, толстые сваи с канатом по краям, ящик для снастей
|
||||
do
|
||||
local dock = Instance.new("Model")
|
||||
dock.Name = "MainDock"
|
||||
dock:SetAttribute("GuideTarget", "Pier") -- подсвечивается на шаге обучения
|
||||
dock.Parent = map
|
||||
for z = DOCK.z1 + 0.8, DOCK.z0 - 0.8, 1.6 do
|
||||
P({
|
||||
Size = V(DOCK.w + rng:NextNumber(-0.3, 0.3), 0.5, 1.48), Position = W + V(0, DECK_Y - 0.25, z),
|
||||
Color = COL.plank:Lerp(COL.plankDark, rng:NextNumber(0, 0.7)), Material = PLANKS, Parent = dock,
|
||||
})
|
||||
end
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P({ Size = V(0.8, 0.8, DOCK.z0 - DOCK.z1), Position = W + V(s * (DOCK.w / 2 - 1), DECK_Y - 0.9, (DOCK.z0 + DOCK.z1) / 2), Color = COL.logDark, Material = WOOD, Parent = dock })
|
||||
for z = DOCK.z1 + 1, DOCK.z0 - 2, 8 do
|
||||
ropePost(s * (DOCK.w / 2 - 0.2), z, -6, DECK_Y + 2.4, 1.7, dock)
|
||||
end
|
||||
end
|
||||
local tb = W + V(-3.4, DECK_Y, 46)
|
||||
P({ Size = V(2.6, 1.3, 1.5), Position = tb + V(0, 0.65, 0), Color = Color3.fromRGB(120, 142, 124), Material = SMOOTH, Parent = dock })
|
||||
P({ Size = V(2.7, 0.35, 1.6), Position = tb + V(0, 1.45, 0), Color = Color3.fromRGB(96, 116, 100), Material = SMOOTH, Parent = dock })
|
||||
rod(tb + V(-0.7, 1.65, 0), tb + V(0.7, 1.65, 0), 0.18, { Color = COL.metal, Material = Enum.Material.Metal, Parent = dock })
|
||||
P({ Size = V(0.35, 0.35, 0.1), Position = tb + V(0, 1.2, -0.8), Color = Color3.fromRGB(230, 190, 70), Material = Enum.Material.Metal, Parent = dock })
|
||||
P({ Size = V(2, 2, 2), CFrame = CFrame.new(W + V(-4.2, DECK_Y + 1, 49.5)) * CFrame.Angles(0, 0.25, 0), Color = COL.plankDark, Material = PLANKS, Parent = dock })
|
||||
end
|
||||
|
||||
-- лавка рыбака (скупка) слева от корня причала, прилавком к причалу: тент, вывеска, поплавки,
|
||||
-- воблеры, бочки и ящики, фонарь на столбе. Продавца ставит MapBuilder на маркер World1NpcSeller.
|
||||
do
|
||||
local cf = CFrame.lookAt(W + V(-15, GROUND_Y, 60), W + V(0, GROUND_Y, 57))
|
||||
local shop = Instance.new("Model")
|
||||
shop.Name = "BaitShop"
|
||||
shop:SetAttribute("GuideTarget", "Sell") -- подсвечивается на шаге обучения
|
||||
shop.Parent = map
|
||||
local function at(x, y, z)
|
||||
return cf * CFrame.new(x, y, z)
|
||||
end
|
||||
local function part(props)
|
||||
props.Parent = shop
|
||||
return P(props)
|
||||
end
|
||||
part({ Size = V(14, 0.8, 10), CFrame = at(0, 0.4, 0), Color = COL.plankDark, Material = PLANKS })
|
||||
part({ Size = V(14, 9, 0.8), CFrame = at(0, 5, 4.6), Color = COL.plank, Material = PLANKS })
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
part({ Size = V(0.8, 9, 10), CFrame = at(s * 6.6, 5, 0), Color = COL.plank, Material = PLANKS })
|
||||
part({ Size = V(1.2, 10.4, 1.2), CFrame = at(s * 6.6, 5.2, -4.8), Color = COL.logDark, Material = WOOD })
|
||||
end
|
||||
part({ Size = V(15.5, 0.7, 11), CFrame = at(0, 10.4, 0), Color = COL.logDark, Material = PLANKS })
|
||||
local counter = part({ Name = "Counter", Size = V(12, 3.4, 2.4), CFrame = at(0, 2.5, -3.6), Color = COL.plank, Material = PLANKS })
|
||||
part({ Size = V(13, 0.4, 3), CFrame = at(0, 4.4, -3.6), Color = COL.logDark, Material = WOOD })
|
||||
prompt(counter, "Продать всю рыбу", "Скупка", "Sell")
|
||||
-- полосатый тент и фестончики
|
||||
local n = 8
|
||||
for i = 0, n - 1 do
|
||||
local c = (i % 2 == 0) and COL.awnA or COL.awnB
|
||||
local x = -7.5 + (i + 0.5) * 15 / n
|
||||
part({ Size = V(15 / n + 0.02, 0.25, 5), CFrame = at(x, 9.7, -6.9) * CFrame.Angles(math.rad(-24), 0, 0), Color = c, Material = Enum.Material.Fabric })
|
||||
part({ Shape = Enum.PartType.Cylinder, Size = V(0.25, 15 / n, 15 / n), CFrame = at(x, 8.7, -9.25) * CFrame.Angles(0, math.rad(90), 0), Color = c, Material = Enum.Material.Fabric, CanCollide = false })
|
||||
end
|
||||
-- вывеска над тентом
|
||||
local sign = part({ Size = V(8, 3, 0.5), CFrame = at(0, 12.6, -4.9), Color = COL.plank, Material = PLANKS })
|
||||
part({ Size = V(8.6, 3.6, 0.3), CFrame = at(0, 12.6, -4.6), Color = COL.logDark, Material = WOOD })
|
||||
surfaceText(sign, Enum.NormalId.Front, "🐟 СКУПКА", Color3.fromRGB(60, 40, 25))
|
||||
-- воблеры на задней стене
|
||||
for i, c in ipairs({ Color3.fromRGB(90, 200, 80), Color3.fromRGB(245, 210, 60), Color3.fromRGB(245, 140, 50), Color3.fromRGB(70, 150, 230), Color3.fromRGB(230, 70, 70) }) do
|
||||
local x = -4.4 + (i - 1) * 2.2
|
||||
part({ Size = V(0.08, 1.4, 0.08), CFrame = at(x, 8.4, 4.05), Color = COL.metal, CanCollide = false })
|
||||
part({ Size = V(0.55, 1.6, 0.5), CFrame = at(x, 7, 4.0), Color = c, Material = SMOOTH, CanCollide = false })
|
||||
part({ Size = V(0.3, 0.5, 0.45), CFrame = at(x, 6, 4.0), Color = c:Lerp(Color3.new(1, 1, 1), 0.4), Material = SMOOTH, CanCollide = false })
|
||||
end
|
||||
-- поплавки и ящички на прилавке
|
||||
for i = 0, 3 do
|
||||
local p = at(-4.5 + i * 1.3, 5.05, -3.4).Position
|
||||
ball(p, 0.9, { Color = Color3.fromRGB(225, 50, 45), Material = SMOOTH, Parent = shop, CanCollide = false })
|
||||
ball(p + V(0, 0.55, 0), 0.6, { Color = Color3.fromRGB(250, 250, 250), Material = SMOOTH, Parent = shop, CanCollide = false })
|
||||
end
|
||||
part({ Size = V(2.2, 1, 1.4), CFrame = at(2.6, 5.1, -3.5), Color = Color3.fromRGB(120, 140, 125), Material = SMOOTH })
|
||||
part({ Size = V(1.6, 0.8, 1.2), CFrame = at(4.8, 5, -3.4), Color = COL.plankDark, Material = PLANKS })
|
||||
-- бочки и ящики сбоку
|
||||
for i, off in ipairs({ { 8.6, -2.6 }, { 9.2, 0.6 } }) do
|
||||
local p = at(off[1], 1.7, off[2]).Position
|
||||
vcyl(p, 3.4, 2.8, { Color = COL.log, Material = WOOD, Parent = shop })
|
||||
for _, dy in ipairs({ -1, 1 }) do
|
||||
vcyl(p + V(0, dy, 0), 0.3, 2.95, { Color = COL.metal, Material = Enum.Material.Metal, Parent = shop, CanCollide = false })
|
||||
end
|
||||
if i == 2 then
|
||||
part({ Size = V(2.2, 2.2, 2.2), CFrame = at(9, 4.5, 0.6) * CFrame.Angles(0, 0.3, 0), Color = COL.plankDark, Material = PLANKS })
|
||||
end
|
||||
end
|
||||
part({ Size = V(2.6, 2.6, 2.6), CFrame = at(-9, 1.3, -1.5) * CFrame.Angles(0, 0.2, 0), Color = COL.plankDark, Material = PLANKS })
|
||||
marker("World1NpcSeller", at(0, 3.9, 1.6))
|
||||
marker("GuideSell", cf * CFrame.new(0, 0, -9))
|
||||
postLantern(at(-7.8, 0, -6.2).Position, (cf.LookVector * V(1, 0, 1)).Unit, 9)
|
||||
end
|
||||
leafy(W + V(-27, GROUND_Y, 70), 13) -- большое дерево над лавкой, как на макете
|
||||
postLantern(W + V(7.5, GROUND_Y, 66), V(-1, 0, 0), 8)
|
||||
|
||||
-- деревянная лодка с вёслами справа от причала у двух свай
|
||||
do
|
||||
local cf = CFrame.new(W + V(12.5, WATER_Y + 0.25, 46)) * CFrame.Angles(0, math.rad(12), 0)
|
||||
local boat = Instance.new("Model")
|
||||
boat.Name = "Rowboat"
|
||||
boat.Parent = map
|
||||
local hull, inner = Color3.fromRGB(150, 92, 52), Color3.fromRGB(196, 140, 88)
|
||||
P({ Size = V(3.4, 0.4, 8.4), CFrame = cf, Color = inner, Material = PLANKS, Parent = boat })
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P({ Size = V(0.4, 1.7, 8.6), CFrame = cf * CFrame.new(s * 1.95, 0.7, 0.2) * CFrame.Angles(0, 0, math.rad(-s * 14)), Color = hull, Material = WOOD, Parent = boat })
|
||||
P({ Size = V(0.4, 1.7, 3), CFrame = cf * CFrame.new(s * 1.05, 0.8, -5) * CFrame.Angles(0, math.rad(s * 38), 0), Color = hull, Material = WOOD, Parent = boat })
|
||||
P({ Size = V(0.5, 0.3, 8.6), CFrame = cf * CFrame.new(s * 2.2, 1.6, 0.2), Color = COL.logDark, Material = WOOD, Parent = boat })
|
||||
local a = (cf * CFrame.new(s * 1.6, 1.4, 0.2)).Position
|
||||
local b = (cf * CFrame.new(s * 5.2, -0.1, 1.4)).Position
|
||||
rod(a, b, 0.22, { Color = COL.plank, Material = WOOD, CanCollide = false, Parent = boat })
|
||||
P({ Size = V(0.15, 0.9, 1.9), CFrame = CFrame.lookAt(b, b + (b - a)) * CFrame.Angles(0, math.rad(90), 0), Color = COL.plank, Material = WOOD, CanCollide = false, Parent = boat })
|
||||
end
|
||||
P({ Size = V(4.4, 1.7, 0.4), CFrame = cf * CFrame.new(0, 0.7, 4.5), Color = hull, Material = WOOD, Parent = boat })
|
||||
for _, z in ipairs({ -1.6, 1.8 }) do
|
||||
P({ Size = V(3.8, 0.3, 1.1), CFrame = cf * CFrame.new(0, 1.1, z), Color = inner, Material = PLANKS, Parent = boat })
|
||||
end
|
||||
ropePost(9.8, 52, -6, 3.4, 1.4, boat)
|
||||
ropePost(16, 40, -6, 2.8, 1.4, boat)
|
||||
end
|
||||
|
||||
-- за спиной игрока: портал в лобби, место деда-рыбака, доска «Кто водится в озере»
|
||||
do
|
||||
local baseCF = CFrame.lookAt(W + V(15, GROUND_Y, 86), W + V(0, GROUND_Y, 62))
|
||||
local color = Color3.fromRGB(255, 200, 80)
|
||||
local portalModel = Instance.new("Model")
|
||||
portalModel.Name = "PortalToLobby"
|
||||
portalModel.Parent = map
|
||||
local center = baseCF * CFrame.new(0, 10, 0)
|
||||
P({ Size = V(17, 1, 9), CFrame = baseCF * CFrame.new(0, 0.5, 0), Material = Enum.Material.Slate, Color = Color3.fromRGB(95, 100, 115), Parent = portalModel })
|
||||
P({ Size = V(14, 1, 7), CFrame = baseCF * CFrame.new(0, 1.5, 0), Material = Enum.Material.Slate, Color = Color3.fromRGB(110, 115, 130), Parent = portalModel })
|
||||
local R, n = 7, 20
|
||||
for i = 0, n - 1 do
|
||||
local a = (i + 0.5) / n * math.pi * 2
|
||||
P({ Size = V(2 * math.pi * R / n + 0.4, 1.7, 1.7), CFrame = center * CFrame.Angles(0, 0, a) * CFrame.new(0, R, 0), Material = Enum.Material.Slate, Color = Color3.fromRGB(80, 85, 100), Parent = portalModel })
|
||||
if i % 2 == 0 then
|
||||
P({ Size = V(0.6, 0.6, 1.9), CFrame = center * CFrame.Angles(0, 0, a) * CFrame.new(0, R + 0.95, 0), Material = Enum.Material.Neon, Color = color, Parent = portalModel })
|
||||
end
|
||||
end
|
||||
local disc = P({
|
||||
Name = "Portal_Lobby", Shape = Enum.PartType.Cylinder, Size = V(0.3, 2 * R - 1, 2 * R - 1), CFrame = center * CFrame.Angles(0, math.rad(90), 0),
|
||||
Material = Enum.Material.Neon, Color = color, Transparency = 0.3, CanCollide = false, Parent = portalModel,
|
||||
})
|
||||
local pe = Instance.new("ParticleEmitter")
|
||||
pe.Color = ColorSequence.new(color, Color3.new(1, 1, 1))
|
||||
pe.LightEmission = 1
|
||||
pe.Rate = 25
|
||||
pe.Lifetime = NumberRange.new(1, 1.8)
|
||||
pe.Speed = NumberRange.new(0.5, 2)
|
||||
pe.SpreadAngle = Vector2.new(180, 180)
|
||||
pe.Size = NumberSequence.new(0.5, 0)
|
||||
pe.Transparency = NumberSequence.new(0.2, 1)
|
||||
pe.Parent = disc
|
||||
local bb = Instance.new("BillboardGui")
|
||||
bb.Size = UDim2.fromOffset(250, 64)
|
||||
bb.StudsOffset = V(0, 10, 0)
|
||||
bb.MaxDistance = 160
|
||||
bb.LightInfluence = 0
|
||||
bb.Parent = disc
|
||||
local t = Instance.new("TextLabel")
|
||||
t.Size = UDim2.fromScale(1, 1)
|
||||
t.BackgroundTransparency = 1
|
||||
t.Font = Enum.Font.FredokaOne
|
||||
t.TextScaled = true
|
||||
t.TextColor3 = color:Lerp(Color3.new(1, 1, 1), 0.4)
|
||||
t.TextStrokeTransparency = 0.15
|
||||
t.Text = "🏠 В лобби"
|
||||
t.Parent = bb
|
||||
prompt(disc, "Перейти", "🏠 В лобби", "Portal"):SetAttribute("World", "Lobby")
|
||||
end
|
||||
marker("World1NpcGrandpa", CFrame.lookAt(W + V(9, GROUND_Y + 3, 72), W + V(0, GROUND_Y + 3, 62)))
|
||||
do
|
||||
local cf = CFrame.lookAt(W + V(-12, GROUND_Y, 80), W + V(0, GROUND_Y, 62))
|
||||
for _, x in ipairs({ -5.5, 5.5 }) do
|
||||
P({ Size = V(0.8, 10, 0.8), CFrame = cf * CFrame.new(x, 5, 0.3), Material = WOOD, Color = COL.logDark })
|
||||
end
|
||||
P({ Name = "World1Bestiary", Size = V(12, 9, 0.5), CFrame = cf * CFrame.new(0, 6.5, 0), Material = PLANKS, Color = Color3.fromRGB(70, 48, 32) })
|
||||
end
|
||||
|
||||
-------------------------------------------------- дальний берег: дом, холм с тропинкой и вышкой
|
||||
logCabin("BigCabin", CFrame.lookAt(W + V(-58, GROUND_Y, -62), W + V(-20, GROUND_Y, 10)), 16, 12, 8)
|
||||
postLantern(W + V(-44, GROUND_Y, -58), V(1, 0, 0), 8)
|
||||
|
||||
-- столб-вывеска с зелёным знаменем и белой рыбой у начала тропинки
|
||||
do
|
||||
local base = W + V(-17, GROUND_Y, -80)
|
||||
vcyl(base + V(0, 6, 0), 12, 0.9, { Color = COL.logDark, Material = WOOD })
|
||||
rod(base + V(0, 11.4, 0), base + V(3.6, 11.4, 0), 0.5, { Color = COL.logDark, Material = WOOD })
|
||||
local flag = P({ Size = V(3, 5, 0.2), CFrame = CFrame.lookAt(base + V(2.2, 8.6, 0), base + V(2.2, 8.6, 10)), Color = COL.banner, Material = Enum.Material.Fabric, CanCollide = false })
|
||||
surfaceText(flag, Enum.NormalId.Front, "🐟", Color3.new(1, 1, 1))
|
||||
surfaceText(flag, Enum.NormalId.Back, "🐟", Color3.new(1, 1, 1))
|
||||
end
|
||||
|
||||
-- забор вдоль тропинки и фонари
|
||||
do
|
||||
local posts = {}
|
||||
for i = 2, #HILL_PATH do
|
||||
local a, b = HILL_PATH[i - 1], HILL_PATH[i]
|
||||
local dx, dz = b[1] - a[1], b[2] - a[2]
|
||||
local len = math.sqrt(dx * dx + dz * dz)
|
||||
local nx, nz = -dz / len, dx / len -- влево от направления
|
||||
for s = 0, len - 0.1, 4.5 do
|
||||
local x, z = a[1] + dx * s / len + nx * 3, a[2] + dz * s / len + nz * 3
|
||||
table.insert(posts, W + V(x, hillY(x, z), z))
|
||||
end
|
||||
end
|
||||
for i, p in ipairs(posts) do
|
||||
vcyl(p + V(0, 1.3, 0), 3, 0.45, { Color = COL.log, Material = WOOD })
|
||||
local q = posts[i + 1]
|
||||
if q and (q - p).Magnitude < 8 then
|
||||
for _, h in ipairs({ 1.2, 2.3 }) do
|
||||
rod(p + V(0, h, 0), q + V(0, h, 0), 0.3, { Color = COL.log, Material = WOOD, CanCollide = false })
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, i in ipairs({ 2, 4 }) do
|
||||
local x, z = HILL_PATH[i][1] + 3, HILL_PATH[i][2]
|
||||
postLantern(W + V(x, hillY(x, z), z), V(-1, 0, 0), 7)
|
||||
end
|
||||
end
|
||||
|
||||
-- смотровая вышка на вершине холма с зелёным флагом
|
||||
do
|
||||
local tower = Instance.new("Model")
|
||||
tower.Name = "Watchtower"
|
||||
tower.Parent = map
|
||||
local c = W + V(-76, hillY(-76, -136) - 0.5, -136)
|
||||
local H = 14
|
||||
local function wood(props)
|
||||
props.Parent = tower
|
||||
return props
|
||||
end
|
||||
for _, sx in ipairs({ -1, 1 }) do
|
||||
for _, sz in ipairs({ -1, 1 }) do
|
||||
rod(c + V(sx * 4.2, 0, sz * 4.2), c + V(sx * 3.2, H, sz * 3.2), 1.1, wood({ Color = COL.log, Material = WOOD }))
|
||||
end
|
||||
end
|
||||
for _, y in ipairs({ 4.5, 9 }) do
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
local k = 4.2 - y / H
|
||||
rod(c + V(-k, y, s * k), c + V(k, y - 3, s * k), 0.4, wood({ Color = COL.logDark, Material = WOOD, CanCollide = false }))
|
||||
rod(c + V(s * k, y, -k), c + V(s * k, y - 3, k), 0.4, wood({ Color = COL.logDark, Material = WOOD, CanCollide = false }))
|
||||
end
|
||||
end
|
||||
P(wood({ Size = V(9, 0.6, 9), Position = c + V(0, H, 0), Color = COL.plank, Material = PLANKS }))
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P(wood({ Size = V(9, 1.4, 0.3), Position = c + V(0, H + 1.2, s * 4.4), Color = COL.log, Material = WOOD }))
|
||||
P(wood({ Size = V(0.3, 1.4, 9), Position = c + V(s * 4.4, H + 1.2, 0), Color = COL.log, Material = WOOD }))
|
||||
end
|
||||
for _, sx in ipairs({ -1, 1 }) do
|
||||
for _, sz in ipairs({ -1, 1 }) do
|
||||
vcyl(c + V(sx * 4.2, H + 2.6, sz * 4.2), 5.2, 0.4, wood({ Color = COL.log, Material = WOOD }))
|
||||
end
|
||||
end
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
P(wood({ Size = V(11, 0.5, 6.4), CFrame = CFrame.new(c + V(0, H + 6.2, s * 2.7)) * CFrame.Angles(s * math.rad(30), 0, 0), Color = COL.roof, Material = SMOOTH }))
|
||||
end
|
||||
vcyl(c + V(0, H + 10.5, 0), 7, 0.25, wood({ Color = COL.logDark, Material = WOOD }))
|
||||
local flag = P(wood({ Size = V(4, 2.6, 0.15), CFrame = CFrame.new(c + V(2.1, H + 12.6, 0)), Color = COL.banner, Material = Enum.Material.Fabric, CanCollide = false }))
|
||||
surfaceText(flag, Enum.NormalId.Front, "🐟", Color3.new(1, 1, 1))
|
||||
surfaceText(flag, Enum.NormalId.Back, "🐟", Color3.new(1, 1, 1))
|
||||
end
|
||||
|
||||
-------------------------------------------------- северо-восток: домик с мостками, скала, водопад, мост
|
||||
logCabin("SmallCabin", CFrame.lookAt(W + V(8, GROUND_Y, -96), W + V(4, GROUND_Y, 0)), 11, 9, 7)
|
||||
smallDock(8, -86, -68, 6, GROUND_Y + 0.4)
|
||||
postLantern(W + V(10.6, GROUND_Y + 0.4, -70), V(-1, 0, 0), 6)
|
||||
|
||||
local CLIFF_FRONT = -66 -- передняя кромка скалы по Z
|
||||
local RIVER_X, RIVER_W, LIP_Y = 48, 10, 35 -- русло реки над водопадом и высота уступа
|
||||
local cliff = Instance.new("Model")
|
||||
cliff.Name = "Cliff"
|
||||
cliff.Parent = map
|
||||
do
|
||||
-- скала уступами: три ряда блоков всё выше к заднему плану; у русла — вровень с уступом водопада
|
||||
local rows = { { CLIFF_FRONT, 14, 22 }, { CLIFF_FRONT - 18, 26, 34 }, { CLIFF_FRONT - 40, 38, 50 } } -- { кромка, мин. высота, макс. высота }
|
||||
for ri, row in ipairs(rows) do
|
||||
local x = 28
|
||||
while x < 116 do
|
||||
local w = rng:NextNumber(11, 16)
|
||||
local cx = x + w / 2
|
||||
if math.abs(cx - RIVER_X) > RIVER_W / 2 + w / 2 - 1 then
|
||||
local h = rng:NextNumber(row[2], row[3])
|
||||
if ri <= 2 and math.abs(cx - RIVER_X) < 16 then
|
||||
h = LIP_Y + rng:NextNumber(-0.5, 1.5) -- берега реки вровень с уступом: на них стоит мост
|
||||
end
|
||||
local d = rng:NextNumber(18, 24)
|
||||
local cf = CFrame.new(W + V(cx, h / 2, row[1] - d / 2)) * CFrame.Angles(rng:NextNumber(-0.06, 0.06), rng:NextNumber(-0.25, 0.25), rng:NextNumber(-0.06, 0.06))
|
||||
P({ Size = V(w, h, d), CFrame = cf, Color = COL.rock:Lerp(COL.rockDark, rng:NextNumber(0, 0.5)), Material = SMOOTH, Parent = cliff })
|
||||
P({ Size = V(w - 1, 1.2, d - 1), CFrame = cf * CFrame.new(0, h / 2 + 0.3, 0), Color = COL.moss:Lerp(COL.leaf, rng:NextNumber(0, 0.5)), Material = SMOOTH, Parent = cliff })
|
||||
-- острые обломки на кромке и на гранях — чтобы скала не выглядела ровной стеной
|
||||
for _ = 1, 2 do
|
||||
local s = rng:NextNumber(5, 9)
|
||||
local cr = crag((cf * CFrame.new(rng:NextNumber(-w / 2, w / 2), rng:NextNumber(-h / 2, h / 2 - 2), -d / 2 + s * 0.2)).Position, s)
|
||||
cr.Parent = cliff
|
||||
end
|
||||
if rng:NextNumber() < 0.7 then
|
||||
pine((cf * CFrame.new(rng:NextNumber(-w / 4, w / 4), h / 2 + 0.8, rng:NextNumber(-d / 4, d / 4))).Position, rng:NextNumber(12, 20), 3)
|
||||
end
|
||||
end
|
||||
x += w - 0.5
|
||||
end
|
||||
end
|
||||
for x = 30, 112, 9 do
|
||||
local cr = crag(W + V(x + rng:NextNumber(-3, 3), 2, CLIFF_FRONT + rng:NextNumber(0, 3)), rng:NextNumber(6, 11))
|
||||
cr.Parent = cliff
|
||||
end
|
||||
-- ложе реки и стена за водопадом, река наверху
|
||||
P({ Size = V(RIVER_W + 4, LIP_Y, 70), Position = W + V(RIVER_X, LIP_Y / 2, CLIFF_FRONT - 35), Color = COL.rockDark, Material = SMOOTH, Parent = cliff })
|
||||
P({ Size = V(RIVER_W, 0.8, 70), Position = W + V(RIVER_X, LIP_Y + 0.4, CLIFF_FRONT - 35), Color = COL.water, Material = Enum.Material.Glass, Transparency = 0.15, CanCollide = false, Parent = cliff })
|
||||
for z = CLIFF_FRONT - 4, CLIFF_FRONT - 66, -7 do
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
rock(W + V(RIVER_X + s * (RIVER_W / 2 + 0.5), LIP_Y + 1, z + rng:NextNumber(-2, 2)), rng:NextNumber(2.5, 4.5)).Parent = cliff
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- водопад: полупрозрачная «простыня», бегущие вниз струи (Beam с текстурой), пена и туман внизу
|
||||
do
|
||||
local fall = Instance.new("Model")
|
||||
fall.Name = "Waterfall"
|
||||
fall.Parent = map
|
||||
local zf = CLIFF_FRONT - 1.2
|
||||
local sheet = P({
|
||||
Size = V(RIVER_W - 1, LIP_Y + 0.8, 1), Position = W + V(RIVER_X, LIP_Y / 2, zf),
|
||||
Color = Color3.fromRGB(170, 236, 240), Material = Enum.Material.Glass, Transparency = 0.25, CanCollide = false, CastShadow = false, Parent = fall,
|
||||
})
|
||||
for i = 0, 4 do
|
||||
local x = -RIVER_W / 2 + 1.5 + i * (RIVER_W - 3) / 4
|
||||
local a0 = Instance.new("Attachment")
|
||||
a0.Position = V(x, LIP_Y / 2, -0.6)
|
||||
a0.Parent = sheet
|
||||
local a1 = Instance.new("Attachment")
|
||||
a1.Position = V(x + rng:NextNumber(-0.5, 0.5), -LIP_Y / 2, -0.6)
|
||||
a1.Parent = sheet
|
||||
local b = Instance.new("Beam")
|
||||
b.Attachment0, b.Attachment1 = a0, a1
|
||||
b.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||
b.TextureMode = Enum.TextureMode.Wrap
|
||||
b.TextureLength = 5
|
||||
b.TextureSpeed = rng:NextNumber(1.6, 2.4)
|
||||
b.Width0, b.Width1 = 2.6, 3.2
|
||||
b.FaceCamera = true
|
||||
b.LightEmission = 0.35
|
||||
b.Color = ColorSequence.new(Color3.new(1, 1, 1))
|
||||
b.Transparency = NumberSequence.new(0.25)
|
||||
b.Parent = sheet
|
||||
end
|
||||
for _ = 1, 9 do
|
||||
vcyl(W + V(RIVER_X + rng:NextNumber(-6, 6), WATER_Y + 0.2, zf + rng:NextNumber(0.5, 6)), 0.5, rng:NextNumber(3, 6), {
|
||||
Color = Color3.fromRGB(240, 252, 252), Material = SMOOTH, Transparency = 0.15, CanCollide = false, CastShadow = false, Parent = fall,
|
||||
})
|
||||
end
|
||||
local function mistAt(pos, size, rate, s0, s1)
|
||||
local holder = P({ Size = size, Position = pos, Transparency = 1, CanCollide = false, CanQuery = false, Parent = fall })
|
||||
local mist = Instance.new("ParticleEmitter")
|
||||
mist.Texture = "rbxasset://textures/particles/smoke_main.dds"
|
||||
mist.Color = ColorSequence.new(Color3.new(1, 1, 1))
|
||||
mist.Size = NumberSequence.new({ NumberSequenceKeypoint.new(0, s0), NumberSequenceKeypoint.new(1, s1) })
|
||||
mist.Transparency = NumberSequence.new({ NumberSequenceKeypoint.new(0, 0.45), NumberSequenceKeypoint.new(1, 1) })
|
||||
mist.Lifetime = NumberRange.new(2, 3.5)
|
||||
mist.Rate = rate
|
||||
mist.Speed = NumberRange.new(2, 5)
|
||||
mist.SpreadAngle = Vector2.new(70, 70)
|
||||
mist.Parent = holder
|
||||
end
|
||||
mistAt(W + V(RIVER_X, WATER_Y + 1, zf + 2), V(RIVER_W, 1, 2), 14, 4, 11)
|
||||
mistAt(W + V(RIVER_X, LIP_Y, zf), V(RIVER_W, 1, 1), 5, 2, 5)
|
||||
end
|
||||
|
||||
-- арочный деревянный мост через реку над водопадом
|
||||
do
|
||||
local bridge = Instance.new("Model")
|
||||
bridge.Name = "Bridge"
|
||||
bridge.Parent = map
|
||||
local z, x0, x1, y0, rise = CLIFF_FRONT - 22, RIVER_X - 11, RIVER_X + 11, LIP_Y + 1, 3.2
|
||||
local N = 12
|
||||
local function arc(t)
|
||||
return W + V(x0 + (x1 - x0) * t, y0 + math.sin(t * math.pi) * rise, z)
|
||||
end
|
||||
for i = 0, N - 1 do
|
||||
local a, b = arc(i / N), arc((i + 1) / N)
|
||||
P({ Size = V((b - a).Magnitude + 0.1, 0.5, 5), CFrame = CFrame.lookAt((a + b) / 2, b) * CFrame.Angles(0, math.rad(90), 0), Color = COL.plank:Lerp(COL.plankDark, (i % 2) * 0.4), Material = PLANKS, Parent = bridge })
|
||||
end
|
||||
for _, s in ipairs({ -1, 1 }) do
|
||||
local prev
|
||||
for i = 0, N, 2 do
|
||||
local p = arc(i / N) + V(0, 0, s * 2.3)
|
||||
vcyl(p + V(0, 1.4, 0), 2.8, 0.4, { Color = COL.log, Material = WOOD, Parent = bridge })
|
||||
if prev then
|
||||
rod(prev + V(0, 2.6, 0), p + V(0, 2.6, 0), 0.32, { Color = COL.log, Material = WOOD, Parent = bridge })
|
||||
end
|
||||
prev = p
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------- у воды: камни, рогоз, кувшинки
|
||||
local function nearDock(x, z)
|
||||
return math.abs(x) < 9 and z > 28 and z < 70
|
||||
end
|
||||
local function inCliff(x, z)
|
||||
return x > 24 and x < 118 and z < -58 and z > -150
|
||||
end
|
||||
for _, l in ipairs(LAKES) do
|
||||
for _ = 1, 9 do
|
||||
local a = rng:NextNumber(0, math.pi * 2)
|
||||
local r = l[3] + rng:NextNumber(-1, 2.5)
|
||||
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||
if not inLake(x, z, -4) and not nearDock(x, z) and not inCliff(x, z) then
|
||||
rock(W + V(x, rng:NextNumber(0.5, 2.5), z), rng:NextNumber(2.5, 5.5))
|
||||
end
|
||||
end
|
||||
for _ = 1, 5 do
|
||||
local a = rng:NextNumber(0, math.pi * 2)
|
||||
local r = l[3] + rng:NextNumber(-1.5, 0.5)
|
||||
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||
if not inLake(x, z, -3) and not nearDock(x, z) and not inCliff(x, z) then
|
||||
cattails(W + V(x, WATER_Y - 0.5, z))
|
||||
end
|
||||
end
|
||||
end
|
||||
for _, p in ipairs({ { 11, 55 }, { 15, 52 }, { -9, 53 }, { 20, 47 } }) do -- рогоз в правом нижнем углу кадра
|
||||
cattails(W + V(p[1], WATER_Y - 0.5, p[2]))
|
||||
end
|
||||
for _ = 1, 14 do -- кувшинки группами
|
||||
local l = LAKES[rng:NextInteger(1, #LAKES)]
|
||||
local a = rng:NextNumber(0, math.pi * 2)
|
||||
local r = l[3] * rng:NextNumber(0.5, 0.88)
|
||||
local cx, cz = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||
for _ = 1, rng:NextInteger(2, 5) do
|
||||
local x, z = cx + rng:NextNumber(-3, 3), cz + rng:NextNumber(-3, 3)
|
||||
if inLake(x, z, -2) and not nearDock(x, z) and not (x > 6 and x < 20 and z > 36 and z < 56) then
|
||||
local size = rng:NextNumber(2, 3.4)
|
||||
P({ Shape = Enum.PartType.Cylinder, Size = V(0.15, size, size), CFrame = CFrame.new(W + V(x, WATER_Y + 0.12, z)) * CFrame.Angles(0, 0, math.rad(90)), Color = Color3.fromRGB(78, 168, 70):Lerp(Color3.fromRGB(110, 190, 80), rng:NextNumber()), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||
if rng:NextNumber() < 0.35 then
|
||||
ball(W + V(x + 0.3, WATER_Y + 0.45, z), 0.8, { Color = Color3.fromRGB(255, 150, 195), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||
ball(W + V(x + 0.3, WATER_Y + 0.75, z), 0.4, { Color = Color3.fromRGB(255, 235, 120), Material = SMOOTH, CanCollide = false, CastShadow = false })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------- лес, кусты, цветы
|
||||
local function nearPath(x, z, dist)
|
||||
for i = 2, #HILL_PATH do
|
||||
local a, b = HILL_PATH[i - 1], HILL_PATH[i]
|
||||
local abx, abz = b[1] - a[1], b[2] - a[2]
|
||||
local t = math.clamp(((x - a[1]) * abx + (z - a[2]) * abz) / (abx * abx + abz * abz), 0, 1)
|
||||
if (x - a[1] - abx * t) ^ 2 + (z - a[2] - abz * t) ^ 2 < dist * dist then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
local function freeSpot(x, z)
|
||||
if math.abs(x) > 236 or math.abs(z) > 236 or inLake(x, z, 6) or inCliff(x, z) or nearPath(x, z, 6) then
|
||||
return false
|
||||
end
|
||||
if x > -32 and x < 30 and z > 44 and z < 100 then -- прибытие, лавка, портал
|
||||
return false
|
||||
end
|
||||
for _, c in ipairs({ { -58, -62, 16 }, { 8, -96, 13 }, { -76, -136, 11 }, { -17, -80, 5 } }) do
|
||||
if (x - c[1]) ^ 2 + (z - c[2]) ^ 2 < c[3] * c[3] then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return not (x > 2 and x < 14 and z > -100 and z < -64) -- мостки у домика
|
||||
end
|
||||
|
||||
local placed = 0
|
||||
for _ = 1, 700 do
|
||||
if placed >= 210 then
|
||||
break
|
||||
end
|
||||
local x, z = rng:NextNumber(-236, 236), rng:NextNumber(-236, 236)
|
||||
-- за озером лес гуще, перед ним (за спиной игрока) реже
|
||||
if (z < 0 or rng:NextNumber() < 0.45) and freeSpot(x, z) then
|
||||
local far = math.max(math.abs(x), math.abs(z)) > 150
|
||||
pine(W + V(x, hillY(x, z) - 0.3, z), far and rng:NextNumber(22, 32) or rng:NextNumber(15, 25), far and 2 or 3)
|
||||
placed += 1
|
||||
end
|
||||
end
|
||||
for _ = 1, 25 do -- лиственные деревья у берегов
|
||||
local l = LAKES[rng:NextInteger(1, #LAKES)]
|
||||
local a = rng:NextNumber(0, math.pi * 2)
|
||||
local r = l[3] + rng:NextNumber(8, 18)
|
||||
local x, z = l[1] + math.cos(a) * r, l[2] + math.sin(a) * r
|
||||
if freeSpot(x, z) then
|
||||
leafy(W + V(x, hillY(x, z) - 0.3, z), rng:NextNumber(8, 12))
|
||||
end
|
||||
end
|
||||
for _ = 1, 50 do -- кусты
|
||||
local x, z = rng:NextNumber(-150, 150), rng:NextNumber(-150, 120)
|
||||
if freeSpot(x, z) then
|
||||
local y = hillY(x, z)
|
||||
local c = COL.leafDark:Lerp(COL.leaf, rng:NextNumber())
|
||||
for _ = 1, 3 do
|
||||
ball(W + V(x + rng:NextNumber(-1.5, 1.5), y + 0.8, z + rng:NextNumber(-1.5, 1.5)), rng:NextNumber(2.5, 4), { Color = c, Material = SMOOTH, CanCollide = false })
|
||||
end
|
||||
end
|
||||
end
|
||||
for _ = 1, 80 do -- цветы
|
||||
local x, z = rng:NextNumber(-120, 120), rng:NextNumber(-140, 110)
|
||||
if freeSpot(x, z) or nearPath(x, z, 6) and not nearPath(x, z, 3) then
|
||||
ball(W + V(x, hillY(x, z) + 0.4, z), 0.6, {
|
||||
Color = ({ Color3.fromRGB(255, 120, 150), Color3.fromRGB(255, 230, 90), Color3.fromRGB(245, 245, 255), Color3.fromRGB(190, 140, 255) })[rng:NextInteger(1, 4)],
|
||||
Material = SMOOTH, CanCollide = false, CastShadow = false,
|
||||
})
|
||||
end
|
||||
end
|
||||
-- отдельные детали (деревья, камни, кусты, фонари) — в папку Decor, чтобы в Explorer было видно
|
||||
-- главное: модели и маркеры World1*/Guide*
|
||||
local decor = Instance.new("Folder")
|
||||
decor.Name = "Decor"
|
||||
decor.Parent = map
|
||||
for _, c in ipairs(map:GetChildren()) do
|
||||
if c:IsA("BasePart") and not c.Name:match("^World1") and not c.Name:match("^Guide") then
|
||||
c.Parent = decor
|
||||
end
|
||||
end
|
||||
|
||||
-------------------------------------------------- горизонт: горы и облака
|
||||
do
|
||||
local horizon = Instance.new("Folder")
|
||||
horizon.Name = "Horizon"
|
||||
horizon.Parent = map
|
||||
-- гора — несколько острых пиков (кубы вершиной вверх) разного размера
|
||||
local function mountain(a, dist, s)
|
||||
local base = W + V(math.cos(a) * dist, 0, math.sin(a) * dist)
|
||||
for k = 1, 3 do
|
||||
local ss = k == 1 and s or s * rng:NextNumber(0.45, 0.7)
|
||||
local off = k == 1 and V(0, 0, 0) or V(rng:NextNumber(-0.7, 0.7) * s, 0, rng:NextNumber(-0.4, 0.4) * s)
|
||||
local apex = ss * rng:NextNumber(0.55, 0.75) -- высота пика над землёй
|
||||
P({
|
||||
Size = V(ss, ss, ss),
|
||||
CFrame = CFrame.new(base + off + V(0, apex - ss * 0.866, 0)) * CFrame.Angles(rng:NextNumber(-0.1, 0.1), rng:NextNumber(0, 6.28), rng:NextNumber(-0.1, 0.1)) * CUBE_UP,
|
||||
Color = Color3.fromRGB(152, 166, 190):Lerp(Color3.fromRGB(118, 134, 164), rng:NextNumber()), Material = SMOOTH,
|
||||
CanCollide = false, CanQuery = false, CastShadow = false, Parent = horizon,
|
||||
})
|
||||
end
|
||||
end
|
||||
for i = 0, 13 do -- север (за озером) — крупнее и плотнее
|
||||
mountain(math.rad(-160 + i * 10 + rng:NextNumber(-4, 4)), rng:NextNumber(340, 470), rng:NextNumber(130, 220))
|
||||
end
|
||||
for i = 0, 9 do -- остальные стороны
|
||||
mountain(math.rad(20 + i * 16 + rng:NextNumber(-5, 5)), rng:NextNumber(360, 480), rng:NextNumber(100, 160))
|
||||
end
|
||||
for _ = 1, 9 do
|
||||
local c = W + V(rng:NextNumber(-380, 380), rng:NextNumber(170, 230), rng:NextNumber(-420, 200))
|
||||
for _ = 1, rng:NextInteger(4, 6) do
|
||||
ball(c + V(rng:NextNumber(-30, 30), rng:NextNumber(-5, 8), rng:NextNumber(-12, 12)), rng:NextNumber(22, 42), {
|
||||
Color = Color3.new(1, 1, 1), Material = SMOOTH, CanCollide = false, CanQuery = false, CastShadow = false, Parent = horizon,
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- невидимые стены по краю мира
|
||||
for _, w in ipairs({
|
||||
{ V(0, 0, 245), V(500, 120, 2) },
|
||||
{ V(0, 0, -245), V(500, 120, 2) },
|
||||
{ V(245, 0, 0), V(2, 120, 500) },
|
||||
{ V(-245, 0, 0), V(2, 120, 500) },
|
||||
}) do
|
||||
P({ Name = "WorldWall", Size = w[2], Position = W + w[1] + V(0, 50, 0), Transparency = 1, CanQuery = false })
|
||||
end
|
||||
|
||||
map.Parent = parent
|
||||
return map
|
||||
end
|
||||
|
||||
-- сборка в Studio: стирает старую папку и террейн мира, строит заново прямо в Workspace
|
||||
function Builder.bake()
|
||||
local old = Workspace:FindFirstChild("World1Map")
|
||||
if old then
|
||||
old:Destroy()
|
||||
end
|
||||
terrain:FillBlock(CFrame.new(W + V(0, 30, 0)), V(504, 120, 504), Enum.Material.Air)
|
||||
local map = Builder.build(Workspace)
|
||||
print(("✅ «Тихое озеро» собрано: Workspace.World1Map, деталей: %d. Сохраните плейс (Ctrl+S)."):format(#map:GetDescendants()))
|
||||
return map
|
||||
end
|
||||
|
||||
return Builder
|
||||
]]></ProtectedString></Properties></Item>
|
||||
</roblox>
|
||||
+1125
-288
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user