• 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

MQ2Moveutils /circle reverse

eyeknowy

New member
Joined
Jan 31, 2006
RedCents
I have always used MQ2Moveutils for Bard kiting. I decided to try and use it for my Ranger, but found that there was no way to use the /circle command to walk backwards. I did some research on the MQ2 site and there did not seem to be a solution there either. I decided to try and edit the existing plugin to handle a reverse option. Hope this helps someone whe was trying to accomplish the same thing I was. Here is what came up with.

Disclaimer: I am not much of a C++ programmer so please keep flames to a minimum. :)

I included surrounding code from the MQ2Moveutils.cpp file so you could do this yourself you wanted, or improve on what I hacked together. Accept for 1., all the changes were made to the HandleCircle() fuction so be carefull of just doing a full seach and replace so that you dont mess up /stick or /moveto.

1. I created a variable called circlereverse that I would use to toggle the reverse option.

Rich (BB code):
 bool bDebug=false; 
bool bCircling=false;
bool bCirclingWasOn=false;
bool bDrunken=false;
float CircleX=0.0f;
float CircleY=0.0f;
float CircleRadius=0.0f;
int circlereverse=0;
SYSTEMTIME stPrevCirc;
 
 
2. I replace the following code that identifies switches used in the /circle command so that the plugin would recoginze the reverse option.
 
Replaced:
 
		} else if( !strncmp(currentArg,"on",3) ) {
			GetArg(currentArg,szLine,argn);
			if( isdigit(currentArg[0]) ) {
				CircleRadius = (float)atof(currentArg);
				argn++;
			}
			if(!bCircling) {
				CircleY = pChSpawn->Y + CircleRadius * (float)sin(pChSpawn->Heading * (float)PI / 256.0);
				CircleX = pChSpawn->X - CircleRadius * (float)cos(pChSpawn->Heading * (float)PI / 256.0);
			}
			bCircling=true;
 
With: 
 
		} else if( !strncmp(currentArg,"reverse",8) ) {
			circlereverse = 1;
			GetArg(currentArg,szLine,argn);
			if( isdigit(currentArg[0]) ) {
				CircleRadius = (float)atof(currentArg);
				argn++;
			}
			if(!bCircling) {
				CircleY = pChSpawn->Y + CircleRadius * (float)sin(pChSpawn->Heading * (float)PI / 256.0);
				CircleX = pChSpawn->X - CircleRadius * (float)cos(pChSpawn->Heading * (float)PI / 256.0);
			}
			bCircling=true;
		} else if( !strncmp(currentArg,"on",3) ) {
			circlereverse = 0;
			GetArg(currentArg,szLine,argn);
			if( isdigit(currentArg[0]) ) {
				CircleRadius = (float)atof(currentArg);
				argn++;
			}
			if(!bCircling) {
				CircleY = pChSpawn->Y + CircleRadius * (float)sin(pChSpawn->Heading * (float)PI / 256.0);
				CircleX = pChSpawn->X - CircleRadius * (float)cos(pChSpawn->Heading * (float)PI / 256.0);
			}
			bCircling=true;
 
 
 
3. Added If statements to correctly calculate the heading changes based on if you are kiting normal or reverse.
 
Replaced:
 
newHeading=(float) atan2(pChSpawn->Y - CircleY, CircleX - pChSpawn->X) * 180.0f / (float)PI + 90.0f;
 
With:
 
if (circlereverse == 1) {
						newHeading=(float) atan2(CircleY -pChSpawn->Y, pChSpawn->X - CircleX) * 180.0f / (float)PI + 90.0f;
						} else {
						newHeading=(float) atan2(pChSpawn->Y - CircleY, CircleX - pChSpawn->X) * 180.0f / (float)PI + 90.0f;
						}
 
 
AND
 
 
Replaced:
 
heading=(float) atan2(pChSpawn->Y - CircleY, CircleX - pChSpawn->X) * 180.0f / (float)PI + 90.0f;
 
With:
 
if (circlereverse == 1) {
						heading=(float) atan2(CircleY -pChSpawn->Y, pChSpawn->X - CircleX) * 180.0f / (float)PI + 90.0f;
						} else {
						heading=(float) atan2(pChSpawn->Y - CircleY, CircleX - pChSpawn->X) * 180.0f / (float)PI + 90.0f;
						}
 
 
 
 
4. Finally replace the actual command that would move you forward with a if statement to move your forward or in reverse.
 
Replace:
 
DoFwd(true);
 
With:
 
if (circlereverse == 1) 
DoBck(true);
} else {
DoFwd(true);
}



After compiling I was able to now use the /circle command as follows:

Instead of

/circle on 50

I can replace the on parameter with reverse

/circle reverse 50


This allows my ranger to walk backwards instead of forwards in a circle keeping targets in view for using bow. Combine that with a simple targeting mac and you can now use the /circle command for kiting with your Ranger.

I am sure there needs to be a bit more work done with this to make it better integraded with all the functions of the plugin, but the changes were easy to make and worked pretty well. I included a compile of the plugin with these changes made.
 
Last edited by a moderator:
Bump... I know.... Shameless.....

Nevertheless,

Is this in the updated compile, or do the changes need to be added into the source? I am on my laptop away fromhome and do not have my compiler. Could some one be a pall and compile this for me? I'll thow some red cents your way. I am dieing to try this with my ranger.

Thanks.
 
This was last posted on 05-09-2006, at 05:30 PM...4 months ago. If you look on my pre-compile thread, I have MQ2MoveUtils on there.
 
I saw that and it is very appreciated! I looked over the code and didn't see that nthere was the reverse option in the source. I was wondering if in the compile that you have posted does it include that option, or do I need a different version of mq2moveutils.dll?

I apologize for misunderstanding if it is.
 
wouldnt moving sideways while making a circle be better for bow kiteing?
 
Does anyone have the updated the source with these changes made? I made the changes above witht the updated MQ2MoveUtils.cpp. However I keep getting a syntax error becasue I dont think I pasted the changes in right on the 4th step. Here is what I have:

Rich (BB code):
heading += 90.0f * (CircleRadius/distance);
	heading *= 512.0f/360.0f;
	if( heading >= 512.0f ) heading -= 512.0f;
	if( heading < 0.0f ) heading += 512.0f;
	if( bDrunken ) {
	 gFaceAngle = (float)heading;
	} else {
	 pChSpawn->Heading = (float)heading;
	}
   }
   if (circlereverse == 1) 
DoBck(true);
} else {
DoFwd(true);
}
  }
 }  
}   <---Error on this line. see error below

void breakCircle(bool stopMoving, bool quite) {  <---Error on this line. see error below

 bCircling=false;
 bCirclingWasOn=false;
 stuck=0;
 if( stopMoving )
  ReleaseKeys();

here are the errors that I get in MS VC++ 6.0

PHP:
Compiling...
MQ2Moveutils.cpp
EQLIB_IMPORTS
C:\Documents and Settings\Desktop\MQ2\MQ2-20060923b\MQ2Moveutils\MQ2Moveutils.cpp(1791) : error C2143: syntax error : missing ';' before '}'
C:\Documents and Settings\Desktop\MQ2\MQ2-20060923b\MQ2Moveutils\MQ2Moveutils.cpp(1791) : error C2143: syntax error : missing ';' before '}'
C:\Documents and Settings\Desktop\MQ2\MQ2-20060923b\MQ2Moveutils\MQ2Moveutils.cpp(1791) : error C2143: syntax error : missing ';' before '}'
C:\Documents and Settings\Desktop\MQ2\MQ2-20060923b\MQ2Moveutils\MQ2Moveutils.cpp(1793) : error C2143: syntax error : missing ';' before '{'
C:\Documents and Settings\Desktop\MQ2\MQ2-20060923b\MQ2Moveutils\MQ2Moveutils.cpp(1793) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.


Any advise would be great!
 
look through those lines and put a ; at the end of all the lines that are missing it.
 
So then just do this?
Rich (BB code):
heading += 90.0f * (CircleRadius/distance);
	heading *= 512.0f/360.0f;
	if( heading >= 512.0f ) heading -= 512.0f;
	if( heading < 0.0f ) heading += 512.0f;
	if( bDrunken ) {
	 gFaceAngle = (float)heading;
	} else {
	 pChSpawn->Heading = (float)heading;
	}
   }
   if (circlereverse == 1) 
DoBck(true);
} else {
DoFwd(true);
}
  }
 }  
;}   

void breakCircle(bool stopMoving, bool quite); {  

 bCircling=false;
 bCirclingWasOn=false;
 stuck=0;
 if( stopMoving )
  ReleaseKeys();
 
Ok Rangers,
I got the reverse option up and running in the updated MQ2MoveUtils.dll. Confirmed and tested as of 8-25-2006.

function: /circle reverse #

# = Radius

Kudos to eyeknowy for the initial code.

Seeing as this adds additional functionality to the standard mq2moveutils I figure it would be safe to post here.
 
your post says as of 8-25-2006 but you posted 9-25-2006 so I am going to assume thats what you meant and just noteing it for those that come after. Thanks for this btw
 
MQ2Moveutils /circle reverse

Users who are viewing this thread

Back
Top
Cart