• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Snippet - MQ2Nav Mod and Kissassist fix to use it

joojoobee

A Member to Remember
Creator
Joined
May 15, 2016
RedCents
4,327¢
All,

MQ2Nav use in Kissassist has an issue in that you can only designate the location of the Target to move to... and it's hard to figure out, especially in unpredictable, unsee-able, terrain what might be a good stopping point short of standing on top of the mob while Kiss decides whether to shoot, cast, etc. Kissassist is supposed to stop the nav when the target is LineOfSight... but, well, it doesn't. This is on a top end computer running 9 accounts, so maybe it's an issue with updating variables, etc...

All that said, I started modifying MQ2Nav with a different workaround. Basically, while the movement is active, a routine in MQ2Navigation.cpp is run. I added a simple check for distanceToTarget < MDist (where mdist is a number you provide with a new command I added to my modded MQ2Nav).

Rich (BB code):
    if (m_activePath->IsAtEnd() || distanceToTarget < MDist() )
    {
        WriteChatf(PLUGIN_MSG "\agReached destination at: %.2f %.2f %.2f      ||  %.2f",
            dest.y, dest.x, dest.z, distanceToTarget);
        
        LookAt(dest);

        if (m_pEndingItem || m_pEndingDoor)
        {
            AttemptClick();
        }

        Stop();
    }
    else if (m_activePath->GetPathSize() > 0)
    { ... etc.


I also added this command to MQ2Nav in this subroutine
Rich (BB code):
std::shared_ptr<DestinationInfo> ParseDestination(const char* szLine, NotifyType notify)
...  various code

    // parse /nav distance to stop at #
    if (!_stricmp(buffer, "mdist"))
    {
        GetArg(buffer, szLine, 2);
        double distToTarget = 0;

        try { distToTarget = boost::lexical_cast<double>(buffer); }
        catch (const boost::bad_lexical_cast&)
        {
            if (notify == NotifyType::Errors || notify == NotifyType::All)
                WriteChatf(PLUGIN_MSG "\arBad Distance to Stop at");
            return result;
        }

        if (notify == NotifyType::All)
            WriteChatf(PLUGIN_MSG "--> mdist set to:  %.2f", distToTarget);

        g_mq2Nav->mdistt = distToTarget;

        return result;
    }

Probably a better place to put it that there, but it was the easiest to mod. I am not a C++ coder and Brainiac is would probably conniptions with my bad coding style.

The command would be:

/nav mdist 50 | stops 50 units from the mob
/nav mdist 0 | goes right up to be on top of the mob
/nav mdist ${dist} | stops at the distance in the variable ${dist}

Examples are in the pull routine modifications below. What this does is run to within 100 units, check if Lineofsight (LOS)... subtract 10... run to 90, check if LOS, etc. Then, when LOS it starts the pull. Infinitely better pulls and far far fewer deaths.

Rich (BB code):
    |:-------------------------------------------------------------------------------------
    |: SUB: Pull Using MQ2Nav
    |: -------------------------------------------------------------------------------------
    Sub PullUsingNav(int BeginMobNavID,float NavPullDist)
    /if (${DebugPull}) /echo \atDEBUGPULL PullUsingNav Enter \agLine#: ${Macro.CurLine}
    /varset PullTimer 30
    /varset PullNavTimer 1m

    /declare mdistance int local 100
    |: mdist checks
    /nav mdist ${mdistance}
    /call MQ2NavFix ${Spawn[${MyTargetID}].X} ${Spawn[${MyTargetID}].Y} ${Spawn[${MyTargetID}].Z} "PullUsingNav 1"

    :DistanceCheck
    
    /if (!${Navigation.Active} && !${Spawn[${MyTargetID}].LineOfSight} && !${Target.LineOfSight}) {
        /varcalc mdistance ${mdistance}-10
        /nav mdist ${mdistance}
        /call MQ2NavFix ${Spawn[${MyTargetID}].X} ${Spawn[${MyTargetID}].Y} ${Spawn[${MyTargetID}].Z} "PullUsingNav 1.1"
    }
    
    /doevents
    /if (!${DragCorpse}) {
        /call GrabCorpse
        /if (${DragCorpse}) {
            /varset PullNavTimer 0
            /return
        }
    }

    |: Return if in sub for more than 3 min
    /delay 10
    |: Corrects heading when mob is moving and your using Navigation.
    /if (${Spawn[${MyTargetID}].Speed}>25) {
        /call MQ2NavFix ${Spawn[${MyTargetID}].X} ${Spawn[${MyTargetID}].Y} ${Spawn[${MyTargetID}].Z} "PullUsingNav 2"
    }
    
    |: Check for Unexpected Aggro
    /if ((${AggroTargetID} && !${ChainPull}) || (${Me.XTarget[${XTSlot2}].ID} && ${ChainPull})) {
        /echo unexpected aggro 1
        /nav mdist 0
        /return
    }
    
    /squelch /if (${Me.XTarget[${XTSlot}].ID} && ${Me.XTarget[${XTSlot}].ID}!=${MyTargetID} && ${Me.XTarget[${XTSlot}].ID}!=${BeginMobNavID}) {
        /squelch /target ${Me.XTarget[${XTSlot}].ID}
        /squelch /delay 5 ${Target.ID}==${Me.XTarget[${XTSlot}].ID}
        /squelch /if (${Me.TargetOfTarget.ID}==${Me.ID}) {
                /echo unexpected aggro 2
                /varset PullNavTimer 0
                /nav mdist 0
                /return    
        }
        /target ${BeginMobNavID}
    }

    |: Check for being too far from camp.
    /if ((${Math.Distance[${CampYLoc},${CampXLoc}]}>=${Math.Calc[${MaxRadius}*.90]} && ${Spawn[${MyTargetID}].Distance}>${Math.Calc[${MaxRadius}*.10]}) || ${Math.Distance[${CampYLoc},${CampXLoc}]}>=${MaxRadius} || ${PullNavTimer}==0) {
        /if (${Navigation.Active}) /nav stop
        /echo Nav stopped PullUsingNav-- too far from camp
        /call BackToCampReset
        /varset PullNavTimer 0
        /echo too far from camp, prepare to return
        /nav mdist 0
        /return
    }

    /if (${Me.Moving} && ${Navigation.Active}) /varset PullTimer 30
    /if ((${Spawn[${MyTargetID}].Distance3D}>${NavPullDist} || !${Target.LineOfSight} || !${Spawn[${MyTargetID}].LineOfSight} || ${Spawn[${MyTargetID}].FeetWet}!=${Me.FeetWet}) && ((!${AggroTargetID} && !${ChainPull}) || (!${Me.XTarget[${XTSlot2}].ID} && ${Me.XTarget[${XTSlot}].ID}!=${MyTargetID} && ${ChainPull}))) /goto :DistanceCheck

    |: This is where the pull is managed.
    /if (${Navigation.Active} && (${Spawn[${MyTargetID}].LineOfSight} || ${Target.LineOfSight}) && (${Spawn[${MyTargetID}].Distance3D}<=${NavPullDist} || ${Navigation.PathLength[id ${Target.ID}]} < 50) && ${Target.FeetWet}==${Me.FeetWet} ) {
        /nav stop
        /echo Start the Pull Usin gNav Pull...

        |: XXX this is where we cast the two protection spells
        /call MonkProtectionSpells ${MyTargetID}
        /if (!${Spawn[${MyTargetID}].LineOfSight}) {
            /nav mdist ${mdistance}
            /call MQ2NavFix ${Spawn[${MyTargetID}].X} ${Spawn[${MyTargetID}].Y} ${Spawn[${MyTargetID}].Z} "PullUsingNav 3"
            /goto :DistanceCheck
        }
    }
    /varset PullNavTimer 0
    /if (${DebugPull}) /echo \atDEBUGPULL PullUsingNav Pulling ${NavPullDist} ${Target.Distance} \agLine#: ${Macro.CurLine}
    /if (${DebugPull}) /echo \atDEBUGPULL PullUsingNav Leave \agLine#: ${Macro.CurLine}
    /echo Leaving PullUsingNav
    /nav mdist 0
    /return

Next up mods for Brainiac's MQ2Nav for me are:

  • a return # for total number of path steps. ${Navigation.TotalIndex}
  • a return # for which path index you are at (if you are in Active Nav) ${Navigation.CurrentIndex}
  • a return for providing an index number and it will tell you the path point (treating MQ2Nav points like a waypoint list)-- I want to use this to search the path for MOBs that might aggro. ${Navigation.Index[ # ]}
  • I also think I have a way for using the mesh to find nearby points to move towards to make the puller look more natural... but lower on the priority list for me.

None of the above possible of course without Maskoi's, EQmule's Ctaylor's, Redbot's etc. MQ2 and of course Brainiac's gorgeous MQ2Nav (which I am only just starting to understand).

JJB

PS-- whether any of the above gets into either MQ2Nav or any of the various iterations of Kissassist is beyond my control. Just telling people here what's possible and what I got to work.
 
KISS will stop you when you have LOS on the mob, but only when you are within PullRange. I have seen when mobs are LOS all the way until you get into PullRange, and the next time you are in LOS is when you run up the hill and run face on into the mob. Shit happens.
 
KISS will stop you when you have LOS on the mob, but only when you are within PullRange.

I thought that's how it was to work too... but in all these cases I have seen it happen I am well within PullRange. Sometimes it does it right (ie stops)... sometimes not. I've concluded the LOS is not updated as needed.

My MQ2nav mod works perfectly, and no issues for me.

JJB

- - - Updated - - -

<< On my side it might be that the Pullrange is not being set right. I am using "Distant Strike" for this (a monk spell). Funny, because my Warrior pulls perfectly well with arrows/bow. Amyway-- this has been a good exercise to learn MQ2Nav plugin...
 
Is there a way to have KA pull non LOS mobs with pet set to pull?
 
I thought that's how it was to work too... but in all these cases I have seen it happen I am well within PullRange. Sometimes it does it right (ie stops)... sometimes not. I've concluded the LOS is not updated as needed.

My MQ2nav mod works perfectly, and no issues for me.

JJB

- - - Updated - - -

<< On my side it might be that the Pullrange is not being set right. I am using "Distant Strike" for this (a monk spell). Funny, because my Warrior pulls perfectly well with arrows/bow. Amyway-- this has been a good exercise to learn MQ2Nav plugin...

Distance Strike has like a 300 range. check and see what your PullRange is when running kiss.
 
Distance Strike has like a 300 range. check and see what your PullRange is when running kiss.

Yeah-- I just checked again... it's reading the PullRange correctly. I recall checking that in my initial debugging. So, there's something else wrong as I had originally said-- there's something not being updated correctly during the pull, and the LOS is not working in time. I had noted that "sometimes" it does work, sometimes not. The stochastic nature made me realize it's some internal issue to MQ2 beyond my reach.

All I know is my mod works, so for now I am going with that.
smile.gif


JJB

PS-- FYI-- I am still using your version 25. Since I mod my Kiss to heck it's always a struggle when y'all upgrade to re-mod up to the newer versions.
 
Last edited:
i have los marker on my hud, and it often are incorrect, i cant pull the mob cause i cant see it, but the los says its in los, so there is something going on, thats for sure.
 
Is mdist in MQ2Nav? because MQ2MoveUtils uses this var so probably not a good idea to add to MQ2Nav
 
I used the term mdist purposefully since it's the same concept as in MQ2MoveUtils (stop when within a certain distance of the target). It's really a "flag" to change the distance at which the plugin will stop movement. It's not a variable per se. I use a different variable name anyway that is local to the plugin (it's actually a variable name.

Happy to change... but unless Brainiac decides it's worth rolling out to his general users, it will stay local to my computer anyway.

JJB
 
i dont know if its something you can spot jojobee

but when i ride a mount and using mq2nav as pull in kiss, it runs out and pulls, and once its done run up toi the mob with nav, the mount stops like that!
but when it runs back to camp kiss dont like and uses moveutils to get you to camp.

but i wonder if there is something that mq2nav does to stop movement like that. its very noticable, also hard to explain. but yeah-
 
why the fuck are you pulling on a god damn mount. Play the fucking game like everyone else geezus fuck.
 
Last edited:
Kaen-- it's mentioned somewhere in the code I recall that MQ2Nav and mounts doesn't work well. Mounts are "fast" and don't usually stop on a dime... they tend to "skid" (slow down to a stop) if you will when you release the forward move button. From my reading of Brainiac's code, he uses /face and /forward type commands to do the moving. So on mount... you forward and then when you stop forwarding the mount will skid past the point a little.

The dismount might have something to do with the attack mode you use, but it's not worth going through the code to figure out because...Bottom line, as Maskoi "colorfully" suggests... better not to use mounts when pulling!

JJB
 
kiss is fine with pulling with mq2nav, if you do the return to camp check proper, which they dont thats the only issue it has.

running up to mobs and engaging them with spells, or bows or melee mq2nav is fine with, done that for hours, with a little modding of my own.

but this is not the point.

the point is, that mq2nav when called to stop moving, seems to top you faster on a mount than /moveto id does when it arrives at its destination, and thus i was wondeirng if there is a different way those two handle stop moving, but looking over the code seems mq2nav just calls a mq2 command to issue a forward movement key click.

just cause maskoi cant figure out how to do a thing, doesn't mean it cant be done.
 
Snippet - MQ2Nav Mod and Kissassist fix to use it

Users who are viewing this thread

Back
Top
Cart