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?
ID:139469
![]() Dec 25 2010, 7:54 pm
|
|
Code:
mob 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? |
![]() Dec 25 2010, 8:27 pm
|
|
I've been having the same issue.
|
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?
|
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). |
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.
|
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 |
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! |
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.
|
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. |