how to make char walk backwards to a position?

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

how to make char walk backwards to a position?

#1 Post by silinky » Wed May 21, 2014 10:27 am

hi, i have a weird question :)
can i make the char to walk backwards between 2 waypoints?
if yes, how?
can i implement this into player:moveto()?

thanks!

User avatar
Administrator
Site Admin
Posts: 5313
Joined: Sat Jan 05, 2008 4:21 pm

Re: how to make char walk backwards to a position?

#2 Post by Administrator » Wed May 21, 2014 12:53 pm

You could probably modify it to do that with a little work. Just change the forward movement to backwards, and reverse the argument order for atan2 (this essentially would rotate the target angle by 180°).

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: how to make char walk backwards to a position?

#3 Post by silinky » Thu May 22, 2014 2:18 am

hmm i will try :)
thx!

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: how to make char walk backwards to a position?

#4 Post by lisa » Thu May 22, 2014 2:50 am

If it is purely between 2 locations and no others and you know there won't any other variables to affect it then you could just walk backwards a set amount of time. You would need to make sure to face the direction you want first and then do it and the time to walk backwards would require testing to get it right.

Code: Select all

			keyboardHold( settings.hotkeys.MOVE_BACKWARD.key);
			yrest(3000);
			keyboardRelease( settings.hotkeys.MOVE_BACKWARD.key)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: how to make char walk backwards to a position?

#5 Post by ZZZZZ » Thu May 22, 2014 3:07 am

lisa wrote:If it is purely between 2 locations and no others and you know there won't any other variables to affect it then you could just walk backwards a set amount of time. You would need to make sure to face the direction you want first and then do it and the time to walk backwards would require testing to get it right.

Code: Select all

			keyboardHold( settings.hotkeys.MOVE_BACKWARD.key);
			yrest(3000);
			keyboardRelease( settings.hotkeys.MOVE_BACKWARD.key)
That's what I did to solve my gate healing issue. You want the healer to be standing at max range so mages and 'through-wall' skills can't hit you.

Code: Select all

repeat
	keyboardPress(settings.hotkeys.MOVE_BACKWARD.key)
	player:update()
until distance(player, gateTarget) > 250

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: how to make char walk backwards to a position?

#6 Post by lisa » Thu May 22, 2014 3:18 am

would look funny steping back a little at a time, if you actually had to worry about what people saw you could do.

Code: Select all

         keyboardHold( settings.hotkeys.MOVE_BACKWARD.key);
         repeat
                  player:updateXYZ()
                  yrest(1)
         until distance(player, gateTarget) > 250
         keyboardRelease( settings.hotkeys.MOVE_BACKWARD.key)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: how to make char walk backwards to a position?

#7 Post by ZZZZZ » Thu May 22, 2014 3:40 am

It was fast enough that it backed up constantly. At least it did when I was testing it. Probably better off doing it your way just in case it was running slower at some point.

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: how to make char walk backwards to a position?

#8 Post by lisa » Thu May 22, 2014 4:25 am

well the difference would be in the motion, if you don't have motion files then you may not notice it.
With motion though and key pressing constantly it would look like it was changing from walk back to still to walk back repeatedly but with holding key it would just be walking backwards.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: how to make char walk backwards to a position?

#9 Post by silinky » Thu May 22, 2014 5:36 pm

thanks!
the problem is, that it should walk backwards to a set coordinate and kite a boss in a circle, while it should spam a dps macro. so when the boss gets into a range of 120, it should go backwards to the next waypoint coordinates.

basically:
1. have a waypoint file with some waypoints, or a table with coordinates, for example:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<!-- #  1 --><waypoint x="-30482" z="1229" y="-478">	</waypoint>
	<!-- #  2 --><waypoint x="-30656" z="1267" y="-471">	</waypoint>
	<!-- #  3 --><waypoint x="-30697" z="1394" y="-452">	</waypoint>
	<!-- #  4 --><waypoint x="-30605" z="1504" y="-445">	</waypoint>
	<!-- #  5 --><waypoint x="-30492" z="1480" y="-446">	</waypoint>
	<!-- #  6 --><waypoint x="-30402" z="1387" y="-455">	</waypoint>
	<!-- #  7 --><waypoint x="-30399" z="1233" y="-475">	</waypoint>
</waypoints>
2. if the aggroed boss comes closer than 120, move to next waypoint (with a greater than normal speed)
3. while keep spaming the dps macro (made with diyce, but that is besides the point i think.

i tried teleporting, but it was too erratic, and the char died from server error. basically the bot should kite the boss in a circle (set in the waypoint), untill it kills it.

i hope it is clearer now, and i hope somebody smarter than me can help. this is how it looks so far, but it is very alpha and nubish yet. and it doesn't work with teleport.

help :oops:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints>
	<onLoad>
		changeProfileOption("TARGET_LEVELDIF_BELOW", 10)
		changeProfileOption("TARGET_LEVELDIF_ABOVE", 1)
		teleport_SetStepPause(100)
		
		waypointnumber = 7
		index = waypointnumber
		
		function gotonextWP(index)
			if index == 0 then
				teleport(-30482,1229,-478)
				lookatTarget(-30399,1233,-475)
			end
			if index == 1 then
				teleport(-30656,1267,-471)
				lookatTarget(-30482,1229,-478)
			end
			if index == 2 then
				teleport(-30697,1394,-452)
				lookatTarget(-30656,1267,-471)
			end
			if index == 3 then
				teleport(-30605,1504,-445)
				lookatTarget(-30697,1394,-452)
			end
			if index == 4 then
				teleport(-30492,1480,-446)
				lookatTarget(-30605,1504,-445)
			end
			if index == 5 then
				teleport(-30402,1387,-455)
				lookatTarget(-30492,1480,-446)
			end
			if index == 6 then
				teleport(-30399,1233,-475)
				lookatTarget(-30402,1387,-455)
			end
		end
		
		

		function lookatTarget(X,Z,Y)   
			local angle  = math.atan2(Z - player.Z, X - player.X);
			local yangle = math.atan2(Y - player.Y, ((X - player.X)^2 + (Z - player.Z)^2)^.5 );                  
			player:faceDirection(angle, yangle);
			camera:setRotation(angle);
		end
		
		function getaway()
		printf(math.fmod(index,waypointnumber))
			gotonextWP(math.fmod(index,waypointnumber))
			index = index+1
		end
		
		--	do this indefinitely
		while (true) do
			if CountMobs(1, 120) then
				RoMScript("KillSequence()") -- this also takes care of the targetting of the boss so it won't target adds
				getaway()
				yrest(100)
			end
		end
	</onLoad>
</waypoints>

User avatar
silinky
Posts: 213
Joined: Mon Nov 23, 2009 5:07 am

Re: how to make char walk backwards to a position?

#10 Post by silinky » Fri May 30, 2014 8:54 am

i did it finally in another way, no need to complicate myself needlessly.
i used this waypoint as starter, and set the room center as centerpoint. now i can successfully kite bosses

Image

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests