-
Notifications
You must be signed in to change notification settings - Fork 971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ComputerCraft integrations to more devices (1.20.1 edition) #7453
base: mc1.20.1/dev
Are you sure you want to change the base?
Conversation
- Makes computer-controlled Nixie Tubes unable to be changed by external factors (but can still be used as a Display Link source) - Add CC setText(text[, colour]) function - Add CC setTextColour(colour) function - Add CC setSignal(first, second) function taking 2 tables describing the appearance of the first and second tube as custom train signals
- Makes computer-controlled signals unable to be changed by external factors - Emit CC event train_signal_state_change with the new state as parameter whenever the signal changes - Add CC getState() function to get the current signal state - Add CC isForcedRed()/setForcedRed(forced) functions to force the signal to be red, replacing redstone control - Add CC getSignalType()/cycleSignalType() function to change the signal signal type in the same manner as using the wrench - Add CC listBlockingTrainNames() function to list names of trains blocking the track group ahead of the signal
- Emit CC events train_imminent, train_arrival and train_departure when these occur on the station - Add CC canTrainReach() function to test if the train stopped at the station can reach a (schedule-compatible) destination - Add CC distanceTo() function to get the shortest distance to a (schedule-compatible) destination at the moment, using the train stopped in the station
- Emit CC events train_passing & train_passed with the name of the train originating these events - Add CC isTrainPassing() function to check passing train presence - Add CC getPassingTrainName() function to get the passing train name, or nil failing that
- Add CC {get,set}GeneratedSpeed() function get/set motor speed
- Add CC isExtended() function to check extension state - Add CC extend()/retract()/toggle() to change the Sticker extension state, returning state change success.
- Emit CC event `overstressed` from Stressometers - Emit CC event `stress_change` from Stressometers - 2 arguments: stress (SU), capacity (SU) - Emit CC event `speed_change` from Speedometers - 1 argument: speed (RPM)
Very nice integration that opens a lot of possibilites, really hope it gets merged into the main mod! |
Very cool and would love to see it merged! i'm also currently working on a PR with CC integration for the StockTicker and packagers. Are you planning to work on that as well? You seem way better than me at this so maybe i should just leave the stage entirely for you. I barely managed to add tickers as new peripherals that just print any value after a good hour of bashing my head against CC's source |
@BirbIrl I'm not planning on adding support for the new logistics stuff (as least yet, ADHD is a bitch and who knows I might still end up adding new things). Feel free to base your work on mine however, the |
Aye, going back to work on it (when my brain lets me, aspergers is a bitch), I'll try making it with your pr getting merged in mind 🫡 |
Note
1.20.1 rebase of #6849. I haven't probed extensively for breakage, so testing is more than welcome.
Adds a handful of ComputerCraft integrations to mostly train-related devices.
If merged I will expand the repo's wiki to document these APIs.
train_imminent
,train_arrival
andtrain_departure
when these occur on the stationcanTrainReach(destination)
function to test if the train stopped at the station can reach a (schedule-compatible) destinationdistanceTo(destination)
function to get the shortest distance to a (schedule-compatible) destination at the moment, using the train stopped in the stationtrain_signal_state_change
with the new state as parameter whenever the signal changesgetState()
function to get the current signal stateisForcedRed()
/setForcedRed(forced)
functions to force the signal to be red, replacing redstone controlgetSignalType()
/cycleSignalType()
function to change the signal signal type in the same manner as using the wrenchlistBlockingTrainNames()
function to list names of trains blocking the track group ahead of the signaltrain_passing
&train_passed
with the name of the train originating these eventsisTrainPassing()
function to check passing train presencegetPassingTrainName()
function to get the passing train name, ornil
failing that{get,set}GeneratedSpeed()
function get/set motor speedisExtended()
function to check extension stateextend()
/retract()
/toggle()
to change the Sticker extension state, returning state change successspeed_change
overstressed
stress_change
The big feature
setText(text[, colour])
functionsetTextColour(colour)
functionsetSignal(first, second)
function taking 2 tables describing the appearance of the first and second tube as custom train signalssetSignal()
does partial display state update. Might be confusing, feedback welcome.Direct nixie control, no need for a display link
Now featuring colour!
Nixie_text_cycling.mp4
Custom signals!
Nixie_custom_color_and_glow_size.mp4
Code
Rotates the left tube through the Oklch hue wheel, and the right tube through the valid glow sizes
Clears & reset themselves when dis/connected from computers
Nixie_connect_and_reset.mp4