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

[v1.481][SMP/SSP] startup, setTextScale and multi-monitor oddity

Started by Rihlsul, 11 March 2013 - 06:07 AM
Rihlsul #1
Posted 11 March 2013 - 07:07 AM
So, I was tinkering with a larger project, then started running into situations where if I changed setTextScale to 0.5, it wouldn't output anything at all. Here's the program in /rom/programs/wallpaper:


local tArgs = { ... }
local monitorSide = ""
if (tArgs[1] ~= nil) then
  monitorSide = tArgs[1]
else
  monitorSide = "front"
end
local mon = peripheral.wrap(monitorSide)
mon.clear()
mon.setCursorPos(1,1)
mon.setTextScale(0.5)
local lineno = 1

if fs.exists("wallpaper.txt") then
  local f = fs.open("wallpaper.txt","r")
  local t = f.readLine()
  while t ~= nil do
	mon.write(t)
	mon.setCursorPos(1,lineno)
	lineno = lineno + 1
	t = f.readLine()
  end
  f.close()
else
  mon.write("No wallpaper.txt found.")
end

When I run "wallpaper" (with a text file), it outputs just fine. In that same computer, the startup contains only:


shell.run("wallpaper")

Nothing outputs. If I comment out the setTextScale from wallpaper, startup prints the text file to the monitor (in this case, 6x6 monitors) just fine.

With the setTextScale, it also works just fine from any monitors set that's 2x2, 3x3, 4x4, but as soon as I hit 5x5 or 6x6 (my target), it does not work.
Bubba #2
Posted 11 March 2013 - 06:24 PM
I can verify this for CC 1.5, MC 1.4.7. It only happens on startup with the text scale set to 0.5. If I sleep for 1 second before writing to the monitor, it works fine. Anything under and it doesn't display.
Rihlsul #3
Posted 12 March 2013 - 06:28 AM
Oh excellent - I hadn't tried the sleep workaround. Thank you! Did you put the sleep in startup or the program called?



As an aside, I can't fix my topic title, but I'll make sure to format them correctly from herein.

Version info: Tekkit 0.5.7, which I think is MC version 1.4.7 with CC version v1.481.
Bubba #4
Posted 12 March 2013 - 06:59 AM
Oh excellent - I hadn't tried the sleep workaround. Thank you! Did you put the sleep in startup or the program called?

I actually just tested this with just a single startup program that did not call any others. I don't imagine that there would be any difference, unless it takes over a second to load up the second program.

I think you can change the title if you edit your first post and then hit "Use Full Editor". :)/>
Rihlsul #5
Posted 12 March 2013 - 09:03 AM
Confirmed. If I just add a 1 second sleep after the scale change in the program, it succeeds, even in the full 6x6.
ramdor72 #6
Posted 22 May 2013 - 02:31 PM
Confirmed, and exists in 1.53pr2. If I place a sleep as recommended above all seems ok. If I log out (chunk loader keeps area running) and log back in, the displays are messed up. Happens to any monitor grid >= 5 width or height and a text scale of 0.5.

I'll check for a beta bug report on the issue.
ramdor72 #7
Posted 24 May 2013 - 06:47 PM
btw, this also happens in 1.53 latest release, although my vid was for 1.53pr2

see http://www.computerc...834#entry119834