Minecraft-Omnidirectional-Drone-Controller | Built With ValkyrienSkies2, Create & ComputerCraft Mods
Download the Map and Mod pack From PlanetMinecraft
Minecraft has a giant modding community. With the Valkyrien Skies 2 mod (currently a modding API for building sub-mods), players are able to build physics based creations. The ComputerCraft mod adds in-game computers and peripherals with Lua based programming. I abused both along with my college degree to create this.
Imma be honest, it wasn't easy for me to pull this off.
The thrusters (the red and white rockets) are powered by Redstone. More about Redstone here... For those of you unfamiliar with Redstone, it only comes in POSITIVE INTEGERS.
That made it difficult to control the thrusters by default. I had to resort to using Pulse Width Modulation to get finer control over the thrusters.
At first I assumed it would be enough to use a fixed redstone value and just pulse it in certain intervals to control the thrusters. However, thanks to NikZapp's help, I was able to get the full range of redstone strength while retaining fine control!
Thanks to NikZapp For the Distributed-PWM-Redstone Algorithm. Never would have done this without it!
Currently, the mods I used didn't provide the ship's Inertia Tensor right out of the box. I had to build my own inertia tensor for my ship.
With Create's Schematics.nbt file and a dictionary of block masses, I wrote my own separate java program to extract the data and construct an inertia tensor.
A big thanks to Querz for building the Java Library I used to extract NBT data from the schematic files: https://github.com/Querz/NBT
But tbh, I think the VS2-Computers addon will eventually implement a function in the future to expose the ships inertia tensor so people wouldn't have to go thru what I went thru...
You might need to read up on these topics before diving in the code. Here are some videos that should help you get started:
+Quaternions: https://youtu.be/1yoFjjJRnLY
+Inertia Tensors: https://youtu.be/SbTSATs-DBA
+PWM Signals: https://youtu.be/B_Ysdv1xRbA
+PID Controller for Lua: https://youtu.be/K4sHec1qGKg
Prepare the game to use atleast 8GB of RAM by setting the JVM Arguments in the Minecraft Launcher
Folder 0: For the Wireless Pocket Computer.
Folder 4: For the Create Link Controller setup (0scorcher_remote_armed.nbt)
Folder 5: For the Left Side onboard component controller
Folder 7: For the main onboard computer
Folder 8: For the Right Side onboard component controller
- Make sure to set the Thruster Speed to 55000 in the VS2-Tournament Mod Config Settings (this is specifically for Sand Scorcher).
- Disable the block-black-list over at the VS2-Eureka mod config settings (or whichever VS2 addon that has an assembler block that you use to assemble ships with).
- Build Create schematic as is. Do NOT rotate or mirror the schematics.
- Connect the floating parts of the ship together with temporary blocks (I usually just use wool).
- make sure the flamethrower Create-Link is turned ON from the Create-Link Controller setup (0scorcher_remote_armed.nbt). It should turn on by default when you first run "remote.lua" on the computer. The FlameThrower is "ACTIVE-LOW". That means it turns on with a redstone signal of 0.
- Replenish cannon ammo and flamethrower charges.
- I usually just go for a VS2-Eureka Ship Helm to assemble a ship but the other addons' assembler blocks should work just as fine.
- Make sure the VS2-Tournament thrusters are all upgraded to level 5 thrusters.
- Remove the placed temporary blocks placed earlier.
- Turn on the cable-modems on the redstone integrators.
- Build and prepare the Create:Autocannons at the back end.
- If you're assembling the Scorcher variant with the "flame" contraption, be prepared to glue the flames yourself.
- Spin the hand cranks to make them look like handle bars.
- Run
remote.lua
on the Create-Link Controller setup (0scorcher_remote_armed.nbt) and grab the Link Cotroller - Prepare to run
reset.lua
on the Wireless Pocket Computer. This should reset the craft thrusters and reboot the main onboard computer if anything goes wrong - Prepare a VS2-Eureka Ship Helm on hand. Placing it on a ship forces it to stop freaking out if anything goes wrong
- Run
recv_L_scorcher.lua
on the left side onboard computer - Run
recv_R_scorcher.lua
on the right side onboard computer. These control the thrusters - Run
flight_control_firmware_scorcher.lua
on the main onboard computer - Fly
THIS IS IMPORTANT TO DO BEFORE LOGGING OFF
-
After flying, run
reset.lua
on your Wireless Pocket Computer to shutoff the thrusters and stop the main script.CC:Computers turnoff when the player exits the world. Upon logging back in, the onboard computers would be turned off but the Redstone Integrator peripherals would retain their last redstone settings and inturn would still be powering the thrusters.
If this ever happens, the Scorcher would start flying off by itself when you log in.
At the very least quickly prepare a VS2-Eureka Ship Helm to calm down the ship and
RUN the
recv_L_scorcher.lua
andrecv_R_scorcher.lua
scriptson the left and right side onboard computers to reset the Redstone Integrators back to 0.
space - up
shift - down
w,a,s,d - forward,left,backward,right
space+a - yaw left
space+d - yaw right
space+w - pitch forward
space+s - pitch back
shift+a - roll left
shift+d - roll right
a+w+space - drift left
d+w+space - drift right
a+s+space - drift left backwards
d+s+space - drift right backwards
shift+space+w - cannons full-auto
shift+space+s - flamethrower full-auto
Valkyrien Skies:
valkyrienskies-118-forge-2.1.0-beta.12c3076eba24 (Valkyrien Skies 2 Core)
vc-1.5.2+2090972a50 (Valkyrien Skies 2-Computers)
eureka-1.1.0-beta.8 (Valkyrien Skies 2-Eureka)
takeoff-forge-1.0.0-beta1+308678c5c5 (Valkyrien Skies 2-Takeoff)
tournament-forge-1.0.0-beta3-0.6+f5dce4613f (Valkyrien Skies 2-Tournament)
Clockwork_Pre-Alpha_Patch_1.3c_FORGE (Valkyrien Skies 2-Clockwork)
Create:
create-1.18.2-0.5.0.i (Create Core)
createbigcannons-forge-1.18.2-0.5.1.a-nightly-1c78f14 (Create Big Cannons)
Macaw's Windows (Sand Scorcher "Armor"):
mcw-windows-2.1.1-mc1.18.2forge
ComputerCraft:
cc-tweaked-1.18.2-1.101.2 (ComputerCraft Tweaked)
AdvancedPeripherals-0.7.27r (ComputerCraft Advanced Peripherals)