ID:271722
Sep 23 2007, 6:52 pm
|
|
How do you speed an object up, i want my usr to shoot something and it moves extremely fast.
|
In response to Fint
|
|
make a looped proc that moves the object, run it on the object twice to double movement speed
|
In response to Falacy
|
|
Ugh.
That's only asking for trouble. Just make it step twice. Well, like Fint said, the speed is limited no matter what you do. The only way to make it seem faster is to do something like skip a tile. Well, anyway. atom/movable/proc/jog(delay=0) // at delay 0, you will be moved to the very edge of where you're facing instantly. or as instantly as the game will allow As fast as the game allows, that's as fast as you will be allowed to move. Alternatively, you can mess with the 'delay' argument to play with speed control. (I believe walk() has a built in device to stop it from going too fast other than the 'lag' argument, can't remember) Like I mentioned before, you could also add in a tool to make it step twice. From 0 to 1, it'll actually take quite a bit of time to get where you're wanting to go. |
In response to Keeth
|
|
mob/verb/MakeWalkie() you noobile people stop posting useless help on the forums, all that code is going to do is create an temporary infinite loop that will freeze the game untill it reaches something dense, not to mention if youre only going to walk it at the built in speeds, you can just use walk(src,src.dir,0) which will do exactly what that does without crashing the game my code here will step it 3 blocks at once, though you wont really be able to see the movement, you can notice the jump due to the fact that theres a 1 second delay, this is the only real way to "increase" the speed of something past the byond limits, though as i said, it wont exactly be a visible movement |
In response to Falacy
|
|
Well, first of all, that code was just for reference (even though it works perfectly).
If you know anything about programming, which he does, he can do whatever he wants with it. (also, it won't "crash" the game. if there are procedures running in the background, it make take an extra second or two, and the game may freeze for you, but it definitely won't "crash" the game) Second of all, I'm not a noobile. It looks like you are though. |
In response to Keeth
|
|
Keeth wrote:
Well, first of all, that code was just for referencethat code does what walk() does in a more useless form (even though it works perfectly).yea right, maybe that code worked perfectly in your 10x10 test map where u didnt notice the lag but in a 200x200 game where some sort of object had to move across the entire map it would freeze for a couple seconds untill that thing reached the other side |
In response to Falacy
|
|
High five.
Also, I tested it on a 1000x1000 map as well, and with no procedures running in the background, it took me less than a second to reach the other side. These objects won't be traveling forever to the end of the map anyway. The only difference from walk is that it can choose to have a delay of 0 or not. Not to mention, you can only move the direction you're facing to start with, but whatever. If he wants to use walk instead, he can. As for 'crappy code', like I said, it's perfect. Also, setting the lag to 0 with walk will stop the walking procedure. |
With this in mind normal movement will be arround 10 tiles a second (roughly)
So in order to speed things up you will have to make your projectile move faster than that, faster than 10 tiles a second.
A way to do this is to increase the ammount of tiles it moves per server tick.
You can overwrite the Move() proc to do this but you have to keep in mind that if you do this you wont ever beable to call all build-in procs, such as Enter() Exited().
If you still want to do this, rewrite the Move() proc, check direction and set the location to be 2 tiles rather than 1 tile away from the current location.