This was my old question: How can I write a mod which will print out “Hello World” on screen?. Later I have figured that I can print to the log but unfortunately it doesn’t work so I decided to edit my post instead of opening another thread.
Hi again,
so normally it is possible to write into the log from any component/controller within the game but with my current setup this won’t happen:
analyzer.lua
local log = radiant.log.create_logger('analyzer_log')
local Analyzer = class()
function Analyzer:initialize()
log:warning('analyzer was successfully loaded!')
end
return Analyzer
manifest.json
{
"info": {
"name": "analyzer",
"version": 3
},
"controllers":
{
"analyzer" : "file(analyzer.lua)"
},
"default_locale": "en"
}
user_settings.json snippet
"logging" : {
"show_console" : true,
"mods" : {
"analyzer" : {
"analyzer_log" : 9
}
}
}
I have tried many different things but it won’t work. Do I something wrong?
Regards,
LifeArtist
Hi there,
I wanted to start to code a mod which won’t create any new items etc. but it will need and interact with the events from Lua within the game. And based on the events it should do something.
I asked a while ago some questions where I wanted to use an external program written in another language to somehow do this. But I was directed to create a mod for this kind of purpose.
But how do I actually can create a mod which will act like a scriptable object like in unity? I have watched and read tutorials about mod creation for stonehearth but they were only creating new entities which do not really helped me.
So how would I start to create a simple mod written in lua (if c++ is not available) which will print a line onto the screen?
Regards,
LifeArtist