Fishing RBLXL
This commit is contained in:
1 parent
83cd5355b8
commit
f316a9bf0c
8 files changed
+81
-43
No files matched your search
@@ -13,12 +13,17 @@ default.project.json проект Rojo
|
|||||||
|
|
||||||
С Rojo: `rojo serve` и подключиться плагином Rojo в Studio.
|
С Rojo: `rojo serve` и подключиться плагином Rojo в Studio.
|
||||||
|
|
||||||
## Установка без Rojo
|
## Самый простой способ: готовый плейс
|
||||||
|
|
||||||
|
Откройте `Fishing.rbxlx` в Roblox Studio (**File → Open from File…** или двойной клик) и нажмите **Play** (F5).
|
||||||
|
Файл собирается из `src/` командой `powershell -ExecutionPolicy Bypass -File build.ps1` (в git он не попадает — см. `.gitignore`).
|
||||||
|
|
||||||
|
## Установка в свой плейс без Rojo
|
||||||
|
|
||||||
1. Откройте плейс в Roblox Studio (например, шаблон **Baseplate**).
|
1. Откройте плейс в Roblox Studio (например, шаблон **Baseplate**).
|
||||||
2. Откройте `install/INSTALL.lua` Блокнотом → **Ctrl+A** → **Ctrl+C**.
|
2. Откройте `install/INSTALL.lua` Блокнотом → **Ctrl+A** → **Ctrl+C**.
|
||||||
3. Вставьте код в **Command Bar** (строка внизу Studio) → **Ctrl+Enter**.
|
3. Вставьте код в **Command Bar** (строка внизу Studio) → **Ctrl+Enter**.
|
||||||
4. В **Output** появится «ГОТОВО!». Нажмите **Play** (F5).
|
4. В **Output** появится «DONE!». Нажмите **Play** (F5).
|
||||||
|
|
||||||
Запасной способ: правой кнопкой по папке в Explorer → **Insert from File…** → файлы из `install/` (в названии файла указано, в какую папку его вставлять).
|
Запасной способ: правой кнопкой по папке в Explorer → **Insert from File…** → файлы из `install/` (в названии файла указано, в какую папку его вставлять).
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
# Builds Fishing.rbxlx (place file for Roblox Studio) and install/* from src/.
|
||||||
|
# Run: powershell -ExecutionPolicy Bypass -File build.ps1
|
||||||
|
|
||||||
|
$root = $PSScriptRoot
|
||||||
|
$enc = New-Object System.Text.UTF8Encoding($false)
|
||||||
|
|
||||||
|
$scripts = @(
|
||||||
|
@{ Name = 'FishConfig'; Class = 'ModuleScript'; Service = 'ReplicatedStorage'; Path = 'src\ReplicatedStorage\FishConfig.lua'; Rbxmx = '1_FishConfig_ReplicatedStorage.rbxmx' },
|
||||||
|
@{ Name = 'GameModels'; Class = 'ModuleScript'; Service = 'ReplicatedStorage'; Path = 'src\ReplicatedStorage\GameModels.lua'; Rbxmx = '2_GameModels_ReplicatedStorage.rbxmx' },
|
||||||
|
@{ Name = 'MapBuilder'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\MapBuilder.server.lua'; Rbxmx = '3_MapBuilder_ServerScriptService.rbxmx' },
|
||||||
|
@{ Name = 'GameServer'; Class = 'Script'; Service = 'ServerScriptService'; Path = 'src\ServerScriptService\GameServer.server.lua'; Rbxmx = '4_GameServer_ServerScriptService.rbxmx' },
|
||||||
|
@{ Name = 'FishingClient'; Class = 'LocalScript'; Service = 'StarterPlayerScripts'; Path = 'src\StarterPlayer\StarterPlayerScripts\FishingClient.client.lua'; Rbxmx = '5_FishingClient_StarterPlayerScripts.rbxmx' }
|
||||||
|
)
|
||||||
|
|
||||||
|
$header = '<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">'
|
||||||
|
$script:ref = 0
|
||||||
|
function NextRef { $script:ref++; return "RBX$($script:ref)" }
|
||||||
|
|
||||||
|
function ScriptItem($s) {
|
||||||
|
$src = [System.IO.File]::ReadAllText((Join-Path $root $s.Path), $enc)
|
||||||
|
if ($src.Contains(']]>')) { throw "CDATA conflict in $($s.Path)" }
|
||||||
|
return "<Item class=`"$($s.Class)`" referent=`"$(NextRef)`"><Properties><string name=`"Name`">$($s.Name)</string><ProtectedString name=`"Source`"><![CDATA[$src]]></ProtectedString></Properties></Item>`n"
|
||||||
|
}
|
||||||
|
|
||||||
|
function ServiceItem($class, $children) {
|
||||||
|
return "<Item class=`"$class`" referent=`"$(NextRef)`"><Properties><string name=`"Name`">$class</string></Properties>`n$children</Item>`n"
|
||||||
|
}
|
||||||
|
|
||||||
|
# --- place file ---
|
||||||
|
$rs = ($scripts | Where-Object { $_.Service -eq 'ReplicatedStorage' } | ForEach-Object { ScriptItem $_ }) -join ''
|
||||||
|
$sss = ($scripts | Where-Object { $_.Service -eq 'ServerScriptService' } | ForEach-Object { ScriptItem $_ }) -join ''
|
||||||
|
$sps = ($scripts | Where-Object { $_.Service -eq 'StarterPlayerScripts' } | ForEach-Object { ScriptItem $_ }) -join ''
|
||||||
|
|
||||||
|
$place = $header + "`n" +
|
||||||
|
(ServiceItem 'ReplicatedStorage' $rs) +
|
||||||
|
(ServiceItem 'ServerScriptService' $sss) +
|
||||||
|
(ServiceItem 'StarterPlayer' (ServiceItem 'StarterPlayerScripts' $sps)) +
|
||||||
|
"</roblox>`n"
|
||||||
|
[System.IO.File]::WriteAllText((Join-Path $root 'Fishing.rbxlx'), $place, $enc)
|
||||||
|
|
||||||
|
# --- install/*.rbxmx and install/INSTALL.lua ---
|
||||||
|
$installDir = Join-Path $root 'install'
|
||||||
|
New-Item -ItemType Directory -Force $installDir | Out-Null
|
||||||
|
$parents = @{ ReplicatedStorage = 'game.ReplicatedStorage'; ServerScriptService = 'game.ServerScriptService'; StarterPlayerScripts = 'game.StarterPlayer.StarterPlayerScripts' }
|
||||||
|
$sb = New-Object System.Text.StringBuilder
|
||||||
|
[void]$sb.Append("local function make(class, name, parent, src)`n local old = parent:FindFirstChild(name)`n if old then old:Destroy() end`n local s = Instance.new(class)`n s.Name = name`n s.Source = src`n s.Parent = parent`nend`nlocal oldMap = workspace:FindFirstChild('FishingMap')`nif oldMap then oldMap:Destroy() end`n")
|
||||||
|
foreach ($s in $scripts) {
|
||||||
|
$src = [System.IO.File]::ReadAllText((Join-Path $root $s.Path), $enc)
|
||||||
|
if ($src.Contains(']=====]')) { throw "Long-string conflict in $($s.Path)" }
|
||||||
|
[void]$sb.Append("make('$($s.Class)', '$($s.Name)', $($parents[$s.Service]), [=====[" + $src + "]=====])`n")
|
||||||
|
$script:ref = 0
|
||||||
|
$xml = $header + "`n" + (ScriptItem $s) + "</roblox>`n"
|
||||||
|
[System.IO.File]::WriteAllText((Join-Path $installDir $s.Rbxmx), $xml, $enc)
|
||||||
|
}
|
||||||
|
[void]$sb.Append("print('DONE! 5 scripts installed. Press Play (F5).')`n")
|
||||||
|
[System.IO.File]::WriteAllText((Join-Path $installDir 'INSTALL.lua'), $sb.ToString(), $enc)
|
||||||
|
|
||||||
|
Write-Host "Built Fishing.rbxlx and install/"
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
<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">
|
<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="RBX0">
|
<Item class="ModuleScript" referent="RBX1"><Properties><string name="Name">FishConfig</string><ProtectedString name="Source"><![CDATA[-- FishConfig (ModuleScript) -> ReplicatedStorage
|
||||||
<Properties>
|
|
||||||
<string name="Name">FishConfig</string>
|
|
||||||
<ProtectedString name="Source"><![CDATA[-- FishConfig (ModuleScript) -> ReplicatedStorage
|
|
||||||
-- Все настройки игры. Меняй цифры здесь, чтобы настроить баланс.
|
-- Все настройки игры. Меняй цифры здесь, чтобы настроить баланс.
|
||||||
|
|
||||||
local Config = {}
|
local Config = {}
|
||||||
@@ -307,7 +304,5 @@ function Config.RodStats(rodId, upgradeLevel)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return Config
|
return Config
|
||||||
]]></ProtectedString>
|
]]></ProtectedString></Properties></Item>
|
||||||
</Properties>
|
</roblox>
|
||||||
</Item>
|
|
||||||
</roblox>
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
<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">
|
<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="RBX0">
|
<Item class="ModuleScript" referent="RBX1"><Properties><string name="Name">GameModels</string><ProtectedString name="Source"><![CDATA[-- GameModels (ModuleScript) -> ReplicatedStorage
|
||||||
<Properties>
|
|
||||||
<string name="Name">GameModels</string>
|
|
||||||
<ProtectedString name="Source"><![CDATA[-- GameModels (ModuleScript) -> ReplicatedStorage
|
|
||||||
-- Строит 3D-модели из деталей: удочки, сумки, рыбу, поплавок.
|
-- Строит 3D-модели из деталей: удочки, сумки, рыбу, поплавок.
|
||||||
-- Используется сервером (инструмент, витрины, рыба в руках) и клиентом (иконки).
|
-- Используется сервером (инструмент, витрины, рыба в руках) и клиентом (иконки).
|
||||||
|
|
||||||
@@ -561,7 +558,5 @@ function M.buildBobber()
|
|||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
]]></ProtectedString>
|
]]></ProtectedString></Properties></Item>
|
||||||
</Properties>
|
</roblox>
|
||||||
</Item>
|
|
||||||
</roblox>
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
<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">
|
<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="Script" referent="RBX0">
|
<Item class="Script" referent="RBX1"><Properties><string name="Name">MapBuilder</string><ProtectedString name="Source"><![CDATA[-- MapBuilder (Script) -> ServerScriptService
|
||||||
<Properties>
|
|
||||||
<string name="Name">MapBuilder</string>
|
|
||||||
<ProtectedString name="Source"><![CDATA[-- MapBuilder (Script) -> ServerScriptService
|
|
||||||
-- Строит лобби и Мир 1 «Тихое озеро» при запуске игры, настраивает свет и воду.
|
-- Строит лобби и Мир 1 «Тихое озеро» при запуске игры, настраивает свет и воду.
|
||||||
-- Если в Workspace уже есть папка "FishingMap", детали не строятся заново
|
-- Если в Workspace уже есть папка "FishingMap", детали не строятся заново
|
||||||
-- (террейн, свет и точка появления настраиваются всегда).
|
-- (террейн, свет и точка появления настраиваются всегда).
|
||||||
@@ -1407,7 +1404,5 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
]]></ProtectedString>
|
]]></ProtectedString></Properties></Item>
|
||||||
</Properties>
|
</roblox>
|
||||||
</Item>
|
|
||||||
</roblox>
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
<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">
|
<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="Script" referent="RBX0">
|
<Item class="Script" referent="RBX1"><Properties><string name="Name">GameServer</string><ProtectedString name="Source"><![CDATA[-- GameServer (Script) -> ServerScriptService
|
||||||
<Properties>
|
|
||||||
<string name="Name">GameServer</string>
|
|
||||||
<ProtectedString name="Source"><![CDATA[-- GameServer (Script) -> ServerScriptService
|
|
||||||
-- Логика игры: данные, удача, рыбалка с анимацией, сумка, магазин, улучшения,
|
-- Логика игры: данные, удача, рыбалка с анимацией, сумка, магазин, улучшения,
|
||||||
-- коллекция с наградами, задания, ежедневная награда, события, миры, донат.
|
-- коллекция с наградами, задания, ежедневная награда, события, миры, донат.
|
||||||
|
|
||||||
@@ -1288,7 +1285,5 @@ task.spawn(function()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
]]></ProtectedString>
|
]]></ProtectedString></Properties></Item>
|
||||||
</Properties>
|
</roblox>
|
||||||
</Item>
|
|
||||||
</roblox>
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
<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">
|
<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="LocalScript" referent="RBX0">
|
<Item class="LocalScript" referent="RBX1"><Properties><string name="Name">FishingClient</string><ProtectedString name="Source"><![CDATA[-- FishingClient (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
||||||
<Properties>
|
|
||||||
<string name="Name">FishingClient</string>
|
|
||||||
<ProtectedString name="Source"><![CDATA[-- FishingClient (LocalScript) -> StarterPlayer > StarterPlayerScripts
|
|
||||||
-- Интерфейс: HUD, сумка, коллекция с наградами, миры, задания, ежедневная награда,
|
-- Интерфейс: HUD, сумка, коллекция с наградами, миры, задания, ежедневная награда,
|
||||||
-- магазин, улучшения, удача, донат, событие, мини-игра, атмосфера миров.
|
-- магазин, улучшения, удача, донат, событие, мини-игра, атмосфера миров.
|
||||||
|
|
||||||
@@ -1281,7 +1278,5 @@ remote.OnClientEvent:Connect(function(action, a, b, c)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
remote:FireServer("RequestInventory")
|
remote:FireServer("RequestInventory")
|
||||||
]]></ProtectedString>
|
]]></ProtectedString></Properties></Item>
|
||||||
</Properties>
|
</roblox>
|
||||||
</Item>
|
|
||||||
</roblox>
|
|
||||||
+1
-1
@@ -4847,4 +4847,4 @@ end)
|
|||||||
|
|
||||||
remote:FireServer("RequestInventory")
|
remote:FireServer("RequestInventory")
|
||||||
]=====])
|
]=====])
|
||||||
print('ГОТОВО! Все 5 скриптов установлены. Нажми Play (F5).')
|
print('DONE! 5 scripts installed. Press Play (F5).')
|
||||||
Reference in new issue
Block a user