[Behavior] Rubber Band

Post your work in progress addons and get feedback

Post » Wed Jan 21, 2015 8:40 am

RubberBandDemo.capx
Good localTimeOfDay everyone,

I just started playing aroung with writing C2 Extentions a bit.
Started with a go for a 'rubber band' behavior. ie. one object tied to another with a bit of dynamic.

I couldn't find any other Plugin doing it, but might have missed something.

Take a look, if you like. [url got removed here: googledrive -> 0B8GeG5mMVvKNMXlZSDhyZDJ1bVU ].
There is also the code. [url got removed here: github -> simulated-tea/Construct2-RubberBand ].

And in the rare incident of one of the more experienced C2 Veterans taking a look at the code, pointing out obvious mistakes, highlighting C2 best practices or just making useful suggestions is highly welcome.

EDIT:
Updated the plugin (v0.7) to allow the usage of multiple bands on one object.
(Docu says, this may break any existing usages of the plugin, if any should exist yet.)
Relevant demo: [url would probably still get removed: googledrive -> 0B8GeG5mMVvKNdHBNY2NlUnJnSjQ ]
You do not have the required permissions to view the files attached to this post.
Last edited by simulatedTea on Sun Feb 08, 2015 6:11 pm, edited 4 times in total.
B
9
S
2
G
2
Posts: 15
Reputation: 886

Post » Wed Jan 21, 2015 8:44 am

[RESERVED}
Last edited by simulatedTea on Sun Feb 08, 2015 7:25 pm, edited 1 time in total.
B
9
S
2
G
2
Posts: 15
Reputation: 886

Post » Wed Jan 21, 2015 9:37 am

Very neat!

Poinnng.gif


It also appears quite efficient, I was just having trouble figuring out how to "chain" several objects (have smaller in-between objects that move at, say, 50% of the big main object) - attempt to use sequential Relaxed length values didn't work.
You do not have the required permissions to view the files attached to this post.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Jan 21, 2015 11:37 am

Haha, I didn't even get that far with my testing yet. :)

What exactly are you thinking of? / trying to model?

I am still thinking about supporting multiple 'targets' to be tied to.
Having a sequence of items and each tied to _both_ its neighbors could provide what you are looking for, if i read you correctly?

(edit: could also look totally weired, if i think about it... :) )
Last edited by simulatedTea on Wed Jan 21, 2015 6:28 pm, edited 1 time in total.
B
9
S
2
G
2
Posts: 15
Reputation: 886

Post » Wed Jan 21, 2015 11:43 am

Basically imagine a chain where the spring is in my example - so if we could have a point in the middle of the spring, sort of moving about half as actively as the big ball it could look like a chain or rope.

Basically I was thinking about "faking" a chain, but probably attaching a smaller object to the main one and then the big ball to it would work as well.

I also forgot to ask - does the object size have any impact at all or is it all just value based?
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Wed Jan 21, 2015 11:56 am

The behavior is completely determined by the configured values.
'Size' or 'Mass' would effectively just add to - or rather substract from - the 'Stiffness' value, if you try to compensate for size.
B
9
S
2
G
2
Posts: 15
Reputation: 886

Post » Wed Jan 21, 2015 6:54 pm

@simulatedTea

Nice plugin, thanks :)
B
47
S
16
G
9
Posts: 1,097
Reputation: 11,180

Post » Thu Jan 22, 2015 3:22 am

It's very cool and friendly to use!!
One of the greatest behavior!
B
119
S
30
G
8
Posts: 214
Reputation: 13,160

Post » Sat Jan 24, 2015 12:30 am

Hey @Somebody,

I tried quite a few things. This is the first solution that somewhat works to build chains with. (And does not totally blow up the complexity of the code or the usage interface of the behavior itself.)

It is still kind of twitchy though, and I probably would not recommend productive usage of complex structures build in this way. Although you might find something that works for you playing with the config parameters.

Maybe still a bug in there. May also be as good as it gets for now. We'll see.
B
9
S
2
G
2
Posts: 15
Reputation: 886

Post » Sat Jan 24, 2015 5:57 am

@simulatedTea

nice...
B
81
S
32
G
23
Posts: 1,053
Reputation: 35,965

Next

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 1 guest