Recently ive been working on a way to implement dialog into a game ive been working on.... and after alot of searching i've found that io.lines reading through lines of a text file for each part of a dialog as a solid way to implement this. After alot of testing and modifying code all night, I've come up with a solution... but when I try to change the line number to read the dialog I want to diplay, the variable lineno changes, but the printed dialog wont..... can anybody tell me what i'm doing wrong or give me a better way to do it???
This is the dialog code using io.lines
Code: Select all
lineno = 1
local n=0
for Lr in io.lines("C:\\Program Files\\LOVE\\games\\points\\dialog.txt") do-------UPDATE 9/21/16 lineno wont change the displayed dialog when it chanes.... DX
n=n+1
if n==lineno then print(Lr) LineRead = Lr
; break end
end
Code: Select all
line1
line2
line3
line4
line5