Grimes,
I found some typo in the manual:
string mist.tostringMGRS(table t, number n)
...
Example returned value:
mist.utils.toStringMGRS(table, 0) returns 38T AB
mist.utils.toStringMGRS(table, 3) returns 38T AB 123 123
mist.utils.toStringMGRS(table, 5) returns 38T AB 12345 12345
so is it mist.tostringMGRS or mist.utils.toStringMGRS?
It is the same with mist.tostringLL
the example is the same as mist.tostringMGRS
I am trying to use the different mist.tostring... function to get the position of a unit firing a Kh-58. So far I manage to get a message saying which unit fire which weapons but I cannot get the position. What do I need to add to this code:
SEAD_launch = {}
function SEAD_launch:onEvent(event)
if event.id == world.event.S_EVENT_SHOT
then
SEAD_unit = event.initiator
SEAD_unitName = Unit.getName(SEAD_unit)
SEAD_unitGroup = SEAD_unit:getGroup()
_SEADmissile = event.weapon
_SEADmissileName = _SEADmissile:getTypeName()
if _SEADmissileName == "KH-58" or _SEADmissileName == "Kh-25ML" then
trigger.action.outText("Warning " ..string.format(SEAD_unitName).. " launching " ..string.format(_SEADmissileName),10)
trigger.action.setUserFlag('10', true)
end
end
end
mist.addEventHandler(SEAD_launch)
I am sure there is something clever to do with mist.msgBullseye or other mist.msg... but I can t get them to work either.
P.S: I have no knowledge at all about programing so if the code above is pure garbage please educate me! (i.e do I really need to add local to everything?)