• IS THIS SITE UGLY? Click "RG3" at the very bottom-left of this page to change it. To dismiss this notice, click the X --->

Question - Calling an MQ2Nav output statement as an event... ??

joojoobee

A Member to Remember
Joined
May 15, 2016
Likes
89
RedCents
2,534¢
#1
I have events set up in Kiss to test for an MQ2Nav output per the below.

Why can I not see things from MQ2Nav as events? Is there something special I need to # to be able to create/see events from plugin output?

Event Test:
    #warning
    #turbo 120

    #Event NewStartPos       "[MQ2Nav] Could not locate starting point#*#"
    #Event NewStartPos       "[MQ2] Could not locate starting point#*#"
    #Event NewStartPos       "#*#Could not locate starting point#*#"
    #Event NewStartPos       "Could not locate starting point#*#"

|: --------------------------------------------------------------------------------------------
|: SUB: Event_NewStartPos
|: --------------------------------------------------------------------------------------------
  Sub Main

  :MainLoop
  /doevents
  /delay 5
  /goto :MainLoop

  return

|: --------------------------------------------------------------------------------------------
|: SUB: Event_NewStartPos
|: --------------------------------------------------------------------------------------------
    sub Event_NewStartPos

  /echo HI there...
    /delay 1s

    /doevents flush Event_NewStartPos

    /return
 
Last edited:
Joined
May 2, 2011
Likes
5
RedCents
267¢
#2
Events don't read the MQ2 window. Try and output the text to /group or another window it will see.
 

joojoobee

A Member to Remember
Joined
May 15, 2016
Likes
89
RedCents
2,534¢
#3
Thanks, TAR. Yeah, unfortunately, it's MQ2Nav output errors I am trying to parse (when MQ2Nav can't find a starting point or end point). I know where in the MQ2Nav codebase to go to add a new variable if I wanted, but I don't have the patience to update that with every new release cuz it's a pain (at least for me).
 

joojoobee

A Member to Remember
Joined
May 15, 2016
Likes
89
RedCents
2,534¢
#5
Easy to say. Do you have any suggestions?

I've read the C++ code base and I can see where it can be modded... But...

As it's written all it can tell you is whether there true/false is a path... Or pathlength. There is an error of course that is printed in mq2 window for either start or end ofbpath not being found. That is what I was trying to capture into an event to determine in no_path_found is at end or beginning.

Doesn't matter I came up with other less elegant workarounds.

Joojoobee
 
Joined
Jun 28, 2014
Likes
41
RedCents
2,203¢
#6
Well, it's hard to specifically say since you're just showing snippets of code and I can't see it in context. But, to answer your question -- what I was saying was that you could check whether you are navigating after you call a nav by using ${Navigation.Active} (which shouldn't be if you can't find the starting point). Then once you are navigating, as it sounds like you went down, check that the path exists using PathExists to get to your endpoint.
 

joojoobee

A Member to Remember
Joined
May 15, 2016
Likes
89
RedCents
2,534¢
#7
good idea. I'll test to see how long after the Nav call is done that it determines whether active or not. Should be immediate I guess. Problem still remains as to whether Start or End could be determined true or not before calling.

The workaround I came up with is to log/save a "known" true position at some point (something that succeeded previously from somewhere in the zone). That can be used determine if the spot from which you are calling is a valid call-from position.

Workaround:

  • algorithm determines and saves any previously valid nav point (nav_previous_valid)
  • To determine if start_pos is valid:
    • Do Pathexists for start_pos --> nav_previous_valid
  • To determine if end_pos is valid:
    • Do Pathexists for end_pos --> nav_previous_valid (or nav_previous_valid --> end_pos
That way I determine if the start and end are wrong then I search nearby for potential positions on the grid that give a valid start or end...

Still some issues as to whether Nav can get from a bad start position to the good position on the grid, but that's just a move call with forward, etc. button presses usually.
 
Joined
Dec 29, 2017
Likes
323
RedCents
2,747¢
#8
It's interesting that someone mentioned that MQ2 won't handle the mq2 chat "WriteChatf("Some Text"); " to process events because /echo can be used as an event. IE: #Event Burn "[MQ2] |${BurnText}|" is found in KissAssist when you /echo ${BurnText} for example.

While I haven't checked for something being sent from a plugin, if it can get it from an echo, it in theory should be able to get it from a writechatf.
 
Joined
Jun 28, 2014
Likes
41
RedCents
2,203¢
#10
It may be me, but I don't think that Burn event works. I tried making a test macro to just do that (and, again, I could be doing it wrong) but I can't get the event to trigger.
 
Top