Context
When the game is loading, some errors usually appear, however, the message that is displayed does not usually give me all the information I need.I want
So I want to know how I do to:Personalize the message.
Write to file.
Motrar another message.
Any of the above works for me.
Clarification
I know this code exists game.write_file, but it runs once the whole game is loaded.And I already tried with this code
Code: Select all
-- __FUNCTION__.FileWrite( Data, Name )
-- __FUNCTION__.FileWrite( Data, Name, Mode )
function __FUNCTION__.FileWrite( _data, _name, _mode )
-- valdación básica
if isNil( _data ) then return false end
-- Validar parametros
_name = _name or __FUNCTION__.getDate( ) ".lua"
_mode = _mode or "r+"
local types = { "r", "w", "a", "r+", "r+", "w+" }
if not __FUNCTION__.getKey( types, _mode ) then return false end
-- Escribir en el archivo
local file = io.open( "./script-output/" .. _name, _mode )
file:write( _data )
file:close( )
return true
end