Speedometer, Smoke trail, and engine sound on newgen chassis
an unholy amount of character escaping, with yours truly stealing from ton, ulaidh, laggy and chickenboi
local speaker = peripheral.find("speaker")
local top_speed = 0
repeat
pos = ship.getWorldspacePosition()
vel = ship.getVelocity()
speed = math.sqrt(vel.x ^ 2 + vel.y ^ 2 + vel.z ^ 2)
readable_speed = math.floor((speed * 3.6) + 0.5)
top_speed = math.max(readable_speed, top_speed)
speed_text = 'data merge block ~ ~ ~4 {Text2:\'[{"text":"' .. readable_speed ..
' ","color":"green"},{"text":"|","color":"white"},{"text":" ' .. top_speed ..
'","color":"yellow"}]\','
graphic = 'Text4:\'[{"text":"' .. ("\\\\u2588"):rep(math.min(math.floor(readable_speed / 10), 9)) ..
'","color":"green"},{"text":"' .. ("\\\\u2592"):rep(9 - math.floor(readable_speed / 10)) ..
' ","color":"yellow"}]\'}'
speedometer = speed_text .. graphic
particles = "particle minecraft:campfire_cosy_smoke " .. pos.x .. " " .. pos.y - 1 .. " " .. pos.z ..
" 0.6 0.3 0.6 0 " .. 4
if speed > 0.4 then
commands.exec(particles)
else
top_speed = 0
end
commands.exec(speedometer)
sleep(0.001)
until i == 1
If you change the code to display to a screen or some other output (and remove the particle part) then you can make a survival friendly version with a regular or advanced computer
:clueless:
anything from cc encoding or whatever it uses refuse to be displayed on a sign but it also cannot insert any unicode char
yes you might lose some formatting, but the idea is that you can get and display the speed without needing the command computer, if you ever want to make a survival friendly version
without having to generate the sound, just by using some playsounds with varying pitch
local speaker = peripheral.find("speaker")
while true do
vel = ship.getVelocity()
speed = math.floor(math.sqrt(vel.x ^ 2 + vel.z ^ 2))
speaker.playSound("createdieselgenerators:diesel_engine_sound", 0.28, 0.32 + speed/21)
sleep(0.1 - math.min(speed/25,0.9))
end
I already have to finish the architectury port, don’t give me too much ideas
:clueless:
and I planned accordingly to how people used the controllers, but also on how they tend to build things
I still need to update all the mod’s pages to include the link to the server
8 replies not shown · View on Discord
image.png
:3dsmile: