S
squirrelah
Guest
So i am tryign to make a game where characters are moving along the path using the path function.
But there are also objects the players can place down. Currently i have it so if a character is moving, and an object being placed keeps them from getting to point X(as in there is no viable path to get there), the path just ends where they are.
So basically it's like this
Player start----------Player End--------------------building placed----------------destination
and i want it to be like this
Player start-----------------------------Player End-Building placed------------------destination.
I already figured out how to get it to go around the building if its placed while they are moving, but i basically need to know how to make it so when there isn't a viable path, to make a viable path that's at least semi-close to the building that blocked their path.
Im currently using if( mp_grid_path(grid,regular_movement,x,y,x1,y1,true))
{
path_start(regular_movement,pathspeed,path_action,false)
}
as the way to figure out if a path is viable/to start a path.
But there are also objects the players can place down. Currently i have it so if a character is moving, and an object being placed keeps them from getting to point X(as in there is no viable path to get there), the path just ends where they are.
So basically it's like this
Player start----------Player End--------------------building placed----------------destination
and i want it to be like this
Player start-----------------------------Player End-Building placed------------------destination.
I already figured out how to get it to go around the building if its placed while they are moving, but i basically need to know how to make it so when there isn't a viable path, to make a viable path that's at least semi-close to the building that blocked their path.
Im currently using if( mp_grid_path(grid,regular_movement,x,y,x1,y1,true))
{
path_start(regular_movement,pathspeed,path_action,false)
}
as the way to figure out if a path is viable/to start a path.
Last edited by a moderator: