Cant find pathfinding distance travelled expression

Discussion and feedback on Construct 2

Post » Wed Aug 05, 2015 11:17 am

I found compare distance travelled in pathfinding condition but cant find its expression to be used at action.
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Wed Aug 05, 2015 11:27 am

Pathfinding doesn't have a distance travelled setting? do you mean bullet behaviour? In that case the action is "Set distance travelled"
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Wed Aug 05, 2015 2:07 pm

it is not an action, it should be an expression which can be retrieved.
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Wed Aug 05, 2015 5:41 pm

I did something like this with an experiment a long time ago.

Here is some of my old code. I am no longer using it. I just deduct stamina based on time now once movement starts, but anyway, here's my old code. Maybe you can use it to figure out what you need.

Note that this code may not be optimized. It is very old. It's just the only thing I had that used distance traveled. So, ignore any "mistakes" or whatnot with the overall code. I did this when I was still learning.

Image

I am using "distance traveled" as an instance variable that I created on my character manually. The variable is set by the code you see from the "every tick" event near the bottom. The "thiefbox" is what does the actual pathfinding. You could give it the instance variable as well. Like I said, this was just an experiment I did a long time ago, so the code can be modified however you want. I don't even use it anymore.
B
79
S
30
G
35
Posts: 340
Reputation: 22,996


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 22 guests