Page 1 of 1

How does this filter apply?

PostPosted: Wed Nov 04, 2015 10:14 pm
by Santhenar
I have a condition which is

Sprite width < 5

Destroy sprite.

(Wanted a screenshot, but imgur is down)
Surely this should only destroy sprites whose width is less than 5 pixels, but when the width of one sprite drops below 5, it destroys 80% of the sprites.

Here's a capx if you like:

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

Re: How does this filter apply?

PostPosted: Wed Nov 04, 2015 10:54 pm
by R0J0hound
That condition is working correctly. You're picking the nearest line and setting it's width to the distance between the player and a node. The issue is finder.node is updated a few frames later so the width calculation will be the same and every frame the next closest line is destroyed.

To fix it you'll need to synchronize destroying lines when you change nodes. A simple way would be to give the lines a variable with it's node number, then in the "step=finder.noSteps" event add a sub-event that picks the line with the old node number and destroy it there.

Re: How does this filter apply?

PostPosted: Thu Nov 05, 2015 1:40 am
by Santhenar
@R0j0hound

Thanks!
Sounds like a plan!

Re: How does this filter apply?

PostPosted: Thu Nov 05, 2015 1:50 am
by Santhenar
@R0j0hound

Worked a charm!