Jump to content




[1.4] cable


41 replies to this topic

#1 svennp

  • Members
  • 23 posts
  • LocationFredrikstad

Posted 14 March 2012 - 11:22 AM

i suggest a cable for connecting the screen and disk drive, would be great if you don't want the screen and disk drive next to the computer!

#2 Xfel

    Peripheral Designer

  • Members
  • 515 posts

Posted 14 March 2012 - 12:40 PM

That is a very good idea. The problem would be though, what if I connect a screen and a disk drive and others to one cable? How would the computer be able to adress them?

#3 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 14 March 2012 - 02:03 PM

well, the cable would "expand" computer sides, (to a total of maybe 4 'virtual' sides) and everything connected to the cable would be considered attached to the computer as if it was right beside it.

#4 Neowulf

  • Members
  • 33 posts

Posted 14 March 2012 - 02:56 PM

I like Liraal's idea.

Lavawire cabling.
lavawire.init(side) - Initializes the connection.
lavawire.close(side) - Breaks the connection
lavawire.list(side) - Returns list of all device types connected to the lavawire cable
lavawire.mount(side, device#, virtualside) - Mounts the device conneted to the lavawire cable to a given virtual side
lavawire.mountFs(side, device#) - mounts the lavawire conneteced computer/turtle block's file system to the "lavashared" folder of the host OS

Lavawire only has a 4 block range (no more than 4 pieces of cable between the device and the host). Maybe extended by hub blocks?

#5 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 19 March 2012 - 08:23 PM

A nice idea. Would be really useful if you want to connect peripherals but don't want to interact/see the computer

#6 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 19 March 2012 - 08:29 PM

only one problem though. coding such a thing does require access to the source code, so basically only dan can do it.

#7 DZCreeper

  • Members
  • 36 posts

Posted 20 March 2012 - 05:40 AM

Guys, can't you just decompile to get source code of computercraft?

#8 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 20 March 2012 - 08:22 AM

View PostDZCreeper, on 20 March 2012 - 05:40 AM, said:

Guys, can't you just decompile to get source code of computercraft?
Yes we could but that isn't really allowed. We would have to get permissions by dan first

#9 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 20 March 2012 - 11:48 AM

View PostLiraal, on 19 March 2012 - 08:29 PM, said:

only one problem though. coding such a thing does require access to the source code, so basically only dan can do it.

Why does it? Surely the interface is easy enough to understand - it's just a case of interacting with peripherals and passing the data back to ComputerCraft. You'd pretty much be a transparent proxy. Multiple peripherals to one cable would be more complex, but not impossible.

#10 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 20 March 2012 - 02:16 PM

View PostCloudy, on 20 March 2012 - 11:48 AM, said:

Why does it? Surely the interface is easy enough to understand - it's just a case of interacting with peripherals and passing the data back to ComputerCraft. You'd pretty much be a transparent proxy. Multiple peripherals to one cable would be more complex, but not impossible.
Yeah you've got a point in there. I would try if I would understand modding a little bit

#11 Jojo.bacon

  • Members
  • 20 posts

Posted 21 March 2012 - 01:58 AM

Maybe each peripheral will be assigned an id like computers? That way you could have multiple peripherals on one cable.

#12 OmegaVest

  • Members
  • 436 posts

Posted 23 March 2012 - 05:42 PM

View PostMrjoecool123, on 21 March 2012 - 01:58 AM, said:

Maybe each peripheral will be assigned an id like computers? That way you could have multiple peripherals on one cable.

Let's not start giving peripherals unique ids. Maybe unique to one side. Attach a disk drive, a monitor, and a turtle to one side's lavacable (I like that, btw), and each would get a number. remove one and replace it with something else (such as removing the turtle and replacing it with another disk drive) and the number is reassigned.

Blatantly I give an example (because I cannot be otherwise eloquent about it):

pList = lavawire.list(side)
for x = 1, pList.len do
if pList(x) == "disk" then
os.copy(path/file,disk.getMountPath(getPeripheral(x))/file)
end
end
etc.



Mass disk writer. For the purposes of this particular code fragment,itallics are pseudo, bold is unmentioned, user-created content. It comes out easier if I just make stuff up as I go. Also why no code tags.

#13 Sebra

  • Members
  • 726 posts

Posted 24 March 2012 - 04:52 AM

What if Peripheral has two cables connected?
What if Peripheral connected with a cable by several sides?
What if you make one cable from two with intersecting sets of Peripherals?

#14 OmegaVest

  • Members
  • 436 posts

Posted 24 March 2012 - 06:43 AM

View PostSebra, on 24 March 2012 - 04:52 AM, said:

What if Peripheral has two cables connected?

You can already connect peripherals to multiple terminals. Monitors don't like it so much, but I use disk drives like quick-copy machines all the time. It's actually how my turtle network works right now.

Quote

What if Peripheral connected with a cable by several sides?

A single cable would only recognize one block the one time, no matter how many cables are attached to it. See: Industrialcraft2 wires that only feed a machine once, even when there are multiple cables attached.

Quote

What if you make one cable from two with intersecting sets of Peripherals?

I don't quite understand what you are trying to ask here, but from what I can tell, you are asking about exactly what this latter discussion has been about. Connecting multiple peripherals to multiple computers would have to reference from the terminals, not globally. This is what I was trying to get at in my post. If I've missed something, tell me about it in the morning.

To reiterate: Two computers on a single line would individually look at the line when a new peripheral was attached (peripheral and peripheral_detach). Independently of each other, they would compile a list of peripherals on the line. In fact, you could make sub-sets on a single line by making them a certain space away, if lavawire was implemented. Put three disk drives in the center, with two further wires to each side. I would continue, but I think I made my point, and I'm getting worked up. Rise-Against + late night + pepsi max = not good, assuming good is true.

#15 Sebra

  • Members
  • 726 posts

Posted 24 March 2012 - 07:23 AM

I mean peripheral id is not good idea. If you reuse id on different cables you'll be in bad situations when connect two cables. And should peripheral has different id for different cable?
In another thought peripherals should have internal ids already.
May be cable should be peripheral, which translate methods from {"north","south","west","east","top","bottom"} sides? Like that:
cable=peripheral.wrap("right")
disk=cable.wrap("north")
mon=cable.wrap("top")
It can be done as peripheral without Dan200 efforts. With or without lenght check.

If I'm not mistaken IC2 cables feed each side of machine. Can be wrong, not tested, just read somewhere.

#16 kamnxt

  • New Members
  • 80 posts

Posted 25 March 2012 - 01:51 PM

There could be a lavaconnector(?). You connect it like this:
[C][L][W][W][L][P]
C = computer, L = lavaconnector, W = lavawire, P = peripheral.
The lavaconnectors could have:
1. Colors (a dye in the recipe?)
2. Unique IDs
3. IDs you could set from a computer
If they would be colored, the lavawire would change the color to the color of the lavaconnector connected to the computer. It would only connect to lavaconnectors and lavawires with the same color. The cables would call the peripherals like this:
m = peripheral.wrap("back") --The lavaconnector
disk.eject(m.disk1) -- ejects the disk from the first disk drive...
m.monitor1.write("Monitor") --Writes "Monitor" to the first monitor...
They would label them like a computer labels disks.

#17 grinchfox

  • New Members
  • 16 posts

Posted 25 March 2012 - 05:55 PM

Posted Image
what do you think about this scheme?

Posted Image Cable

connects like red alloy wire in RP2 or something like that. Can be connected to pc and connector/controller.

Posted Image Connector/controller


It can be colored to make difference between them, it doesnt needs and UID.

It can have direction.

Posted Image Computer
Posted Image Floppy drive
Posted Image Monitor

Rules:


Each peripheral can be connected to multiplie connectors/controllers.

To get peripheral wee ned only side where cable is connected to computer and color of the connector/controller.

If there more than one connector/controller with single color then (first found / nearest by cable) will be returned.

Each peripheral have its metatable so it can be used as class.


Pseudo code to use:
monitor1 = cable.get("right","red")
monitor1.write("Hello!")
floppy = cable.get("right","green")
print(floppy.diskName)
floppy.eject()

something like that ?

#18 Wolvan

  • New Members
  • 384 posts
  • LocationIn the TARDIS

Posted 25 March 2012 - 07:22 PM

Sounds like a plan. And you could have one type of peripheral connected to 1 color and you could write use multiple peripherals at once with tha methode

#19 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 25 March 2012 - 08:29 PM

Hmm... I don't understand why you have to complicate things. Surely you can just place peripherals next to the cable and it will detect them? Saves messing about.

#20 grinchfox

  • New Members
  • 16 posts

Posted 25 March 2012 - 08:41 PM

View PostCloudy, on 25 March 2012 - 08:29 PM, said:

Hmm... I don't understand why you have to complicate things. Surely you can just place peripherals next to the cable and it will detect them? Saves messing about.
I think the problem is in indexing peripherals in computer. I dont mind adding UID to monitors and floppys but its kinda compicated to use. So easier way is separate everything by color, its kids game :3





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users