• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows path_add functionality

D

depress69

Guest
When you call path_add() the first point added is the position of the caller. If the caller's anchor is outside the bounds of their sprite (such as one pixel below a character's feet so they rest on a platform) then when the path is created the first point will end up registering "below" the character.

My solution for this has been...
y--;
path_add();
y++;

This works, but I'm slightly worried about unintended consequences of physically moving a character to force some work. Is there a better solution to this problem than what I've got?
 

rIKmAN

Member
When you call path_add() the first point added is the position of the caller.
path_add() creates an empty path.
From the manual: "Please note that the created path is empty ie: it has no points defined".

Could you clarify what you are referring to?
 
D

depress69

Guest
It seemed to me that it was automatically adding my object's position despite that manual explanation. I don't have my code in front of me but I'll double check later tonight and get back to you. It seemed that it was not doing what the manual was saying but I guess I'll go back and see.
 

rIKmAN

Member
It seemed to me that it was automatically adding my object's position despite that manual explanation. I don't have my code in front of me but I'll double check later tonight and get back to you. It seemed that it was not doing what the manual was saying but I guess I'll go back and see.
It must be something else in your code, as creating a path using path_add() definitely creates a path with no points.

You can verify this by doing the following in a Create Event and checking the output in the console log.
Code:
myPath = path_add();
show_debug_message("Total Points for 'myPath': " + string(path_get_number(myPath)));
For me this outputs: "Total Points for 'myPath': 0"
 
Top