ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
tomtomn00
|
  |
| Joined: 14 Apr 2010 |
| Total Posts: 27998 |
|
|
| 30 Aug 2011 06:23 AM |
What type of "rocket" - The free model one? Make one yourself or go to Scripting Helpers.
|
|
|
| Report Abuse |
|
|
|
| 30 Aug 2011 06:29 AM |
| ss1122 knows how to script, tomtomn00... |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2011 06:44 AM |
sdfgw asked this same thing a few days ago, right?
you get (target.Position - self.Position).magnitude, and divide it by the speed of the missile
then you detect where the person will be by multiplying the number you got there by their walkspeed and multiplying their lookVector times that
and you can repeatedly do stuff like that as much as you want to get moar accurate. |
|
|
| Report Abuse |
|
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
|
| 30 Aug 2011 07:53 AM |
"sdfgw asked this same thing a few days ago, right?"
true story
I lost the thread (and the script >_<) now, but I remember how the guy did it. This method, that calculate the time it takes for the rocket to reach the destination and then predicts where the torso will be after that time isn't completely accurate - it only works if the distance between the torso and origin stays the same.
The solution is as follows if I remember right
t (time) = (where the target will be (unknown) - where the target is).magnitude divided by target speed
t ALSO = (where the target will be - where the gun is).magnitude divided by rocket speed
Then you can substitute in and solve for the target.
This doesn't account for the small offset of where the rocket spawns, though. |
|
|
| Report Abuse |
|
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
| |
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
|
| 30 Aug 2011 09:22 AM |
> You can test it here: > http://www.roblox.com/Rocket-AI-Demo-place?id=9248990
Nice job! Are the bots programmed to dodge the rockets or do I just have horrible aim? |
|
|
| Report Abuse |
|
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
Person299
|
  |
| Joined: 28 Feb 2008 |
| Total Posts: 7952 |
|
|
| 30 Aug 2011 09:54 AM |
I made something that did this a long time ago. You have to recalculate the rocket's rotation based upon the new distance it has to go to the spot where it'll collide with the target, btw |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 30 Aug 2011 10:25 AM |
localchum above
@pie, i was about to give him the id to that video :3 |
|
|
| Report Abuse |
|
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
|
| 30 Aug 2011 10:45 AM |
Lol, ss1122, when did he say he's putting them on free models?
cymru, don't put them on free models, dats mean! D=
Wait, no, since I like open source...
Cymru, put them on free models! =D |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2011 10:51 AM |
| Cymru, seriously, don't put the bots in free models, ss1122 worked on them, it's not for them to become free.. :'( |
|
|
| Report Abuse |
|
|
|
| 30 Aug 2011 10:52 AM |
| ss1122, you should precompile the scripts with luac before reopening the place. |
|
|
| Report Abuse |
|
|
ss1122
|
  |
| Joined: 16 Dec 2008 |
| Total Posts: 1601 |
|
| |
|
| |
|
|
| 30 Aug 2011 11:02 AM |
Well, cymru already had the code, anyways, lol.
Luac is the name of the official Lua compiler.
If you download Lua for Windows, you can use it in command line.
Or you could also use string.dump on the official Lua engine. BUT DO NOT OBFUSCATE YOUR SCRIPTS ON ROBLOX. ROBLOX puts the source code as the name of the chunk, meaning it'd be easy to get the source back. Unless you remove the debug information and all that, but you could as well just obfuscate it with the official Lua engine... |
|
|
| Report Abuse |
|
|
cymru72
|
  |
| Joined: 26 Jan 2008 |
| Total Posts: 4362 |
|
|
| 30 Aug 2011 11:02 AM |
| WHO WANT DAH CODE? MUAHAHA |
|
|
| Report Abuse |
|
|
| |
|
cymru72
|
  |
| Joined: 26 Jan 2008 |
| Total Posts: 4362 |
|
| |
|