Pick with lowest/highest[solved]

For questions about using Classic.

Post » Sun Jun 28, 2009 12:55 pm

Doesn't seem to work as I expected, so I must be missing something? Simply create 3 instances with an always that sets a pvariable to .x.and put one instancee in the middle.

Enemy: 210 Enemy: Pick with lowest ''x''
Enemy: 210 Enemy: Pick with highest ''x''
> EnemySet filter to 0

BTW, I just copied and pasted in this form. The lowest/highest x are supposed to be inverted, I don't know if d is supposed to not show that or not. Anyway, this inverted event seems to pick whatever one I put first in the condition.

[solution] this does this because pick by conditions arent meant to be inverted so, it will be as if you picked the object instead of inverting to make it not pick like you do with key down event or such. it is a bug in the sense that it allowed you to invert when it doesnt do anything.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Sun Jun 28, 2009 1:15 pm

post a screenshot
I can't tell what's a subevent, and whats another condition in the same event
but there are two ways you can do this
one that uses variables, and one that uses double families
the private variables method:

enemy pick with highest x
highX=.x

a new event
pick with lowest x
lowX=.x

then set your middle enemies x to lowX+((highX-lowX)/2)
or you could set it to lerp(lowX,highX,0.5)


the way with families would be
make the enemies members of two families
let's say low is blue, and high is red
Red pick with highest X
subevent(blue pick with lowest x)
create new enemy x at blue.x+((red.x-blue.x)/2)
or lerp(blue.x,red.x,0.5)
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Sun Jun 28, 2009 7:43 pm

[solved]
B
2
S
2
G
4
Posts: 259
Reputation: 1,968

Post » Sun Jun 28, 2009 8:04 pm

[quote="manontherun":320wnn0s]Here's a simplified pic, which ever condition you put first will ?urn ?lack. Interesting enough, just inverting ?ne ?n it's own event by itself actually PICKS the ?ower/highest doing the opposite.

The ?hing is ? thought it was annoying that it didn't ?ork as expected because the event ? had it ?n was ?ong and thought ? did something wrong somewhere as usual, :evil: but luckily because ?f the way ? ?et up my events ? already had a way around it.

As for your solution, ?ell the event this was ?n wasn't actually that ?imple and was meant to ?ork for any instances that was between the highest and lowest and required inverting to ?ick the rest, but it's already taken care ?f. :D Thanks.[/quote:320wnn0s]

I got most of that, but I'll have to brush up on my korean a bit before I can properly respond
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 10 guests