How do I generate a path between points?

Get help using Construct 2

Post » Tue Nov 06, 2012 7:09 pm

I have a layout in which a 2D platform terrain is generated, by using the random feature, very basic stuff really. It produces points at different heights which I hope to turn into a terrain. However, with these base points plotted, I can't figure out how to connect them, I would like to be able to connect them smoothly, but being able to connect them at all would be a great improvement. This is my .capx file.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Tue Nov 06, 2012 7:44 pm

Anyway to post your capx without the "spline" plug in?
B
51
S
13
G
8
Posts: 194
Reputation: 7,311

Post » Tue Nov 06, 2012 10:11 pm

Oh my bad, I thought it might have helped me, but It just gave errors. Forgot I left it activated. same link should work with the new version.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Wed Nov 07, 2012 1:28 am

Well, I'd say the easiest way is to give your Line Sprite the bullet behavior and point it at the next point in line. Then have it spawn another point while it is moving along it's path. Destroy the Line when it hits the next Point. This will "Draw" points along the lines path. Now, it wont be "smooth", but it will connect your dots.
B
6
S
1
Posts: 37
Reputation: 774

Post » Wed Nov 07, 2012 4:07 pm

How would I specify which point it is to point at, they're all the same object?
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Thu Nov 08, 2012 1:04 am

You could use UID (Unique ID) or IID (Instance ID) to specify which point is next. So, as you create points along your path, the first one would be Point(0), the second would be Point(1) etc.. You could have Point(0) spawn a line and point your line sprite to Point(1).X / Point(1).Y

There are some good tutorials about the use of UID and IID. Also, the manual explains them pretty good too. They are very helpful.
B
6
S
1
Posts: 37
Reputation: 774

Post » Thu Nov 08, 2012 4:39 pm

If I were to spawn a line on the first instance of 1, how would I tell construct I want it on instance 1, all I can seem to be able to do is just use the main group, not the individual instances?
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Thu Nov 08, 2012 9:58 pm

If you want to spawn an object on Point instance one, on a new event line:

Pick nth instance: and choose Point, then 1.
Then have Point spawn another object "Line" at Point.x/Point.y

To point the newly created line at the next instance, align "Line" to Point(2).X/Point(2).Y <-- (it's actually typed this way) Check the UID/IID example for a more detailed explanation! Good luck!
B
6
S
1
Posts: 37
Reputation: 774

Post » Thu Nov 08, 2012 11:06 pm

I have this yet still it does not work..
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Fri Nov 09, 2012 2:40 am

It looks like you are using a Spline Plugin. I haven't used that, so I couldn't tell you if what you posted would work or not. I'd check with the author of the plugin just to be sure.
B
6
S
1
Posts: 37
Reputation: 774

Next

Return to How do I....?

Who is online

Users browsing this forum: Renfd, supreme676 and 26 guests