yeah so basically just make it so when a monitor is punched it queues a event with where it was punched (probably which row/column in characters)
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Touchscreen Monitors
Started by Pinkishu, 19 July 2012 - 10:06 AMPosted 19 July 2012 - 12:06 PM
Hi there,
yeah so basically just make it so when a monitor is punched it queues a event with where it was punched (probably which row/column in characters)
yeah so basically just make it so when a monitor is punched it queues a event with where it was punched (probably which row/column in characters)
Posted 19 July 2012 - 12:20 PM
I think its a great idea!
Posted 19 July 2012 - 01:04 PM
Maybe even differing left and right clicks.
Posted 19 July 2012 - 03:24 PM
Not sure if it would be possible to detect the row and column in characters, maybe wich monitor block.
Posted 19 July 2012 - 03:40 PM
Well you could get the the yaw and pitch of the player, his position and the coords of the block clicked on. You could make your own raytracking with that and could then calculate the row and collom in chars.
Posted 19 July 2012 - 05:28 PM
Are you aware of how tedious that is?Well you could get the the yaw and pitch of the player, his position and the coords of the block clicked on.
Posted 19 July 2012 - 06:01 PM
Well it's possible. I don't want to do this in lua at all if that's what you meant. But I know that the method that get's called when the block is clicked doesn't give information about where the block got clicked. You would only have to this once in the java code of the monitor.
Posted 19 July 2012 - 06:14 PM
I don't mean to be a negative nancy, in fact I'm attempting to be a positive paul now;
This is a very large undertaking as a feature in the manner that you've suggested xuma. This would best be offered as it's own suggestion on the forum. It is no small feat and minimizing it as "'only' 'having' to do it once' does the idea a disservice. It is a good idea, I'm just trying to bring into realistic perspective that it's a time consuming task in both code and flow-charting(plotting out the logic).
This is a very large undertaking as a feature in the manner that you've suggested xuma. This would best be offered as it's own suggestion on the forum. It is no small feat and minimizing it as "'only' 'having' to do it once' does the idea a disservice. It is a good idea, I'm just trying to bring into realistic perspective that it's a time consuming task in both code and flow-charting(plotting out the logic).
Posted 19 July 2012 - 06:32 PM
Dan didn't wanted the mouse in ComputerCraft, So I think also not Touchscreen.
Posted 19 July 2012 - 06:47 PM
It still seems as you've not completely understood my intention so I'll give a better explanation now.
I've suggested nothing at all. I've just give an idea of how this, finding out on which char of of the monitor the user has clicked, could be internally realized.
My initial post was an answer to what MysticT said
As far as I know there is no way to get information about where on a block the user clicked, in minecraft. So I was thinking about a way to get this information and one way for me since I've already made my own experiences in Game development seemed ray-tracking the click.
Maybe you can do this in another faster or simpler way but I only wanted to show that it is at least possible.
Back to your worries about the complexity of this solution: You would have to sit down for 1/2 an hour maybe and think of a way expressing this in mathematical terms but this is programming. I promise it's really not that hard if you have a basic understanding of the rate of Pythagoras, circular functions and/or matrix multiplication. I know what I'm talking about. :P/>/>
Ok. Maybe someone makes a peripheral.
If not I will at least try it, but since I don't have access to the CC code and don't want to re-code the CC Monitor I'll probably only make something like a touch pen. We'll see.
I've suggested nothing at all. I've just give an idea of how this, finding out on which char of of the monitor the user has clicked, could be internally realized.
My initial post was an answer to what MysticT said
Not sure if it would be possible to detect the row and column in characters, maybe wich monitor block.
As far as I know there is no way to get information about where on a block the user clicked, in minecraft. So I was thinking about a way to get this information and one way for me since I've already made my own experiences in Game development seemed ray-tracking the click.
Maybe you can do this in another faster or simpler way but I only wanted to show that it is at least possible.
Back to your worries about the complexity of this solution: You would have to sit down for 1/2 an hour maybe and think of a way expressing this in mathematical terms but this is programming. I promise it's really not that hard if you have a basic understanding of the rate of Pythagoras, circular functions and/or matrix multiplication. I know what I'm talking about. :P/>/>
Dan didn't wanted the mouse in ComputerCraft, So I think also not Touchscreen.
Ok. Maybe someone makes a peripheral.
If not I will at least try it, but since I don't have access to the CC code and don't want to re-code the CC Monitor I'll probably only make something like a touch pen. We'll see.
Posted 19 July 2012 - 09:26 PM
Ok I've found out that creating a peripheral for purpuse is almost impossible, without access to the CC source
Posted 20 July 2012 - 07:58 PM
Well MC already seems to know where you point :)/>/> So it has some kind of function for that :o/>/>
Just looked it up
hitVec looks like what coul dbe used for that?
Just looked it up
hitVec looks like what coul dbe used for that?
Posted 20 July 2012 - 09:47 PM
Well MC already seems to know where you point :)/>/> So it has some kind of function for that :o/>/>
Just looked it up
hitVec looks like what coul dbe used for that?
Great! That's what I need. Only problem will be compatibly with ARP since i can't guess the coords of the monitor based on the on side it's attached to anymore. But I've already got an idea for that.
Posted 20 July 2012 - 11:33 PM
Well i don't see how it would work as a peripheral unless you remake teh whole monitor peripheral
Posted 21 July 2012 - 10:22 AM
A Touch Pen. It's an item and when you use it I test if the clicked Block was a Monitor.
I only had to "hack" CC to find out how I can get information about orientation, size, and the position of the block in the quad of Monitors (Monitor is 5x3 blocks and you've clicked on the top-left (block) monitor).
I'll not redistribute/reuse any of the Computercrafts code. I just catch the NBT Tag Compound that get's written by the TileEntity. And read out the needed information from that.
I can now test every known Monitor peripheral (Only the ones directly attached to a Computer) if they are within the Rectangle of Monitors (Monitor is nXm blocks) the clicked Monitor is part of.
Now I have an IComputeraccess for all Computers connected to the Monitor. So I can queue an Event for them.
To know the Monitors attached to a Computer, the user will have to call ,only as often as the Monitor get's wrapped again, a function of my Peripheral the "Pen Dock" telling it also only the side of the Monitor.
If the Monitor is attached to a Peripheral Cable (ARP) the user has to give the coordinates of the Monitor Block directly connected to the Cable since I can't guess them anymore.
I hope you can understand what I mean. My English is not perfect and these sentences are way too complicated. :)/>/>
I only had to "hack" CC to find out how I can get information about orientation, size, and the position of the block in the quad of Monitors (Monitor is 5x3 blocks and you've clicked on the top-left (block) monitor).
I'll not redistribute/reuse any of the Computercrafts code. I just catch the NBT Tag Compound that get's written by the TileEntity. And read out the needed information from that.
I can now test every known Monitor peripheral (Only the ones directly attached to a Computer) if they are within the Rectangle of Monitors (Monitor is nXm blocks) the clicked Monitor is part of.
Now I have an IComputeraccess for all Computers connected to the Monitor. So I can queue an Event for them.
To know the Monitors attached to a Computer, the user will have to call ,only as often as the Monitor get's wrapped again, a function of my Peripheral the "Pen Dock" telling it also only the side of the Monitor.
If the Monitor is attached to a Peripheral Cable (ARP) the user has to give the coordinates of the Monitor Block directly connected to the Cable since I can't guess them anymore.
I hope you can understand what I mean. My English is not perfect and these sentences are way too complicated. :)/>/>
Posted 21 July 2012 - 12:56 PM
Make a peripheral…
It should be added (IMO).
EDIT: 300'th POST!
It should be added (IMO).
EDIT: 300'th POST!
Posted 21 July 2012 - 01:19 PM
Already working on it. And till now I'm sure it'll work.
Seems like there will be no peripheral Cable compability since I would have to let the user tell me the Coordinates and because I can't verify whether the Monitor is truely connected to the Computer the Peripheral could be easily tricked.
Seems like there will be no peripheral Cable compability since I would have to let the user tell me the Coordinates and because I can't verify whether the Monitor is truely connected to the Computer the Peripheral could be easily tricked.
Posted 21 July 2012 - 10:01 PM
STATUS update: Almost finished only need to make some textures and a Lua API.
Posted 22 July 2012 - 12:23 AM
Ok NOW I've encountered a huge Problem.
I'm done! Only thing is mapping the hit Position on Block to the Characters.
I'm done! Only thing is mapping the hit Position on Block to the Characters.
Posted 22 July 2012 - 01:49 PM
Ok I've now released. It'll not give you the Row and Column since that would be very very complicated. At least you can test if the hit is in a predefined square on your own. :)/>/> link
Posted 04 August 2012 - 12:02 PM
http://www.picz.to/image/171I <– Pen Texture