Jump to content

LUA net.get_unit_property function


Dagger_c3

Recommended Posts

I made this code in events.lua:

 

io = base.io

 

function on_start()

local file = io.open("./Temp/KILLLOG.log", "w+")

if file then

io.output(file)

end

--Here there are more lua code

end

 

function on_eject(id)

report(_("%s ejected."), player_info(id))

io.write(string.format("id=%s %s ejected.\n", net.get_unit_property(id, 1), player_info(id)))

end

 

It's suposed that in the file KILLOG should appear the unit runtime ID and the message

 

In KILLOG I get this:

 

id=!invalid property! RED player "Dagger" ejected.

 

Do you know where is the problem? Is this a bug? In case that it is a bug, is there any way of getting the unit runtime ID? (Happens the same with UNIT_GROUP_MISSION_ID)

 

Thanks a lot

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...