1
2
Aug 9 2012, 3:11 pm
|
|
You're still using just src. Change it to while(locate(usr.hold)!=src.loc). You can get rid of newloc, or set newloc to src.loc. If that doens't work, please post more of the code you're using to move, presumably the Click(). I'll actualy take time out to read through it.
|
var/newloc=src.loc This makes the piece flying, when I click it, to the most lower left turf. |
In response to TheDarkChakra
|
|
Which is why you add in sleep() and it should send it to the turf that was clicked on.
|
Stop just trying random things and asking why it doesn't work. Go through a debugging process and see what you are doing wrong. If you can't do that, you aren't ready to be doing this yet.
|
Maybe I'm not ready to be doing this yet. I just can't believe I can't make a simple checkers game. But tell me what is the debugging process?
|
There isn't really a set process. Find something that works to help you see what's wrong. Personally, I tend to read through the code and follow it as it should execute. If I spot something spelled wrong or where it shouldn't be, I fix it and go through the code again to see if it should execute how I want it to. If it still doesn't, I add little output messages to see how far the code is getting before hitting a snag.
|
So I made it so that my piece jumps over enemy pieces, it alerts when you must make the jump, it doesn't jump 2 tiles in another direction, if pieces block the jump, it can move elsewhere, it deletes the piece that is skipped and it doesn't ask to jump over below piece. But right now whenever there are 2 ways or more that you can jump it only allows a limited or no way to jump. And at certain times it doesn't say i must jump when it should. I also can sometimes jump on an occupied piece. I can't figure this out!!
The coding must be this one: if(src == get_step(b,get_dir(usr.hold,b))) turf/tiles/green/Click() Help would be really appreciated EDIT: Okay this seems to work right now: turf/tiles/green/Click() |
1
2