0.6.0: in-game tutorial in Create's Ponder style

- Ponder for KubeJS 2.4.0 (client) + client_scripts/createrp_ponder.js: six scenes (terminal, selling,
  buying, money and bank, land and ore, jobs) on «Довідник громадянина», frogport and CC computers,
  plus a «Держава Create RP» tag in the Ponder index
- startup_scripts/createrp_items.js registers kubejs:citizen_guide (identical in the server pack)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Fulldroper
2026-10-03 06:32:31 +03:00
co-authored by Claude Opus 5.5
parent 80693085e1
commit eef8225cfd
5 changed files with 304 additions and 2 deletions
+264
View File
@@ -0,0 +1,264 @@
// Create RP — туторіал у стилі Create (Ponder): наведи на предмет і затисни W.
// Потрібні PonderJS (мод «Ponder for KubeJS») і startup_scripts/createrp_items.js (предмет kubejs:citizen_guide).
// Сцени будуються на стандартній плиті 5x5: y=0 — плита, блоки з y=1. Текст: _слово_ — підсвітка, як у Create.
const PACKAGE = 'create:cardboard_package_10x12'
// посилка «летить» від однієї пакужаби до іншої: лінія маршруту + предмет-посилка
function sendPackage(scene, from, to, ticks) {
scene.overlay.showBigLine(PonderPalette.OUTPUT, from, to, ticks)
const dx = (to[0] - from[0]) / ticks, dy = 0.22, dz = (to[2] - from[2]) / ticks
const box = scene.world.createItemEntity(from, [dx, dy, dz], PACKAGE)
scene.idle(ticks)
scene.world.removeEntity(box)
}
// ---------------------------------------------------------------------------------------------
// 1. Термінал держави
function terminalScene(scene, util) {
scene.showBasePlate()
scene.world.setBlocks([2, 1, 2], 'computercraft:computer_advanced')
scene.world.setBlocks([1, 1, 3, 3, 2, 3], 'computercraft:monitor_advanced')
scene.idle(10)
scene.world.showSection([2, 1, 2], Direction.DOWN)
scene.idle(15)
scene.text(80, 'Будь-який _комп\'ютер_ — це термінал держави. Відкрий його й набери _rp_.', [2.5, 1.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.showControls(60, [2.5, 2, 2.5], 'down').rightClick()
scene.idle(90)
scene.text(90, 'Вхід — твій _нік_ і _пароль_. Першого разу термінал попросить створити пароль. Стій поруч із комп\'ютером — здалеку не пустить.', [2.5, 1.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(100)
scene.text(90, 'У меню: _рахунок_, _бізнес_, _ціни_, _магазин_, _земля_, _робота_, _тендери_, _банк_. Стрілки й Enter, Backspace — назад.', [2.5, 1.5, 2.5])
.placeNearTarget()
scene.idle(100)
scene.world.showSection([1, 1, 3, 3, 2, 3], Direction.DOWN)
scene.idle(15)
scene.text(90, 'Комп\'ютер з _монітором_ — табло цін держави: програма _prices metal_ (або stone, wood, farm, food, create…).', [2, 2.5, 3])
.colored(PonderPalette.BLUE).placeNearTarget().attachKeyFrame()
scene.idle(100)
}
// ---------------------------------------------------------------------------------------------
// 2. Продаж державі
function sellScene(scene, util) {
scene.showBasePlate()
// бізнес ліворуч: сховище → пакувальник → пакужаба; держава праворуч
scene.world.setBlocks([0, 1, 2], 'minecraft:barrel')
scene.world.setBlocks([1, 1, 2], 'create:packager')
scene.world.setBlocks([1, 2, 2], 'create:package_frogport')
scene.world.setBlocks([3, 1, 2], 'create:packager')
scene.world.setBlocks([3, 2, 2], 'create:package_frogport')
scene.idle(10)
scene.world.showSection([0, 1, 2], Direction.DOWN)
scene.idle(5)
scene.world.showSection([1, 1, 2], Direction.DOWN)
scene.idle(5)
scene.world.showSection([1, 2, 2], Direction.DOWN)
scene.idle(15)
scene.text(90, 'Держава _купує_ все, що добувають і виробляють: руду, метали, будматеріали, їжу, деталі Create.', [1.5, 2.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(100)
scene.text(100, 'Адреса продажу твого бізнесу — _gov-…_ (термінал → Бізнес → Адреса продажу). Познач нею пакувальник табличкою або в замовленні.', [1.5, 1.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.showControls(70, [1.5, 1.8, 2], 'down').rightClick().withItem('minecraft:oak_sign')
scene.idle(110)
scene.world.showSection([3, 1, 2, 3, 2, 2], Direction.DOWN)
scene.idle(15)
scene.text(90, '_Державна пакужаба_ приймає посилки на всі адреси gov-… Під нею — державний приймач.', [3.5, 2.5, 2.5])
.colored(PonderPalette.BLUE).placeNearTarget().attachKeyFrame()
scene.idle(100)
sendPackage(scene, [1.5, 3, 2.5], [3.5, 3, 2.5], 30)
scene.idle(5)
scene.text(100, 'Гроші приходять на _рахунок бізнесу_. Товару забагато — ціна падає, дефіцит — росте. Ціни — на табло й у терміналі.', [3.5, 1.5, 2.5])
.colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.text(80, 'Усе автоматизується: ланцюги, поїзди, ферми — продаж іде, поки ти робиш інше.', [2.5, 3.5, 2.5])
scene.idle(90)
}
// ---------------------------------------------------------------------------------------------
// 3. Покупка в держави
function buyScene(scene, util) {
scene.showBasePlate()
scene.world.setBlocks([3, 1, 2], 'create:packager')
scene.world.setBlocks([3, 2, 2], 'create:package_frogport')
scene.world.setBlocks([0, 1, 2], 'minecraft:chest')
scene.world.setBlocks([1, 1, 2], 'create:packager')
scene.world.setBlocks([1, 2, 2], 'create:package_frogport')
scene.idle(10)
scene.world.showSection([3, 1, 2, 3, 2, 2], Direction.DOWN)
scene.idle(15)
scene.text(90, 'Держава продає _імпорт_ (алмази, незерит, елітри…) і _ліцензії_. Купівля — термінал → Магазин держави.', [3.5, 2.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(100)
scene.world.showSection([0, 1, 2], Direction.DOWN)
scene.idle(5)
scene.world.showSection([1, 1, 2, 1, 2, 2], Direction.DOWN)
scene.idle(15)
scene.text(100, 'Під час покупки вкажи _адресу своєї пакужаби_ — так, як вона названа. Термінал запам\'ятає її.', [1.5, 2.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.text(60, 'Товар виїжджає з _державного складу_…', [3.5, 3, 2.5]).colored(PonderPalette.BLUE)
scene.idle(20)
sendPackage(scene, [3.5, 3, 2.5], [1.5, 3, 2.5], 30)
scene.idle(20)
scene.text(100, '…і приходить посилкою. _Пакувальник_ під твоєю пакужабою розпакує її у скриню.', [0.5, 1.5, 2.5])
.colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.text(80, 'Не дійшла? Гроші _повертаються_ автоматично, а в чаті буде причина.', [2.5, 3.5, 2.5])
scene.idle(90)
}
// ---------------------------------------------------------------------------------------------
// 4. Гроші й банк
function moneyScene(scene, util) {
scene.showBasePlate()
scene.world.setBlocks([2, 1, 2], 'computercraft:computer_advanced')
scene.world.showSection([2, 1, 2], Direction.DOWN)
scene.idle(15)
scene.text(90, 'Твої гроші — на _рахунку_ в державному банку. Баланс і перекази — термінал → Рахунок.', [2.5, 1.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(100)
const coins = ['numismatics:spur', 'numismatics:bevel', 'numismatics:sprocket', 'numismatics:cog']
for (let i = 0; i < coins.length; i++) {
scene.world.createItemEntity([1 + i, 3, 1], [0, 0.1, 0], coins[i])
scene.idle(5)
}
scene.idle(10)
scene.text(110, '_Готівка_ — монети: зняти /cash withdraw <сума>, покласти — /cash deposit з монетами в руці. Готівкою платять одне одному з рук.', [2.5, 2, 1.5])
.colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame()
scene.idle(120)
scene.text(100, '_Банк_ (термінал → Банк): стартовий та інвестиційний кредити для бізнесу, вклади під відсоток щодня.', [2.5, 1.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.text(90, 'Кредит платиться щоденними внесками. Пропустиш тричі — _дефолт_: рахунок бізнесу заморожено, тендери заборонені.', [2.5, 1.5, 2.5])
.colored(PonderPalette.RED).placeNearTarget()
scene.idle(100)
}
// ---------------------------------------------------------------------------------------------
// 5. Земля й надра
function landScene(scene, util) {
scene.showBasePlate()
scene.world.setBlocks([1, 1, 1], 'minecraft:oak_fence')
scene.world.setBlocks([3, 1, 1], 'minecraft:oak_fence')
scene.world.setBlocks([1, 1, 3], 'minecraft:oak_fence')
scene.world.setBlocks([3, 1, 3], 'minecraft:oak_fence')
scene.world.setBlocks([2, 1, 2], 'minecraft:iron_ore')
scene.idle(10)
scene.text(90, 'Уся незареєстрована земля _належить державі_. Будувати можна на своїх ділянках.', [2.5, 1, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(100)
scene.overlay.showOutline(PonderPalette.GREEN, 'plot', util.select.fromTo(0, 0, 0, 4, 0, 4), 120)
scene.world.showSection([1, 1, 1, 3, 1, 3], Direction.DOWN)
scene.text(110, '_Ділянки_ орендують на ігрові дні або викуповують: термінал → Земля. Заходячи на ділянку, бачиш її назву над хотбаром.', [2.5, 1.5, 2.5])
.colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame()
scene.idle(120)
scene.text(100, 'Орендована ділянка — _приват_ бізнесу: чужі не ламають, а твої працівники мають доступ.', [2.5, 1.5, 2.5])
.placeNearTarget()
scene.idle(110)
scene.overlay.showOutline(PonderPalette.RED, 'ore', util.select.position(2, 1, 2), 100)
scene.text(100, '_Руда_ видобувається за _концесією_: купи дозвіл на руду й квоту на ділянці (термінал → Земля → Купити концесію).', [2.5, 1.5, 2.5])
.colored(PonderPalette.RED).placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.text(80, 'За землю щодня — орендна плата або податок. Не заплатив 3 дні — ділянка повертається державі.', [2.5, 2.5, 2.5])
scene.idle(90)
}
// ---------------------------------------------------------------------------------------------
// 6. Робота: ринок праці і пошта
function jobsScene(scene, util) {
scene.showBasePlate()
scene.idle(10)
const post = scene.world.createEntity('minecraft:villager', [1, 1, 2.5])
scene.idle(10)
scene.text(90, 'Немає роботи? Термінал → Робота → _ринок праці_: допомога по безробіттю щодня, якщо ти був активний у грі.', [2.5, 2.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(100)
scene.text(90, 'Хочеш заробляти більше — стань _поштарем_. Клікни по NPC пошти.', [1, 2.5, 2.5])
.colored(PonderPalette.BLUE).placeNearTarget().attachKeyFrame()
scene.showControls(60, [1, 2.3, 2.5], 'down').rightClick()
scene.idle(70)
scene.world.createItemEntity([1.5, 2, 2.5], [0.05, 0.25, 0], PACKAGE)
scene.world.createItemEntity([1.5, 2, 2.5], [0.03, 0.3, 0.03], 'minecraft:compass')
scene.idle(20)
scene.text(100, 'Отримаєш _посилку_ з іменем адресата й _компас_, що вказує на нього. ПКМ компасом — мітка на місці (видно лише тобі).', [2, 1.5, 2.5])
.placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.world.createEntity('minecraft:villager', [4, 1, 2.5])
scene.overlay.showBigLine(PonderPalette.OUTPUT, [1.5, 1.2, 2.5], [4, 1.2, 2.5], 80)
scene.text(100, 'Адресат чекає в іншій частині світу. Принеси посилку й клікни по ньому — гроші на рахунок. Що далі, то дорожче.', [4, 2.5, 2.5])
.colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame()
scene.idle(110)
scene.text(80, 'На доставку — _2 ігрові дні_. Не встиг — адресат поїде, і посилка згорить.', [2.5, 2.5, 2.5])
.colored(PonderPalette.RED)
scene.idle(90)
scene.text(90, 'Або наймися до бізнесу: власник пропонує зарплату, ти приймаєш у терміналі → Бізнес → Прийняти запрошення.', [2.5, 2.5, 2.5])
scene.idle(100)
}
// ---------------------------------------------------------------------------------------------
Ponder.tags(event => {
event.createTag('kubejs:createrp', 'kubejs:citizen_guide', 'Держава Create RP',
'Як жити й заробляти в державній економіці: термінал, продаж і покупки посилками, гроші, земля, робота.',
['kubejs:citizen_guide', 'create:package_frogport', 'computercraft:computer_advanced', 'computercraft:computer_normal', 'computercraft:monitor_advanced'])
})
Ponder.registry(event => {
event.create('kubejs:citizen_guide')
.scene('guide_terminal', 'Термінал держави', terminalScene)
.scene('guide_sell', 'Продаж державі', sellScene)
.scene('guide_buy', 'Покупки в держави', buyScene)
.scene('guide_money', 'Гроші й банк', moneyScene)
.scene('guide_land', 'Земля й надра', landScene)
.scene('guide_jobs', 'Робота: ринок праці й пошта', jobsScene)
event.create('create:package_frogport')
.scene('frogport_sell', 'Create RP: продаж державі', sellScene)
.scene('frogport_buy', 'Create RP: покупки в держави', buyScene)
event.create(['computercraft:computer_advanced', 'computercraft:computer_normal'])
.scene('computer_terminal', 'Create RP: термінал держави', terminalScene)
event.create('computercraft:monitor_advanced')
.scene('monitor_terminal', 'Create RP: термінал і табло цін', terminalScene)
})