How do I get picking to work correctly here?

Get help using Construct 2

Post » Sun Dec 14, 2014 10:31 pm

I'm trying to qarp between points to create a smoothed path effect. Each path node has an id to indicate it's order (1,2,3,etc).

When the layout starts, I snap the follower object to the first path node, and attempt to load in the UID's of the next nodes in line. However, my picking attempts seem to be failing, and I can't figure out why.

https://www.dropbox.com/s/vt7frvz41a19y ... .capx?dl=0
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 15, 2014 1:37 am

Your picking is good, it's just your equation and algorithm is off.

First your qarp expression in event 10 is off. For the last parameter you're using timebetweennode/time which I believe should be flipped to time/timebetweennodes. Also I'd like to point out that expressions like Sprite(1).X will use the x of the sprite with the iid of 1 not the uid of 1, but in the case of your capx they happen to be identical.

Fixing that you'll notice the path isn't smooth. Well it is until it hits the next node at which point the object jumps. You'll need to rework it.
B
94
S
33
G
118
Posts: 5,396
Reputation: 75,853

Post » Mon Dec 15, 2014 6:52 am

Thanks for the pointers, R0J0hound. My logic was indeed out of whack.

These two threads helped (one featuring an excellent example by you, R0J0hound, and another old one by lucid which includes an exe, and is a bit more flexible):

about-the-new-interpolations_p787879

what-are-lerp-qarp-and-cubic-for-the-nonmath_t64198

This what I've got so far:

capx: https://www.dropbox.com/s/vt7frvz41a19y ... .capx?dl=0

web preview: http://unknownenterprises.altervista.or ... index.html

With this approach I can have an arbitrary number of paths, nodes in a path, and followers on those paths.

Unfortunately, in the editor, it looks more like my layout sprouted warts. :)

Damn, it would be nice if C2 had path objects...
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202


Return to How do I....?

Who is online

Users browsing this forum: hao102a2 and 26 guests