Jump to content

Recommended Posts

Posted

I am trying to get the information from the F10 Markers you can place in DCS. I primarily want the coordinates......this is what I have so far.....

 

EngageArea:HandleEvent(EVENTS.MarkChange)

--- @param Core.Event#EVENT self

-- @param Core.Event#EVENTDATA EventData

function EngageArea:OnEventMarkChange(EventData)

MarkerCoord = COORDINATE:New(EventData.pos.y, EventData.pos.x, EventData.pos.z)

EngageArea:SetVec2(MarkerCoord)

end

 

However I am seeing nothing in the logs to show me where I am going wrong......can anyone help me as I am confused as hell.....I can see the data I want in the logs on the event change but for some reason it isnt showing me why I cant utilise it to do other things.

  • 4 weeks later...
Posted

This is a bit of a necro post, but I hate when nobody answers my questions. I use MiST for logging, since it can serialize tables and drop them straight in the log. So you'll load up mist before your script, then at the top of your script run something like 

GizmokevLog = mist.Logger:new("Gizmokev")

Then whatever you need to log, you can do so like this:

GizmoevLog:msg(MarkerCoord)

This scales, so you could even log EventData if you want to look at the whole thing.

 

I've done stuff like this before, and I use S_EVENT_MARK REMOVE (id 27) because otherwise it may try to run your code as you type. This way, you type what you have to type, then delete the marker. If you need the marker to stay there, it's a pretty simple task to have the script re add it.

 

I also use something like 

if string.match(event.text, "-do") then
  --runs some stuff
end

That way, you can start your marker text with a key word to differentiate it from other types of marks, or write several functions which you can pick between. In this case, it would look for the text "-do".

 

Also remember you have to run addEventHandler after you set this all up. I'm sure you did, but it wasn't in OP so I thought I should mention it.

Let me know if you need an example, I've got plenty of them, just not on this PC.

  • Recently Browsing   0 members

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