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

Is There A Way To Get Maps To Display On A ComputerCraft Monitor?

Started by SmirkNMerc, 06 June 2013 - 09:05 AM
SmirkNMerc #1
Posted 06 June 2013 - 11:05 AM
I am a relative newbie to ComputerCraft and Lua so I am not aware if what I want to do is possible or not. What I'd like to do is create a navigation computer of sorts. I play the Direwolf20 pack and when I explore the map and find new villages I like to name and mark them with waypoints. Also I like to create a linking book from MystCraft so that I can travel quickly across the map to these locations. However as I explore the more books I create the more space I need within my base to display them. I had an idea to use turtles pull the books from an inventory and place the book of my desired destination as needed on to a book-stand or lectern. As I thought more about it I would love if I could create a monitor with a GUI where I could select a village that would be displayed on a map and a turtle would then place the corresponding book on the lectern. Is something like this at all possible to do? And if so what will I need to to achieve this?
Lyqyd #2
Posted 06 June 2013 - 08:09 PM
Split into new topic.
Bomb Bloke #3
Posted 06 June 2013 - 09:18 PM
I'm not familiar with MystCraft (been wanting to install it for the "coolness" of playing with it, but have yet to determine a practical reason to do so), but this sounds possible. The only question in my mind is whether a turtle can put a book on a lectern.

That, and how best to do it. You'd be looking at a fairly complex script, perhaps a fairly complex set of scripts, depending on how many books you're talking about.

You would need to firstly have a system to draw a map. That's pretty simple. You'd then need an additional table that keeps track of which locations have books associated with them.

When you click on a given spot, the script would need to determine where the book is. Easiest way I can see to do that is to just have a turtle (or an army thereof depending on how many books you want held) with all the books in its inventory, in the order in which they were added to the map. Click on a spot, the program says "I want the book for the x'th spot", the turtle puts book x on the lectern and then collects it ten seconds or so later.

To add a book, you'd press a certain key while hovering your mouse over the map, then put the book in a special chest. The program would work out which turtle has the next free inventory spot and send that one to suck up the book from the chest. Not putting the book in the chest would be a simple way of cancelling the operation - if the turtle fails to find a book, then the location doesn't get added.

Removing books from the system would not be nearly so easy.
theoriginalbit #4
Posted 06 June 2013 - 11:40 PM
The only question in my mind is whether a turtle can put a book on a lectern.
Yes it can.

I would suggest that you do a similar setup to what Direwolf20 did once. Have 5 turtles around a receptacle (that is linked to a portal), that gives you 80 books (5 turtles *16 slots). Then have the touch screen send a message to whichever turtle contains the book you desire, it places in the book with turtle.drop, then after a few seconds gets it back with turtle.suck. then all you need to do is not allow the user to select multiple locations at once on the touchscreen and you're good. A simple setup for your book information would be this:

local bookInfo = {
  { bookTitle = "Village in the jungle", --# what to display on the monitor
    turtleId = 6, --# the ID of the turtle containing the book
    slotId = 14, --# the slot the book is in
  },
  { bookTitle = "The motherload", turtleId = 6, slotId = 15 },
  { bookTitle = "Unnamed 1", turtleId = 6, slotId = 16 },
  { bookTitle = "Unnamed 2", turtleId = 6, slotId = 13 },
  -- etc, etc, etc...
}
SmirkNMerc #5
Posted 07 June 2013 - 03:13 AM
I'm not familiar with MystCraft (been wanting to install it for the "coolness" of playing with it, but have yet to determine a practical reason to do so), but this sounds possible. The only question in my mind is whether a turtle can put a book on a lectern.

That, and how best to do it. You'd be looking at a fairly complex script, perhaps a fairly complex set of scripts, depending on how many books you're talking about.

You would need to firstly have a system to draw a map. That's pretty simple. You'd then need an additional table that keeps track of which locations have books associated with them.

When you click on a given spot, the script would need to determine where the book is. Easiest way I can see to do that is to just have a turtle (or an army thereof depending on how many books you want held) with all the books in its inventory, in the order in which they were added to the map. Click on a spot, the program says "I want the book for the x'th spot", the turtle puts book x on the lectern and then collects it ten seconds or so later.

To add a book, you'd press a certain key while hovering your mouse over the map, then put the book in a special chest. The program would work out which turtle has the next free inventory spot and send that one to suck up the book from the chest. Not putting the book in the chest would be a simple way of cancelling the operation - if the turtle fails to find a book, then the location doesn't get added.

Removing books from the system would not be nearly so easy.
The only question in my mind is whether a turtle can put a book on a lectern.
Yes it can.

I would suggest that you do a similar setup to what Direwolf20 did once. Have 5 turtles around a receptacle (that is linked to a portal), that gives you 80 books (5 turtles *16 slots). Then have the touch screen send a message to whichever turtle contains the book you desire, it places in the book with turtle.drop, then after a few seconds gets it back with turtle.suck. then all you need to do is not allow the user to select multiple locations at once on the touchscreen and you're good. A simple setup for your book information would be this:

local bookInfo = {
  { bookTitle = "Village in the jungle", --# what to display on the monitor
	turtleId = 6, --# the ID of the turtle containing the book
	slotId = 14, --# the slot the book is in
  },
  { bookTitle = "The motherload", turtleId = 6, slotId = 15 },
  { bookTitle = "Unnamed 1", turtleId = 6, slotId = 16 },
  { bookTitle = "Unnamed 2", turtleId = 6, slotId = 13 },
  -- etc, etc, etc...
}

Thanks for taking the time to read and reply. This is great advice that I will work on. I have another question for you Bomb Bloke regarding maps. I wasn't clear before. I want to take vanilla maps and display them on advanced monitors somehow. Is that possible?
Bomb Bloke #6
Posted 07 June 2013 - 03:32 AM
I'm not aware of any way to do that, at least, not using actual vanilla map items. But I'm still relatively new to ComputerCraft and there are more then a few mods available to augment its capabilities. There might be something out there that does just that. (Surely someone's wanted to put a world map up on the big screen? Picture frames just don't cut it…)

Frankly though, I suspect you're better off making your own custom map display. You can likely make something that's a lot easier to read then a "proper" map if you use a little stylisation, and it seems to me that regular characters would be the easiest way. Or just rig up the paint program and draw something - it doesn't even have to be accurate.
theoriginalbit #7
Posted 07 June 2013 - 04:43 AM
I vaguely remember something with OpenCCSensors that did something with a map… I think…

EDIT: Oh ok, it seems that this is what I was remembering…
Spoilerhttp://www.youtube.com/watch?feature=player_embedded&v=i8Bv7uKkIOM#t=453s
Edited on 07 June 2013 - 02:45 AM
SmirkNMerc #8
Posted 07 June 2013 - 11:19 PM
I'm not aware of any way to do that, at least, not using actual vanilla map items. But I'm still relatively new to ComputerCraft and there are more then a few mods available to augment its capabilities. There might be something out there that does just that. (Surely someone's wanted to put a world map up on the big screen? Picture frames just don't cut it…)

Frankly though, I suspect you're better off making your own custom map display. You can likely make something that's a lot easier to read then a "proper" map if you use a little stylisation, and it seems to me that regular characters would be the easiest way. Or just rig up the paint program and draw something - it doesn't even have to be accurate.
I vaguely remember something with OpenCCSensors that did something with a map… I think…

EDIT: Oh ok, it seems that this is what I was remembering…
Spoilerhttp://www.youtube.c...v7uKkIOM#t=453s

Thanks for your input guys. I'll keep you posted on what I come up with. I just wanted to make sure if I was aware of whats possible. OpenCCSensors is really interesting. Especially the inventory sensor. I have a few ideas from that.