generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: MoveTo on humanoids bug

Previous Thread :: Next Thread 
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 09:56 AM
while true do
for _,v in pairs(waypoints) do
script.Parent.Humanoid:MoveTo(v.Position,v)
repeat wait(precision_delay) until (script.Parent.Torso.Position - v.Position).magnitude <= precision_offset
print("reached target")
end
wait()
end

The bot starts walking towards v, and if I pick up and move v it will follow it around. However, if I move it too violently the bot will just give up and stop walking, and "reached target" doesn't print. Is this a bug or a feature, or a bug that has become an unintended feature? It's not documented anywhere (which I was expecting)
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 09:58 AM
Actually it's a case of the bot being moved faster than precision_delay, even though precision_delay is 0.5. Nevermind!
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 09:58 AM
the target being moved faster*
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 10:05 AM
NEVERMIND NO IT'S NOT. I CANNOT USE FORUMS UNLESS THERE IS AN EDIT BUTTON. If I move the flag violently when there is absolutely no chance of the bot getting anywhere near it - say it is at least 800 units away - the bot will still freeze in place.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
17 May 2012 10:18 AM
If you move it with a move tool of sorts roblox probably has all sorts of hax in there which make it go to an undefined workspace like thing and back 50 times a second and have random flags set while youre moving it.


k?




now go move it with a bodyposition instead.
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 11:14 AM
sure I should make a bot walk with bodyposition

Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 11:20 AM
Also, from when I was experimenting with Ogre3d and implemented a drag parts into environment thing which handled to the user *exactly* the same as Roblox's. Right down to the annoying stuttery bugs. There was no hidden workspaces involved (but that doesn't mean that roblox haven't added something that still runs the same speed as my program)
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
17 May 2012 11:27 AM
What about the 50 flags to prevent doom if someone tries to delete the part while your dragging it even though its in studio?


Wat if their hummanoid code makes assumptions?
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 11:31 AM
if their humanoid code makes assumptions that causes it to break then it is a bug
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
17 May 2012 11:35 AM
And why everyone else has done cool stoof in C++ or something.



I write a declearation for a class in a week (just the absolute required methods) and writing the definitons takes an extra 2 weeks.


Then i remove it because it was badly designed.



Im currently working on the definion of the 4th class in my project (window, vector and matrix classes dun. havent tested if the vector and matrix even work.)
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 11:43 AM
"And why everyone else has done cool stoof in C++ or something."

it was (sort of) in an ogre3d tutorial =p

Maybe you should specify times where you will code C++? I can never have time on the weekdays so I don't try, and intead just program in C++ on the weekends. Force yourself not to tab out for an hour and you will get a lot done and won't feel like tabbing out, it is just a habit.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
17 May 2012 12:33 PM
Well, the only way for it to get to that point in the code is if the loop condition becomes true:
(script.Parent.Torso.Position - v.Position).magnitude <= precision_offset

So, even if there were a bug involved it would have to be with the things in that statement, I don't know how you arrived at it being a problem with MoveTo.

Since that statement must be true for it to stop, when it stops print out the values of all of the parts of that statement so you can see what's going on.
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
17 May 2012 01:26 PM
MoveTo behaves like (and probably is the implementation of) the green circle thingy you can use to move as a player.

I'm pretty sure it does give up at times, so you probably want to call it in the loop.
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
17 May 2012 01:31 PM
@stravant I don't see what you're trying to say. The only way it can not print "reached target" is if the loop *doesn't* end.

I'm fairly convinced MoveTo giving up is the reason the bot's stopping.
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 01:38 PM
@Stravant - What? MoveTo should cause the bot to continue moving towards the target until it is close enough for the repeat loop to become true, then print and it should move to the next one.

Also, ignore the 2nd post (my first reply) on this, it makes absolutely no sense at all.
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 01:39 PM
@sncplay - Is there a more efficient implementation to have a bot always follow a certain target, even if the target could be moving? I am rewriting some old code which was buggy and slow,
Report Abuse
Valone is not online. Valone
Joined: 08 Feb 2012
Total Posts: 4371
17 May 2012 01:43 PM
What if you took the distance between the two points, and the characters speed (Just curious is WalkSpeed in Studs Per second?) and Wait() that time before moving to the next point?
Report Abuse
pighead10 is not online. pighead10
Joined: 03 May 2009
Total Posts: 10341
17 May 2012 01:47 PM
That would be the obvious route if the points were stationary and there was no chance of any interruptions, but that is not the case.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
17 May 2012 02:57 PM
Whoops, read it as "target reached" getting printed even though it did not reach it. Disregard that last post.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image