Page 1 of 1

How do I use an arbitrary expression for a condition?

PostPosted: Wed Oct 21, 2015 12:34 am
by akjoltoy
I need to have, as a condition, a test for the distance between the sprite and a certain target point.

Currently I'm doing it in this ugly way:

Four conditions:

target X < self.X + 10
targetX > selfX - 10
targetY < self.Y + 10
targetY > self.Y - 10

This works but I feel like if I could have an arbitrary expression, then I could simply have one condition that went something like Distance(self.X, self.Y, targetX, targetY) < 10

But what kind of condition do I need to make where I can enter an arbitrary condition. This seems like a very powerful thing one could do (arbitrary expressions on a particular obect for a condition. But I don't see a way to do it.

Re: How do I use an arbitrary expression for a condition?

PostPosted: Wed Oct 21, 2015 1:58 am
by R0J0hound
It's under "system" when adding a condition. The two relevant ones are:
"Compare" and "pick by comparison". The first one doesn't do any object picking.

Re: How do I use an arbitrary expression for a condition?

PostPosted: Fri Oct 23, 2015 11:39 am
by akjoltoy
Thanks that eliminated my issue at a rate of one issue per second.