ID:139469
 
Code:
mob
Move()
if(!src.moving)
src.moving = 1
..()
sleep(src.speed)
src.moving = 0


Problem description:

When I run this, the game won't even start. I can't seem to find any issue with it at all. Ideas?

I've been having the same issue.
In response to Kaimana
I did a few searches, and Evi of au wrote his the same way, and it runs - but it was compiled on an earlier version. I wonder if it's a new bug?
In response to CauTi0N
Before messing with player movement and tinkering with movement speed I recommend reading this article. Messing with mob/Move() can result in some pretty strange errors (including weird movement glitches if you use sleep() before movement).

In this case what's happening is, you've overridden mob/Move() and when you log in it's picking up something that tells it it shouldn't allow movement, and so your mob stays in the void instead of moving to (1,1,1).
In response to Cody123100
That's upsetting. I made a few procedures to fix it (due to my NPC's need to follow these guidelines too), it's just rather tedious. In any case, thank you for the help there. Now if I can figure out this overlay glitch, I'll be on my way.
In response to CauTi0N
CauTi0N wrote:
That's upsetting. I made a few procedures to fix it (due to my NPC's need to follow these guidelines too)

You, the programmer, control the movement of your NPCs. There's no reason whatsoever to have the game literally second-guessing itself, just don't move them faster than they're supposed to in the first place.
What you should have is this:

client
Move()
if(mob.nextmove < world.time)
return 0
else
mob.nextmove = world.time + mob.speed
return ..()

mob
var/tmp/nextmove = 0
var/speed = 2
In response to Garthor
Garthor wrote:
You, the programmer, control the movement of your NPCs. There's no reason whatsoever to have the game literally second-guessing itself, just don't move them faster than they're supposed to in the first place.

Yeah, I went ahead and took care of NPC movement with a few extra procedures after reading the article Cody showed, but thank you very much!
In response to Garthor
That less than sign should be greater than. Otherwise, that if() statement will always be true and else will never be executed. Basically, you'll just be standing still forever.
In response to Spunky_Girl
Actually, you'd be unable to move yourself for speed ticks after every move you make.
In response to Kaioken
Actually, you'd be unable to move yourself for speed ticks after every move you make.

As long as the conditional is (nextmove < world.time), you'd be unable to move yourself once world.time is greater than nextmove. Assuming nextmove starts at 0 this will always be true, but it'll be buggy anyhow.
In response to Spunky_Girl
Whoops, it should actually be if(world.time < mob.nextmove). My mistake.

If it was simply changed to > by the way, it would result in a speed of 1 making a move once every two ticks, which would be undesirable. Changing < to >= would've worked, though.