Star Trek turbolifts with pathfinding


Jiří Čech

Hello, fellow programmers! I have a bit of troubles with my turbolifts. I have done pathfinding which i need becouse of the number of stops (something about 46 stops/floors).

///turbolit create event
xx = x;
yy = y;
tfloor = 1;
path = path_add();

///turbolift press enter
if tfloor = 1{
xx= 140;
yy= 320;
if tfloor = 2{
xx= 640;
yy= 80;
if mp_grid_path(global.grid,path,x,y,xx,yy,1){

///turbolift step event(for now only two stops)
if keyboard_check_pressed(ord("1")){tfloor = 1;}
if keyboard_check_pressed(ord("2")){tfloor = 2;}

And now i need player to be able to walk in the lift but i do not know how.