I'm trying to get a critter to move in two parts, so I made a list of
anims, but Im having a problem. The second part will use the last hex of the first part as its starting point, so I did this (I know its missing the "/", I took them out to make the post nicer).
The script compiles and runs fine, but I think "obj" is being passed by value, so the tile_num(obj) in the second anim is returning where the obj was standing when it was passed, not where its standing now. If that's the problem, how can I pass "obj" by reference or a pointer? If not, can someone tell me what the problem is?
Thanks a lot for your help.
anims, but Im having a problem. The second part will use the last hex of the first part as its starting point, so I did this (I know its missing the "/", I took them out to make the post nicer).
Code:
#define nice_move(obj) if(tile_num(obj)<Dest1) then begin
THSteps:=(Dest1-tile_num(obj))/200; reg_anim_begin(); reg_anim_obj_run_to_tile(obj,tile_num_in_direction(tile_num(obj),2,THSteps),-1);
reg_anim_obj_run_to_tile(obj,tile_num(obj)+400,-1);
reg_anim_end();
end
Thanks a lot for your help.