how to make char walk backwards to a position?
how to make char walk backwards to a position?
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!
can i make the char to walk backwards between 2 waypoints?
if yes, how?
can i implement this into player:moveto()?
thanks!
- Administrator
- Site Admin
- Posts: 5313
- Joined: Sat Jan 05, 2008 4:21 pm
Re: how to make char walk backwards to a position?
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°).
Re: how to make char walk backwards to a position?
hmm i will try
thx!
thx!
Re: how to make char walk backwards to a position?
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: how to make char walk backwards to a position?
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.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)
Code: Select all
repeat
keyboardPress(settings.hotkeys.MOVE_BACKWARD.key)
player:update()
until distance(player, gateTarget) > 250
Re: how to make char walk backwards to a position?
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: how to make char walk backwards to a position?
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.
Re: how to make char walk backwards to a position?
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.
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
wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
Re: how to make char walk backwards to a position?
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:
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
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>
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
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>
Re: how to make char walk backwards to a position?
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
i used this waypoint as starter, and set the room center as centerpoint. now i can successfully kite bosses
Who is online
Users browsing this forum: No registered users and 7 guests