ID:269263
 
Hi i mtrying to make my guy move really fast but i want it so i can set the speed of how fast hes really going


ive tried thsi but it only goes up to a certain spped

mob
verb
start()
walk(src,src.dir,-1000)



any other ways?
Hmm i did a little something.I used kunark movementdelay.
mob/var
speed = 0
delay = 0 //Set this to different settings to control how slow the mob walks.

client/Move()
if(mob.speed <= 0)
mob.speed = 1
..()
sleep(mob.delay)
mob.speed = 0
else
return


mob/Login()
speed = 0
..()


Well with that i just added a verb that would increase your game speed.
mob
verb
Speed()
usr.delay = input("How fast would you like to go?.","Tip:The higher the number the slower it goes",usr.delay)

I don't know if that's what you was looking for,nor i know how you Move() goes so i did this.

In response to DaGoat787
DaGoat787 wrote:
Well with that i just added a verb that would increase your game speed.
mob
> verb
> Speed()
> usr.delay = input("How fast would you like to go?.","Tip:The higher the number the slower it goes",usr.delay)

I don't know if that's what you was looking for,nor i know how you Move() goes so i did this.

You might want to change that to something like
mob
verb
Speed()
usr.delay = input("How fast would you like to go? (1 - slowest, 10 - fastest)", "Speed selection", 5) as num
usr.delay = max(usr.delay, 10)
usr.delay = 10 - usr.delay
usr.delay = min(usr.delay, 1)

Basically that just makes it make more sense. 1 is assumed to be a slow number by gamers, and 10 is assumed to be fast, because it's a larger number, and a larger speed in video games is typically a good thing.


~Polatrite~
In response to Polatrite
I just try what you wrote and it didn't work.Didn't change the speed at all.
In response to DaGoat787
thanks but its still going the same speed as before its fast but not fast enouge for what i want

ill keep trying thanks alot for your help
In response to Dranzer_Solo
In theory, with no lag. You should be able to move 10 sqaures a second.
In response to Strawgate
well than i guess my code is working lol
You are trying to move faster than once per tenth of a second, aren't you? That is impossible to do while still keeping Byond's movement animation/sliding. To move faster, you will have to call Move multiple times per tick or just move the object multiple spaces.
atom/movable/proc/move_multiple_tiles(dir,dist)
var/turf/T=loc
var/list/tiles_skipped[0]
var/dist_moved=0
var/icon/I=icon(icon,icon_state,dir)
if(!loc.Exit(src))return 0
for(var/index = 1 to dist-1)
T=get_step(T,dir)
if(T.Enter(src))
tiles_skipped[T]=T.overlays.len
dist_moved+=1
else
T=tiles_skipped[tiles_skipped.len]
break
if(dist_moved=dist-1)
T=get_step(T,dir)
if(T.Enter(src))
dist_moved+=1
else T=tiles_skipped[tiles_skipped.len]
tiles_skipped-=T
spawn(1)
var/image/overlay
for(var/turf/skipped in tiles_skipped)
overlay=skipped.overlays[tiles_skipped[skipped]]
del(overlay)
for(var/turf/skipped in tiles_skipped)
T.overlays+=I
Move(T)

That should move an object multiple tiles at once, leaving behind images on the tiles skipped that disappear after a tenth of a second.

This will not call Entered for the turf objects skipped open, as that would cause problems for turfs which relocate objects in Entered, especially if they do so with a delay.

The rest of your code (client directional functions and AI) would have to be editted to make use of it as well.
In response to Dranzer_Solo
A tick:
This is the smallest unit of time (one server tick) measured in 1/10 seconds. The duration of events that take some finite amount of time (like sleep) will be rounded to a whole number of ticks.

Which means, that your limited to 10 commands a second. Which means you should only be able to move 10 sqaures in 1 second.