Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
  • 0
h245

Geolyzer + Hologram Projector trouble

Question

I recently made my first holographic projector and geolyzer and Ive beent ryting to use them to display a 3d map of the area I'm in. Here's what I'm trying to do:

local component = require("component")\
local geolzyer = component.geolzyer
local hologram = component.hologram

hologram.clear()
for x = 1, 32 do
	for z = 1, 32 do
		local myTable = geolzyer.scan(x,z)
		for y = 1,32 do
			if myTable[y] > 0 then
				hologram.set(x,y,z,1)
			end
		end
	end
end
				

It runs fine for a while, but about 2/3 of the way it gives the following message:

"Attempt to index local 'myTable' (a nil value)" on line 10 (the if statement). Any idea as to what might be causing this?

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

The geolyzer scans an entire column and returns the results for the individual blocks in a table, which are then used in the next if cycle.

Also I figured out the problem.

hologram.clear()
for x = 1, 32 do
    for z = 1, 32 do
        local myTable = geolzyer.scan(x,z)
        for y = 1,32 do
            if myTable then
                if myTable[y] > 0 then
                    hologram.set(x,y,z,1)
                end
            end
        end
    end
end
 

However I ran into a new one. When the whole scan is done, there are vertical holes all the way through. Any idea what might be causing this?

 

Edit: Turns out the holes are the result of the geolyzer not receiving enaugh power and stopping for a moment, thus skipping a column. One capacitor later, everything is runnig as it should.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.