Homebrew [Release] Lua Player Plus 3DS (lpp-3ds) - LUA interpreter for 3DS

  • Thread starter Thread starter Rinnegatamante
  • Start date Start date
  • Views Views 187,228
  • Replies Replies 1,199
  • Likes Likes 35
With this portion of code i can't say you where you're wrong. What setNewREfresh does? (Also the ; is not used in lua for the sequence command).

P.s. Java and C both have whiles or they couldn't be called Touring complete languages like they are.
Thanks for answering.
This is setNewRefresh()

Code:
function setNewRefresh()
    Screen.refresh()
    Screen.clear(BOTTOM_SCREEN)

    oldH, oldMin , oldSeg = System.getTime()        
    time= oldH.. ':' .. oldMin .. ':' .. oldSeg
   
    Screen.debugPrint(0,0, time, Color.new(55,255,0), BOTTOM_SCREEN)

    Screen.flip()
end

Sorry if I mistake.
Thanks.
 
Thanks for answering.
This is setNewRefresh()

Code:
function setNewRefresh()
    Screen.refresh()
    Screen.clear(BOTTOM_SCREEN)

    oldH, oldMin , oldSeg = System.getTime()       
    time= oldH.. ':' .. oldMin .. ':' .. oldSeg
  
    Screen.debugPrint(0,0, time, Color.new(55,255,0), BOTTOM_SCREEN)

    Screen.flip()
end

Sorry if I mistake.
Thanks.

I don't get what you're trying to do. You call two getTime in something like 50/100 ms. It obviously won't update your screen. (You're also missing Screen.waitVblankStart).
 
  • Like
Reactions: umbjolt
Hello, I'm having troubles to calculating an array of tiles. When I calculate the Cartesian to Isometric coordinates I have black spaces that I can't resolve. Help is appreciated! Thank you!

43c6a36ec6e0402b90793ce28da48f93.png


Code:
Graphics.init()
tile1 = Graphics.loadImage("/tile0.png")
tile2 = Graphics.loadImage("/tile2.png")

boardSize = 5
tileSizeX = 64
tileSizeY = 32

board = { {1,1,1,1,1},
          {1,0,0,0,1},
          {1,0,0,0,1},
          {1,0,0,0,1},
          {1,1,1,1,1}
          }
     

     

function cartToIso(pointX,pointY)
  local resX=(pointX-pointY)
  local resY=(pointX+pointY)/2
  return resX, resY
end


Screen.refresh()
  Graphics.initBlend(TOP_SCREEN)
  for i=1,boardSize do
    for j=1,boardSize do
 
      local tileX = j * tileSizeX
      local tileY = i * tileSizeY
 
      tileX, tileY = cartToIso(tileX,tileY)
 
      if board[i][j] == 0 then
        Graphics.drawImage(tileX,tileY, tile1)
      end
      if board[i][j] == 1 then
        Graphics.drawImage(tileX,tileY, tile2)
      end
     end
  end
  --  j=1-> (32, 48)
  --  j=2-> (96, 80)
  Graphics.termBlend()
  Screen.flip()
--[[    Screen.waitVblankStart()--]]
while true do

  if Controls.check(Controls.read(),KEY_A) then
  Graphics.term()
  System.exit()
  end

end

tile0.png
tile2.png


EDIT: I don't know why, but adding "/2" on the tileX calculation did the job.
Code:
local tileX = j * tileSizeX /2
local tileY = i * tileSizeY
But I read this article and went throught the steps and anywhere says I have to do the half of the tileSizeX: https://gamedevelopment.tutsplus.co...ds-a-primer-for-game-developers--gamedev-6511
 
Last edited by cere_ender,
I downloaded lpp-3ds and putted "lpp-3ds.3dsx" and "lpp-3ds.smdh" to /3ds/lpp-3ds/ and I placed "/Samples/Miscellaneous/math.lua" to /3ds/lpp-3ds/index.lua, but it doesn't run.Luma says "prefetch abort" and if i turn off the exception handlers, it stops.Top screen is black and bottom screen is red.

Also .cia from .elf version doesn't run.it says File doesn't exist.but index.lua is also the root of my SDcard.
Sorry for my English.
 
I downloaded lpp-3ds and putted "lpp-3ds.3dsx" and "lpp-3ds.smdh" to /3ds/lpp-3ds/ and I placed "/Samples/Miscellaneous/math.lua" to /3ds/lpp-3ds/index.lua, but it doesn't run.Luma says "prefetch abort" and if i turn off the exception handlers, it stops.Top screen is black and bottom screen is red.

Also .cia from .elf version doesn't run.it says File doesn't exist.but index.lua is also the root of my SDcard.
Sorry for my English.
You are better off contacting him on twitter. He hasn't visited the temp since October last year.
 
I downloaded lpp-3ds and putted "lpp-3ds.3dsx" and "lpp-3ds.smdh" to /3ds/lpp-3ds/ and I placed "/Samples/Miscellaneous/math.lua" to /3ds/lpp-3ds/index.lua, but it doesn't run.Luma says "prefetch abort" and if i turn off the exception handlers, it stops.Top screen is black and bottom screen is red.

Also .cia from .elf version doesn't run.it says File doesn't exist.but index.lua is also the root of my SDcard.
Sorry for my English.
index.lua has to be located at the root of the romfs if you are running it as a CIA.
 
I downloaded lpp-3ds and putted "lpp-3ds.3dsx" and "lpp-3ds.smdh" to /3ds/lpp-3ds/ and I placed "/Samples/Miscellaneous/math.lua" to /3ds/lpp-3ds/index.lua, but it doesn't run.Luma says "prefetch abort" and if i turn off the exception handlers, it stops.Top screen is black and bottom screen is red.

Also .cia from .elf version doesn't run.it says File doesn't exist.but index.lua is also the root of my SDcard.
Sorry for my English.

You're better off not using this.
 

Site & Scene News

Popular threads in this forum