Thanks, that did the trick.you should changetoCode:testmap = io.open("/test.lua", FREAD)Code:testmap = io.open(System.currentDirectory().."/test.lua", FREAD)
Thanks, that did the trick.you should changetoCode:testmap = io.open("/test.lua", FREAD)Code:testmap = io.open(System.currentDirectory().."/test.lua", FREAD)
Error: [string "?"]:120: attempt to index a nil value (field '?')

I'm at my wit's end with a bug in my code that I've come across.
The error message is
and shows up when I try to launch my program's file browser.Code:Error: [string "?"]:120: attempt to index a nil value (field '?')
But I've checked all my scripts and even after commenting out the two scripts which have a table reference on line 120, I get the same error.
I then decided to add empty lines to the start of all my scripts to figure out which one it is, but it still says the error is at line 120.
If you don't post your script, we can't help you.
Graphics.drawImage(0,0, img_arc_filebrowser_board, white)
Graphics.drawImage(9,46+ (selector-1-selector_scroll)*13, img_arc_filebrowser_selector, white)
--[[
if filebrowser_arc_dir[selector-1] ~= nil then
if filebrowser_arc_info[filebrowser_arc_dir[selector-1].name] ~= nil then
gpu_drawtext_ml(214,39, filebrowser_arc_info[filebrowser_arc_dir[selector-1].name], c15, 73)
else
gpu_drawtext_ml(214,39, "NO INFO ON THIS FILE", c15, 73)
end
end
]]--
if filebrowser_arc_dirsize > 10 then
Graphics.drawImage(196,41, img_arc_filebrowser_scrollbar, white)
local bb=0 --bar begin
local be=0 --bar end
bb = math.floor(selector_scroll/(filebrowser_arc_dirsize+1) * 141) --the size of the scrollbar's drawable space (197,47 to 199,187)
be = math.ceil((selector_scroll+11)/(filebrowser_arc_dirsize+1) * 141)
Graphics.fillRect(197, 200, 47+bb, 47+be, c90)
end
local c = 0
local i=0
if selector_scroll == 0 then
if selector==1 then c = c90 else c = c15 end
Graphics.drawImage(11,47, filebrowser_arc_dir[0].icon, c)
gpu_drawtext(29,51, "..", c)
i=i+1
end
while i<filebrowser_arc_dirsize+1 and i<11 do
--i is the slot on the screen, selector is the number selected, selector_scroll is the offset of the screen
glyph_l['F'],glyph_r['F'] = 61,63
glyph_l['G'],glyph_r['G'] = 65,67
glyph_l['H'],glyph_r['H'] = 69,71
glyph_l['I'],glyph_r['I'] = 73,75
glyph_l['J'],glyph_r['J'] = 77,79
glyph_l['K'],glyph_r['K'] = 81,83
glyph_l['L'],glyph_r['L'] = 85,87
glyph_l['M'],glyph_r['M'] = 89,95
glyph_l['N'],glyph_r['N'] = 97,99
glyph_l['O'],glyph_r['O'] = 101,103
glyph_l['P'],glyph_r['P'] = 105,107
glyph_l['Q'],glyph_r['Q'] = 109,111
glyph_l['R'],glyph_r['R'] = 113,115
glyph_l['S'],glyph_r['S'] = 117,119
glyph_l['T'],glyph_r['T'] = 121,123
glyph_l['U'],glyph_r['U'] = 125,127
glyph_l['V'],glyph_r['V'] = 129,131
glyph_l['W'],glyph_r['W'] = 133,139
glyph_l['X'],glyph_r['X'] = 141,143
glyph_l['Y'],glyph_r['Y'] = 145,147
glyph_l['Z'],glyph_r['Z'] = 149,151
glyph_l["'"],glyph_r["'"] = 153,155
glyph_l['*'],glyph_r['*'] = 157,159
glyph_l[':'],glyph_r[':'] = 161,163
glyph_l['['],glyph_r['['] = 165,167
glyph_l[']'],glyph_r[']'] = 169,171
glyph_l['('],glyph_r['('] = 173,175
glyph_l[')'],glyph_r[')'] = 177,179
glyph_l['='],glyph_r['='] = 181,183
glyph_l['!'],glyph_r['!'] = 185,187
elseif selector==4 then cli_addline("RVEMAIL.ARC",c90)
elseif selector==5 then cli_addline("BBS.ARC",c90)
elseif selector==6 then cli_addline("GUI_CONFIG.ARC",c90)
elseif selector==7 then cli_addline("KEYBOARD.ARC",c90)
end
confirm = false
end
end
if keyboard_arc then
if (Controls.check(pad,KEY_X)) and not (Controls.check(oldpad,KEY_X)) then --close keyboard by pressing X
keyboard_arc = false
--remember to also clear the line here (is this needed though?)
else
keyboard_input()
end
end
if filebrowser_arc then
if (Controls.check(pad,KEY_X)) and not (Controls.check(oldpad,KEY_X)) then
filebrowser_arc = false
else
menunav()
while selector > selector_scroll+11 do --scroll
selector_scroll = selector_scroll +1
end
while selector <= selector_scroll do
selector_scroll = selector_scroll -1
end
end
if confirm then
redraw = 2
--redraw = {}
--redraw[TOP_SCREEN] = 2
--redraw[BOTTOM_SCREEN] = 2
end
if pass==8 then
dofile(appdir.."/bios/commands_init.lua")
dofile(appdir.."/bios/menunav_init.lua")
dofile(appdir.."/bios/keyboard_init.lua")
end
--////////////////////////////////////////////////////////
--Programs and Gui
--////////////////////////////////////////////////////////
if pass==9 then
topscreen_enabled = false
function closeall()
logingui_arc = false
mainmenu_arc = false
filebrowser_arc = false
bbs_arc = false
rvemail_arc = false
end
closeall()
keyboard_arc = false
uploader_arc = false


You might be better off running it yourself. I'll look into whether or not I'm missing if and while statement closures in the meantime though.

to me it works fine....At the Menu, navigate to "File Browser" using the D-Pad and press "A"

Okay then. Maybe I need a clean install. Are you using Citra or 3DS to run the program?
to me it works fine....

Did you manage to sort out the audio issues in 2.5?
function(array[1],array[2],array[3],array[4])
local i=1
while array[i] ~= nil do
i=i+1
end
print("there are ".. tostring(i-1) .. " arguments")
end

Is it possible to use an array as named arguments in a lua function? i.e.
Code:function(array[1],array[2],array[3],array[4]) local i=1 while array[i] ~= nil do i=i+1 end print("there are ".. tostring(i-1) .. " arguments") end
Because when I do it, lua doesn't seem to like the bracket arrangement on the first line, nor does it like the array.i syntax.
array = {["name"] = "bye bye"}
If you want to do something like array.name you should use something like this:
Code:array = {["name"] = "bye bye"}
With this, array.name will be set to "bye bye"
Example in action: https://github.com/Rinnegatamante/RPG-Maker-3DS/blob/master/scripts/rendering.lua#L152-L179 & https://github.com/Rinnegatamante/RPG-Maker-3DS/blob/master/settings/hero1.lua
If you're talking about passing an array to a function, it could be done but your function is passing an element of an array, not an array itself.
function(a1,a2,a3,a4)
local array = {a1,a2,a3,a4}
local i=1
while array[i] ~=nil do
i=i+1
end
print("there are ".. tostring(i-1).." arguments")
end

Random question: What is faster, if at all - drawing a image file that's 10x10, or partial drawing a 10x10 section of a larger image file?
It depends on your code. If the image is loaded once and then used different times, it should be the same (but you'll have less loading time).

I definitely noticed the massive decrease in loading time when I switched from individual images to a spritesheet when developing my own gpu text drawing function, (though the long loading time was actually what drove me to developing a loading screen) but seeing as that was early on in development and my 3DS was still knocking out 30 FPS with no drops, I didn't notice any difference in framerate when I switched over.
I'm asking now because I'm starting to get framedrops down to 20FPS (even down to 12FPS in some severely cluttered parts) due to how much stuff is being drawn and I'm looking to optimize my code in any way possible. Normally a lower framerate wouldn't bother me because response time isn't critical, but the random black flicker that occurs every now and then when the framerate is below 20 is really fucking annoying.


