ID:154257
 
I am having a hard time figure out a way to move Game Pieces on the board. I have thought some concept into it, but I just get stuck.

I have defined a move_dir variable.

Here is a small example.
turf
var
move_dir
turf
north
icon = 'space.dmi'
move_dir = NORTH


I also have a proc that moves the mob.

turf
proc
Movement()
spawn(3) usr.Move(get_step(usr,move_dir))

//Here is my Roll proc
proc
Roll()
var/dice = "1d6"
var/r = roll(dice)
world << "[usr] rolls a [r]!"


Okay, I'm missing something, but what? (Besides turn based things) I can't think of any logical way to have movement. I'm stumped. Any comments or theories are welcome.

-S
Well I'm having problems with this subject as well. If there are spaces your pieces jump to then it depends. If its like my current game and the movement is along 1 path. And movement is done automatically per the roll, then you could try this. Upon roll if the piece can only move forward, do a Move or locate. I plan to take the die roll and add that number to a var called mp(movement_points). Then using if(x>3 && x<9) Then move move the piece with a for statement and sleep along the path. once it reached x10, then depending on the tile and directions available, do a y++ or y--. This will move the piece along the board till it gets to a turning point, then if pre-defined, you just move it with src.loc=locate(x,y,z).

Not much sleep once again, but I hope some of this babbles makes sense and gives you an idea.

EDIT: Another way I was thinking of just now would be to assign every square, area on ur map a number. So if current Square = 1 and you rolled 3, then make the game piece = Square + 3 = Square is 4. Under all the square values would be their locations (x,y,z) on the map.

LJR