i'm using this to get text from files to be passed back to routines that print the text. but it doesn't work- "control.lua:27: attempt to index global 'io' (a nil value)". this is the code:
function GetTextFromFile(filename)
--defines the variable to hold the text(what will be returned)
local text
local textfile
--opens a text file using the name passed as a parameter
textfile = io.open (filename, "r")
--sets the text variable to what is in the file
text = io.read()
--closes the file
io.close(textfile)
return text
end
can anyone help? i'm pretty sure io.open is the correct command..
Text from file
Text from file
Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
Re: Text from file
Factorio doesn't support reading files (or anything else in io).
The only interaction possible with files is write_file.
The only interaction possible with files is write_file.
Re: Text from file
ah. ok. that buggers thing up a bit. Thanks anyway 

Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn