This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Patric20878's profile picture

Airship controller in Tekkit Classic/CC1.33

Started by Patric20878, 09 December 2013 - 07:35 PM
Patric20878 #1
Posted 09 December 2013 - 08:35 PM
Hello all. I'll try to phrase this problem as concisely and thoroughly as I can, so please bear with the long post below. I'll first describe the bug causing the problem for those unfamiliar with it as well as some background information, and then I'll list some my ideas to work around it, but I'll need help to come up with a proper solution as I've found problems preventing every idea so far from working.

Basically, I'm currently making the on-board controls to my battleship in Tekkit Classic, but due to a certain bug between CC 1.33 and Redpower that causes turtles and computers to not update its location when it's physically moved by a frame motor, I'm finding it very tricky to get it to work correctly. My ship uses several turtles, which stay on and listen for commands from "button" turtles that form the controls of the ship. To describe, my startup for the "button" turtles execute a command, and then shuts itself down, so everytime you right click the turtle, it executes the command it's given and shuts down. When the ship moves by the command, it also kicks you out of the screen, so it more or less simulates an advanced wireless 1-block large button.

Now the thing is, updating the location for computers and turtles for that bug requires rebooting the computer. The turtles that make up the controls work via executing a command and then shutting down, so those reboot everytime you click on one for a command. However, the ship turtles don't. What happens then, is that when I have the ship move, the turtles for the engine continue to think they're at original location even after they physically moved since they don't reboot, and the controller turtles correctly know their locations everytime I press it.

Result being, for example: If I had the ship move 65 blocks away, the actual (nonphysical) location of the ship turtles are still at the location before the ship moved. Then the controller turtles are outside 64 blocks range and can no longer control the ship even when they are some 10m physical distance from the ship turtles.

This bug is fixed in Tekkit Lite with the newer CC version, and except for yet another bug described below, the code and design there runs flawlessly.

Now my 3 ideas to work around the problem:
1) The simplest one is of course, just move onto Tekkit Lite. I would, except then there's a strange bug that keeps turning certain wireless turtles into regular ones when the ship moves on my Tekkit Lite testing server, so I doubt I'll be doing that. (That and I prefer classic lol)

2) The controller turtles could always stay on, and use some other method to control the ship so the controller and ship turtles are always at the same relative distance factoring in the non updating location bug. This also doesn't work so well, because vanilla buttons get stuck when the ship is moving, levers don't turn themselves off, and both take another block of space that there simply isn't enough in the control platform, as they need to be attached to a turtle anyways. The whole idea with the button type of controller turtles was to compact the controls. I did see that in later CC versions, there seems to be an event called monitor_touch for monitors, but I don't see anything like that in Classic. Is there possibly a way for a computer to detect when someone accesses the computer besides my way of shutting itself down every time?

3) The ship turtles can reboot every time it moves. Even though I do have 2 pairs of motors for every direction (power supply thing), which allows the 2 pairs to communicate with each other, it still would be tricky to save information on computers that never stay turned on. I could use the FS API to directly write information onto the turtle, but unless that's the only way, I'd really prefer not to do such a messy solution. And then, another concern with rebooting turtles is, how would you be able to send a command to a rebooting computer? If a turtle reboots the other ship turtles while it's active, I'd imagine there'd be a lot of times where a new command fails to get through because every other turtle is off at that moment.

Preferably, my ideal solution is 2), if a computer can detect accessing it. Then I could have all turtles reboot when the ship stops or before it changes direction so it can both update its location and save the data to be able to for example, run a loop to move forward 20 blocks. But for now, this is the first time I've run into a roadblock on designing the ship, and I can't seem to find a way around it. If you need the code or pictures of the design for reference, I can post it up. Any ideas to resolve this?
Edited on 14 December 2013 - 02:20 AM
Patric20878 #2
Posted 09 December 2013 - 09:39 PM
Another question on a separate topic:

So without much success, I've tried googling solutions for the following problem. Is there any way (a workaround maybe?) for a wireless turtle to output redstone signal on all horizontal sides, including the right side where the modem is attached in CC 1.33, with a condition that the total size has to remain at one block large? The only thing holding me back from making more compact ship engine designs is that problem…
Edited on 09 December 2013 - 09:19 PM
Lyqyd #3
Posted 09 December 2013 - 09:40 PM
It's intentional. You have a peripheral attached to that side, so you cannot use that side for other things.
Patric20878 #4
Posted 09 December 2013 - 09:42 PM
Ok, so it's intended. Any workarounds to that and still keeps the total size to one block large?

About merge:
I'll keep the two questions in one topic then, but to make it clear, the second question is not a continuation of the first. The two are separate topics.
Edited on 09 December 2013 - 09:03 PM
Lyqyd #5
Posted 09 December 2013 - 09:45 PM
No, I purposefully merged it in here, since it's a further question related to the same concept. Sigh.
Patric20878 #6
Posted 09 December 2013 - 09:47 PM
It isn't the same concept. One is talking about wireless turtles unable to output on their right side, and another is talking about how they don't update their GPS location when moved by a frame motor.

How are they related…?
Lyqyd #7
Posted 10 December 2013 - 12:26 AM
They're both related to this frame contraption, yes?
Patric20878 #8
Posted 10 December 2013 - 12:33 AM
Not necessarily. The fact that wireless turtles can't output to its right affects a lot of stuff I do, not just the ship, where the location-not-updating bug specifically has to do with turtles/computers moved by frame motors from RedPower. (which was fixed sometime between CC1.33 and 1.5)

I just thought that I should keep it organized by separating different questions into different topics, as to avoid confusing people.
Edited on 09 December 2013 - 11:36 PM
Bomb Bloke #9
Posted 14 December 2013 - 04:54 AM
The simplest one is of course, just move onto Tekkit Lite.
I assure you, if you're going to use wireless turtles you do not want that version of ComputerCraft. If you're going to update, go to something later. You'll lose RedPower but by now there are plenty of replacements; your desired functionality is likely to be found elsewhere.

Is there possibly a way for a computer to detect when someone accesses the computer besides my way of shutting itself down every time?
No, sorry, not unless the user further interacts with the systems in some way - eg, typing a button on their keyboard while the console's open. Though you could take advantage of that to reduce your count of controller turtles to one (as it could send different orders depending on what the user types) - but I assume this is obvious to you and you're wanting to stick to your "turtle buttons" system anyway.

The ship turtles can reboot every time it moves. Even though I do have 2 pairs of motors for every direction (power supply thing), which allows the 2 pairs to communicate with each other, it still would be tricky to save information on computers that never stay turned on.
Er, how so?

And then, another concern with rebooting turtles is, how would you be able to send a command to a rebooting computer? If a turtle reboots the other ship turtles while it's active, I'd imagine there'd be a lot of times where a new command fails to get through because every other turtle is off at that moment.
You'd need to write a handshake system, whereby the controller turtles refuse to send a command until all relevant ship turtles have reported in stating that they're ready to receive that command.

Is there any way (a workaround maybe?) for a wireless turtle to output redstone signal on all horizontal sides, including the right side where the modem is attached in CC 1.33, with a condition that the total size has to remain at one block large? The only thing holding me back from making more compact ship engine designs is that problem…
Other then having the turtle spin around (allowing all sides to be used, although not at once), nothing comes to mind.

Is it not viable to ditch the modems and link things up with bundled cabling?
Patric20878 #10
Posted 15 December 2013 - 12:06 AM
I assure you, if you're going to use wireless turtles you do not want that version of ComputerCraft. If you're going to update, go to something later. You'll lose RedPower but by now there are plenty of replacements; your desired functionality is likely to be found elsewhere.
Yeah, already mentioned in original post, amount of bugs in Tekkit Lite…And unfortunately, far as replacements go in later Tekkit/FTB/etc, it's replaced by a imo, much inferior frames mod. Just moving a computer/turtle with it shuts it down, and there's teleport frames. Like cmon, teleporting ships, inbal much? Classic and Lite are the only two I'd want to play until Eloraam updates Redpower to current MC versions.

No, sorry, not unless the user further interacts with the systems in some way - eg, typing a button on their keyboard while the console's open. Though you could take advantage of that to reduce your count of controller turtles to one (as it could send different orders depending on what the user types) - but I assume this is obvious to you and you're wanting to stick to your "turtle buttons" system anyway.
It's what I use now yeah, though it reduces it to 4 instead of 1. One for each horizontal direction so the pilot can always face "forward". Unfortunate. I guess monitor_touch allows you to use a monitor in later CC versions as a button?

Er, how so?
Well, I could use the fs API, but eh…I really rather not do that. Just seems like a messy solution compared to just having turtles store the info in RAM when constantly turned on. That and they could always send their last state to a controller computer before shutting down, which sends it back when they reboot, or just reboot everytime the ship stops or changes directions. After all, it's kinda hard to repair a damaged core that's still moving.

You'd need to write a handshake system, whereby the controller turtles refuse to send a command until all relevant ship turtles have reported in stating that they're ready to receive that command.
Thought of that actually, but this is these are turtles that control ship movement that we're talking about. The command can't just sit there and wait until the turtle turns on, or it'll, at best, slow the ship, and at worst, probably unsync the 2 motor pairs and mess up movement.

Other then having the turtle spin around (allowing all sides to be used, although not at once), nothing comes to mind.
Darn it, wish there was a workaround to that or something…

Is it not viable to ditch the modems and link things up with bundled cabling?
Absolutely not, there is 0 space available for cables and stuff to carry signal around. Even compacting it as much as I possibly could and still getting enough power generators in, the core is already bulky enough at 2x7x7 + the 4x9x9 frame. (Compared to my 5x3x3/7x5x5 single motor engine core, about half that mass) Every block used on it is a block that can't be used for other things like weapons, and a motor can only move 1000 at once.

For now, I'll have to use 4 controller turtles with user input to control the ship. Seems like a lot of those problems have run into the limits of what Tekkit Classic can do. Syncing physical location with gps location on the turtles will probably be done on direction change or stop. And the extra time needed to press a button to control the ship after the pilot's in the screen basically requires me to slow the ship down by 20%, though I guess on the flip side, the control room is much less cluttered with turtles.
Edited on 14 December 2013 - 11:37 PM
Bomb Bloke #11
Posted 15 December 2013 - 02:24 AM
Classic and Lite are the only two I'd want to play until Eloraam updates Redpower to current MC versions.
Pigs may sooner fly - and this being MineCraft, that's no exaggeration. ;)/>

If you have any intention of moving on within the next year or so, now is likely the best time.

I guess monitor_touch allows you to use a monitor in later CC versions as a button?
You could say that. It also picks up on where the display was touched, allowing you to eg implement multiple buttons on the one panel.
Alice #12
Posted 15 December 2013 - 02:26 AM
Pigs may sooner fly - and this being MineCraft, that's no exaggeration. ;)/>
Better install Trail Mix mod!
Patric20878 #13
Posted 15 December 2013 - 03:11 AM
@Bomb Bloke: xD

Well yeah, Redpower's been in development hell for a while lol. I don't even think I want to move on entirely if there's no Redpower because the frames and motors in it is what keeps me designing in tekkit classic. Ships take power to move and drain more power when it's heavier, and there's a hard limit of 1000 blocks, so it's fun seeing what I can come up with.

Replacement mod: hi imbal features: 5000 block limit, no power needed to move, teleporting ships, not even needing to wrap what you're moving in support frames…really now. Know how they say that when power creep increase, optimal choices decrease? :P/>

Thanks for answering my questions. Happen to play tekkit (classic)?