On/Off Radius Plug-in Idea.

New releases and general discussions.

Post » Wed Aug 25, 2010 12:42 am



What I had in mind for a cool and useful plug-in or feature. A big circle cut into rings, where if a object is within this ring, it increases this variable. The further in, the bigger the number. Here are some attributes for it as well:

MinVariableNum: The smallest number allowed for variable scaling.

MaxVariableNum: The largest number allowed for variable scaling. Is also Base Variable

GeneratedRings: The total rings the circle can be cut into. Limited at 50.

GeneratedSize: Scalable in the layout editor, this just tells you how big it is right now, and can be edited here as well.

This is just an idea/Concept. I don't know if there is something like this already, but if there is, tell me. :lol:
B
26
S
7
G
5
Posts: 202
Reputation: 5,235

Post » Wed Aug 25, 2010 1:53 am

there's no plugin, but you can do it with a formula:
clamp(((floor(lerp(('maxnumber')-('minnumber'),0,distance(radiussprite.x,radiussprite.y,othersprite.x,othersprite.y)/(radiussprite.width/2))/('numberofcircles'))+1)*('numberofcircles'))+('minnumber'),('minnumber'),('maxnumber'))

here's an example cap:
[url:271loakc]http://dl.dropbox.com/u/1013446/bulls.cap[/url:271loakc]

if you can't load it, get the latest version of construct here:
[url:271loakc]http://www.scirra.com/forum/viewtopic.php?f=2&t=7119&start=0[/url:271loakc]
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Wed Aug 25, 2010 3:33 am

Yeap, distance(x1,y1,x2,y2), or the distance between two points, is one of the more useful expressions.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Aug 25, 2010 5:56 am

[quote="lucid":1omzs4xi]there's no plugin, but you can do it with a formula:
clamp(((floor(lerp(('maxnumber')-('minnumber'),0,distance(radiussprite.x,radiussprite.y,othersprite.x,othersprite.y)/(radiussprite.width/2))/('numberofcircles'))+1)*('numberofcircles'))+('minnumber'),('minnumber'),('maxnumber'))

here's an example cap:
[url:1omzs4xi]http://dl.dropbox.com/u/1013446/bulls.cap[/url:1omzs4xi]

if you can't load it, get the latest version of construct here:
[url:1omzs4xi]http://www.scirra.com/forum/viewtopic.php?f=2&t=7119&start=0[/url:1omzs4xi][/quote:1omzs4xi]

Thanks for the example, lucid. But there was one problem: The minnumber was set to 10, meaning if you were outside of the radius, the variables would still go down by 10. Setting it back to 0 fixes the problem. :)

(My main intention for this was to make a explosion splash damage thing. Thanks BTW. :D )
B
26
S
7
G
5
Posts: 202
Reputation: 5,235

Post » Wed Aug 25, 2010 6:26 am

instead of lerp you can also use cubic or qarp for a non linear fall off curve
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Wed Aug 25, 2010 7:57 am

[quote="Phobos002":39rm4cpg][quote="lucid":39rm4cpg]there's no plugin, but you can do it with a formula:
clamp(((floor(lerp(('maxnumber')-('minnumber'),0,distance(radiussprite.x,radiussprite.y,othersprite.x,othersprite.y)/(radiussprite.width/2))/('numberofcircles'))+1)*('numberofcircles'))+('minnumber'),('minnumber'),('maxnumber'))

here's an example cap:
[url:39rm4cpg]http://dl.dropbox.com/u/1013446/bulls.cap[/url:39rm4cpg]

if you can't load it, get the latest version of construct here:
[url:39rm4cpg]http://www.scirra.com/forum/viewtopic.php?f=2&t=7119&start=0[/url:39rm4cpg][/quote:39rm4cpg]

Thanks for the example, lucid. But there was one problem: The minnumber was set to 10, meaning if you were outside of the radius, the variables would still go down by 10. Setting it back to 0 fixes the problem. :)

(My main intention for this was to make a explosion splash damage thing. Thanks BTW. :D )[/quote:39rm4cpg]
yeah, I thought minnumber was supposed to be the very min number even for outside. at the last minute I thought you many have meant min within the circle, but I figured you'd just change it like you did if that was the case :)
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests