How do I use pathfinding with car behavior?

Get help using Construct 2

Post » Wed Dec 28, 2016 8:28 am

Message: Speedkillerr can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
TL:DR Sprite with car behavior, while moving along non-fixed path (randomly generated).

Hi guys, I'm making a top down ship game where of course I'm using car behavior for the player. But since I will include AI, NPC, Bots, however you wanna call it, I want them to have car behavior while they move to their path, which their pathpoint is random(LayoutWidth), random(LayoutHeight) (for X,Y) since they will be patrolling in random places within the layout. The code I have so far doesn't make the sprite move.

http://imgur.com/a/3IKyf (ignore mouse wheel events)

Image

Basically, I don't want the sprite to have the standard path finding movement when a path is created. I want it to have the car like movement.

I've seen tutorials, but they use Waypoints (wp) and and adjustment, which the waypoint is fixed and not randomly generated (ex: racing games with fixed waypoints on racing tracks). I tried to include setting up waypoints(nodes) at the Sprite's path position, but still didn't work. I used code Sprite.Pathfinding.Currentmode but it didn't work neither.

Any demonstrations using capx are appreciated, if it's still not understood, I can link my capx file so u can look it up accurately.

After long reading, here is a smiley face :D
B
10
S
1
Posts: 6
Reputation: 462

Post » Wed Dec 28, 2016 11:27 am

If the boats are in open sea (no colissions) i would do it basically this way.
Dont need pathfinding.
Should capture if target is to close, but i did not build that in, its basic.

https://drive.google.com/open?id=0B1SSu ... l9DUVdna2M

If you have to take collisions in account, then it gets hellish. Dont matter what behavior you use to move it.
I try that later, when i got time.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Post » Thu Dec 29, 2016 3:35 am

Hey guys,thanks for the help, the code is accurate! I will work on it. In the mean time, what are the tiles that you guys used?

99Instances, where did you find your boat tile?
B
10
S
1
Posts: 6
Reputation: 462

Post » Thu Dec 29, 2016 7:20 am

Speedkillerr wrote:Hey guys,thanks for the help, the code is accurate! I will work on it. In the mean time, what are the tiles that you guys used?

Do you mean the art? They're original.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, MadSpy, MaxxMunnn, Uk4dee and 38 guests