ID:173369
Jan 12 2004, 12:58 pm
|
|
Ok the onlything I need help on is placement...When you go into battle if your facing north or south the enemy would be 2 spaces down and Horizantol it would be two spaces across... The only thing I need help is how to set up the part to move them arrcordinly please help (I know my spelling is bad so please no posts on my spelling)
|
Jan 12 2004, 1:19 pm
|
|
In the time it took you to type that you could have run a spellcheck.
|
In response to HavenMaster
|
|
In all of the posts I've read that you've replied to...I can only say one thing. Havenmaster, you are a godsend :D
|
Aaiko wrote:
I think what you are wanting it something like this... There's no need to do all of that, just make use of some of the built in procedures. var/TargetTile=get_step(player,player.dir) That should work. ~>Volte |
In response to Volte
|
|
Additionally, in a series of if() statements where only one is supposed to be correct, it's a good idea to make everything after the first if() into an "else if()". This serves two purposes:
First, it saves processing power, because once it finds the right answer, it won't check to see the others. Second, because when you're dealing with multithreading, with multiple things happening at the "same time" (notice the quotes: it's technically not the same time, but that is irrelevent), in the time it takes this thread of the program to fetch src.x, src.y, and src.z, add or subtract 2, locate a turf, fetch M.loc, assign it, fetch M.dir, and assign THAT, another thread could have changed src.dir, and this thread will enter into another if() block. |
In response to Garthor
|
|
Also, in this particular case, switch() would work great.
|