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

[MC 1.2.5/1.3.2 ] [CC 1.4x] Easy Signalling

Started by wjykk, 09 October 2012 - 02:16 AM
wjykk #1
Posted 09 October 2012 - 04:16 AM
If you ever needed to add traffic signals in your world, you'd notice that the only decent method to do so is using Railcraft distant signals. You would also notice that if you have to use 3 or more different lights on a single signal, it gets really messy and you lose track of what's happening. This mod will eliminate reduce the pain and make it easy to integrate with ComputerCraft.

Download
Download version 0.3.0. Simply place it in the mods folder along with the following requirements:
  • Minecraft 1.3.2
  • Minecraft Forge 4.1.4.287+
  • ComputerCraft 1.42+
  • Railcraft 6.4.1.0+
Download version 0.2.0 (yup, working backwards). Same instructions as above with these requirements:
  • Minecraft 1.2.5
  • Minecraft Forge ?????
  • ComputerCraft 1.4x+
  • Railcraft 5.4.7+
Basically, the above version is best if you're still playing the Technic pack.

This project is open source-ish. Visit the github page if you'd like.

How to set up your design
  1. Pair up each distant signal with a Signal Controller Box, just like usual
  2. Use a Controller Box Analyzer (see below) on the Controller Box(es) and record its coordinates
  3. Next, set up your computer and place the Computer Signal Controller (see below) next to it
  4. Attach the peripheral (e.g. p = peripheral.wrap("left"))
  5. For every signal, add it to the peripheral by using p.add("id",x,y,z), where "id" is some unique string and x,y,z are the coordinates of the controller box
  6. Each time you add a controller box to the peripheral, it will turn off its corresponding signal. It's OK, it's supposed to be like that
  7. Finally, if you want to set the color of a signal, just use p.setLight("id",light) (see list below)
Recipes
Controller Box Analyzer


Computer Signal Controller


Commands
After attaching the peripheral p, you can use the following commands:
  • p.add(id, x, y, z) - Add a Signal Controller Box located on the coordinates (x,y,z) to the peripheral and call it "id"
  • p.remove(id) - Remove the signal from the peripheral
  • p.setLight(id, light) - Set the color of the light. The value light is a number corresponding to the following list:
    • 0 - Off
    • 1 - Red
    • 2 - Yellow
    • 3 - Green
    • 4 - Blinking red
    • 5 - Blinking yellow
  • p.getLight(id) - Gets the color of the signal using the above chart
Bugs
The following is a known list of bugs and their temporary solutions
  • If the peripheral can't find a tile entity specified by the coordinates, it will do nothing for some reason
    • Solution: make sure your coordinates are correct
  • After logging out and in again, the peripheral will not recognize any tile entities
    • Solution: create some mechanism that will destroy and replace the peripheral at log out. It could be easily achieved with, say, RedPower, if it was updated :D/>/>
  • To change the light, the peripheral simply changes the default value of Signal Controller Boxes. As such, if you apply a redstone current to a Box, the light will not show the expected result
    • Solution: until it will be possible to pair a signal directly to the peripheral, just keep all your redstone stuff away from the Boxes
To-do list
  • Fix bugs
  • Implement a decent API
  • ????
  • Profit
Anything else?
If you need help, found a bug not included above, or would like to suggest a feature, just reply to this topic. Thank you!
LucasUK #2
Posted 09 October 2012 - 05:48 PM
Good idea etc, would love to set-up a proper rail network one day but my coding to dumb to let pathfinding etc work so I prob not test :)/>/>

I need a sorting machine style block, for rails as I struggle getting rails with coal to go one route, and wood another, and want to let me choose where I end up before I set off… alll on the same rails :P/>/> ;)/>/> is this what your doing in your land?
wjykk #3
Posted 11 October 2012 - 05:22 AM
Good idea etc, would love to set-up a proper rail network one day but my coding to dumb to let pathfinding etc work so I prob not test :)/>/>

I need a sorting machine style block, for rails as I struggle getting rails with coal to go one route, and wood another, and want to let me choose where I end up before I set off… alll on the same rails :P/>/> ;)/>/> is this what your doing in your land?
Since I'm not sure what you're asking, it's probably not what you want. I'm working with integrating distant signals with CC, nothing more.


Also, if anyone is interested, the mod has been ported backwards to 1.2.5. The OP has also been updated.
ETHANATOR360 #4
Posted 14 October 2012 - 03:25 AM
this will work great for any one using flans
yx33a #5
Posted 15 October 2012 - 07:43 PM
Good idea etc, would love to set-up a proper rail network one day but my coding to dumb to let pathfinding etc work so I prob not test :P/>/>

I need a sorting machine style block, for rails as I struggle getting rails with coal to go one route, and wood another, and want to let me choose where I end up before I set off… alll on the same rails :D/>/> :P/>/> is this what your doing in your land?
Ideally one would use something other then rails and carts to do such things, due to chunk loading and whatnot, but I would guess you'd want unloaders to put your stuff in the chests, and fancy rail setups with switch motors and whatnot to change where things go.
Personally, I'm going to use this mostly as a way to have a easy to control Wireless Redstone sort of thing. Press a few buttons and you have a door opened somewhere half a mile away.
GopherAtl #6
Posted 15 October 2012 - 11:48 PM
For dynamic cart routing, you should check out immibis' RFID tags, they can be read from inside carts and might be just what you need.
LucasUK #7
Posted 16 October 2012 - 12:26 AM
omg gopher :P/>/> :P/>/> :)/>/> B)/>/> B)/>/> B)/>/> :wub:/>/> :wub:/>/> why dont i think of these things :D/>/> .. although do they have to be on a player?
GopherAtl #8
Posted 16 October 2012 - 12:33 AM
Not in the more recent versions, no, he added reading them from inside storage carts a while back by request, version 49.0.3 I think?
xuma202 #9
Posted 11 May 2013 - 05:08 PM
Any chance this will be updated? Since I like using Railcraft Signals but also want to keep things CC controlled

EDIT: Sorry just saw this is already a feature of MiscPeripherals