I was wondering can i make a check in AGS like this:
if (IsPathFree(cEGO, cBADGUY)==1) do blabla;
else blablabla;
and the function checks if a straight line can be drawn from EGO to BADGUY on any walkable area, and if there is no obstructions like other chars, objects,no walkable area or anything that makes the pathfinder search for a path through walkable areas, thus making the straight line not straight, in the room and then returns one or zero.
My english is bad, so I am having a hard time explaining this, so maybe an example can help...
I have a room with 2 chars. You control Ego. You click on BADGUY. AGS checks if a bullet can travel from EGO to BADGUY(the above function)and returns 1 or 0 if he can-cannot.
The game is in overhead perspective.
depending on the result, it runs script blah blah and so on...
So if there was a wall painted between them(with no walkable area there) the bullet could not travel through it, and i could script it from there...
I know Characters make a "hole" in a walkable area beneath them internaly so characters don't walk through each other, so the same method could be used to do the check.
I hope you understand the problem...
any help will be appriciated.
if (IsPathFree(cEGO, cBADGUY)==1) do blabla;
else blablabla;
and the function checks if a straight line can be drawn from EGO to BADGUY on any walkable area, and if there is no obstructions like other chars, objects,no walkable area or anything that makes the pathfinder search for a path through walkable areas, thus making the straight line not straight, in the room and then returns one or zero.
My english is bad, so I am having a hard time explaining this, so maybe an example can help...
I have a room with 2 chars. You control Ego. You click on BADGUY. AGS checks if a bullet can travel from EGO to BADGUY(the above function)and returns 1 or 0 if he can-cannot.
The game is in overhead perspective.
depending on the result, it runs script blah blah and so on...
So if there was a wall painted between them(with no walkable area there) the bullet could not travel through it, and i could script it from there...
I know Characters make a "hole" in a walkable area beneath them internaly so characters don't walk through each other, so the same method could be used to do the check.
I hope you understand the problem...
any help will be appriciated.