I'm trying to add announcements and combat log text to my scripts, I looked through the API and found
dfhack.gui.makeAnnouncement(type,flags,pos,text,color[,is_bright])
and
dfhack.gui.addCombatReport(unit,slot,report_index)
But I am unsure what the type, flags, and slot should all be for a given announcement (also pos?). Anyone have any examples or a list of what the valid entries are?
EDIT: Also
dfhack.run_script('unit/body-change -unit 3399 -temperature fire -all')
Is not working, it says
C:\Users\Miles\Desktop\My_DF2\hack\lua\dfhack.lua:410: Could not find script uni
t/body-change -unit 3399 -temperature fire -all
stack traceback:
[C]: in function 'error'
C:\Users\Miles\Desktop\My_DF2\hack\lua\dfhack.lua:410: in function 'run_
script'
(interactive):1: in main chunk
[C]: in function 'safecall'
C:\Users\Miles\Desktop\My_DF2\hack\lua\dfhack.lua:366: in function 'inte
rpreter'
C:\Users\Miles\Desktop\My_DF2\hack\scripts/lua.lua:47: in main chunk
(...tail calls...)
Note that putting that exact string into the command line works fine.
EDIT2: @Gorobay, I'm pretty sure its because you have a lot of fields that are left undefined if you just make a new one with type and id. Try instead
old = df.global.world.entities.all[0]
new = old:new()
new.id = entity_next_id
new.type = 1
blah
blah
blah