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

umbjolt

Wild jolteon
Member
Joined
Sep 15, 2016
Messages
558
Trophies
0
Age
27
Location
Magnolia, Fiore
XP
316
Country
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.
 

Rinnegatamante

Well-Known Member
OP
Member
Joined
Nov 24, 2014
Messages
3,162
Trophies
2
Age
29
Location
Bologna
Website
rinnegatamante.it
XP
4,857
Country
Italy
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

cere_ender

Active Member
Newcomer
Joined
Jul 7, 2015
Messages
44
Trophies
0
Age
31
XP
97
Country
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,

windows_server_2003

Well-Known Member
Newcomer
Joined
Jul 13, 2017
Messages
84
Trophies
0
Age
44
XP
379
Country
Japan
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.
 

Ev1l0rd

(⌐◥▶◀◤) girl - noirscape
Member
Joined
Oct 26, 2015
Messages
2,004
Trophies
1
Location
Site 19
Website
catgirlsin.space
XP
3,441
Country
Netherlands
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.
 

MissingNO123

Jigglypuff
Member
Joined
Nov 24, 2012
Messages
203
Trophies
0
Location
hell
XP
304
Country
Canada
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.
 

Joel16

Ils ne passeront pas
Member
Joined
May 8, 2011
Messages
933
Trophies
2
Age
27
Location
Doesn't concern you.
XP
5,302
Country
United States
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

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: It's a kid's vitamin now!