跳到正文

Create: Avionics — ComputerCraft for Aeronautics

作者:SolAstrius

CC: Tweaked peripherals for Create: Simulated and Create: Aeronautics.

收藏

截图

介绍

中文介绍正在准备中,下面暂时显示原文。

Create: Avionics

Make your airship fly itself.

CC: Tweaked peripherals for every instrumentable block in Create: Aeronautics. Read attitude, altitude, velocity, bearing. Drive throttle, propellers, balloon gas. Write your autopilot in Lua (that’s a bad pitch, but still!)

Build

  • Altitude-hold for hot-air balloons
  • Heading-and-pitch autopilots for propeller aircraft
  • Cruise control bound to a steering wheel
  • Tracked turrets for mounted potato cannons
  • Whatever else you can write a control loop for

Start

Heading hold on a twin-engine ship:

local nav        = peripheral.find("navigation_table")
local port, stbd = peripheral.find("analog_transmission")
local target     = nav.getHeadingRad()

while true do
    local err = (target - nav.getHeadingRad() + math.pi) % (2*math.pi) - math.pi
    local diff = math.max(-5, math.min(5, err * 4))
    port.setSignal(7 - diff); stbd.setSignal(7 + diff)
    sleep(0.05)
end

Three peripherals, one P-controller, the ship locks heading. Every Aeronautics (and nearly every Create) block is a peripheral — read sensors, set actuators, write the loop you want.

Blocks

  • Avionics controller — one cable connects every peripheral on the ship to your computer, under names that follow the ship’s bow (ship_velocity_sensor_forward_0, ship_propeller_bearing_aft_port_0). Also the ship’s transponder. Guide
  • Radar Mk.1 — one beam, 256 blocks: ships, terrain, distance, closing speed, transponder names.
  • Weather instruments — thermometer, hygrometer, barometer, rain gauge, almanac; they read the air the ship is flying through. Guide

Not just aircraft

The same peripheral.find() surface drives lifts, vehicles, and your whole rotational network — not only things that fly.

Create Elevators — enumerate floors, call the cabin, read where it is:

local lift = peripheral.find("Create_ElevatorPulley")
lift.setTargetFloor(lift.getFloors()[3].y)   -- send the cabin to the 3rd floor
repeat sleep(0.1) until lift.isArrived()
print("Arrived: " .. lift.getCurrentFloor().short_name)

Kinetic SCADA — walk the rotation network, alarm on overstress:

local draw, capacity = 0, 0
for _, name in ipairs(peripheral.getNames()) do
    local p = peripheral.wrap(name)
    if p.getNetworkId then                       -- any kinetic block
        draw     = draw     + p.getStressImpact()
        capacity = capacity + p.getStressContribution()
        if p.isOverstressed() then
            print("OVERSTRESSED " .. p.getSelfId() .. " (" .. p.getKind() .. ")")
        end
    end
end
print(("Network load: %.0f / %.0f SU"):format(draw, capacity))

Vehicles — steering and brake override on wheel mounts:

for _, w in ipairs({ peripheral.find("wheel_mount") }) do
    w.setSteering(0.5)                                       -- -1..1  ->  +/-30 deg
    if w.getTouchingFriction() < 0.5 then w.setBrake(0) end  -- ease off on slippery stuff
end

getKind, getSubnetworkAnchorId, getColumnContacts, getTouchingFriction — the read side is as rich as the write side.

Full API docs — units, body-frame conventions, every method.

Read the parallel guide. 5 Hz and 20 Hz feel different.

Install

Needs: MC 1.21.1 · NeoForge 21.1.219+ · Create 6.0.10+ · Simulated/Aeronautics/Offroad 1.2.1+ · Sable 1.1.0+ · CC: Tweaked 1.115+

Optional: Thermoo (climate for the instruments) · Serene Seasons (the almanac’s calendar)

Install on both client and server.

Official downloads are only here, on Modrinth, CurseForge and GitHub. Other listings are reuploads, usually outdated.

Community

Discord — questions, scripts, ships. Bugs go to GitHub issues.

Pairs with

ccc · create-computercraft

Source · Issues

github.com/SolAstrius/CreateAvionics

MIT. Built on RyanHCode’s CC peripheral foundation in Simulated — NOTICE.

Created by yours truly, Sol Astrius Phoenix.

常见问题

Create: Avionics — ComputerCraft for Aeronautics 支持哪些 Minecraft 版本?

Create: Avionics — ComputerCraft for Aeronautics 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

Create: Avionics — ComputerCraft for Aeronautics 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分