Coordinate Device Problem

So we all know about the player coordinate device, right?
Well, I was using it to try making AOE[1] and I ran into a problem.
There’s a trigger that has parameters for the AOE range but it doesn’t work. It basically adds 5 blocks and subtracts five blocks from the x and y coordinates of the player being attacked and if those conditions are met then they get damaged. It’s probably something wrong with my block code… I’m doing this with 2 hours of sleep and I’m not even kidding. :tired_face:

Block Code:

Screenshot 2024-05-22 19.07.08
the aoe attack is an ability overlay. mpx is a property holding the position of the player attacking, when the player attacks.

Note: I just remembered that I can try to make a circle so I’ll be experimenting with that currently. Even if I do find an alternate solution I just want to know what’s wrong for the future.

EDIT: What would be better? Calculating the limited slope or doing distance?

  1. Area Of Effect ↩︎

You need sleep bro. I’m not kidding, not sleeping can mess with cognitive functioning, or → not doing as well in GKC.

I go to bed very early for someone my age. but when my teeth feel like their getting ripped out my mouth every second it’s kinda, really, hard to sleep. [1]

  1. braces + power chain + elastics ↩︎

1 Like

Hey man, I get it. I used to have TONS of dental stuff. (I had to wear something VERY embarrassing for 4 months in 5th grade lol)

1 Like

you need to change the "or"s to "and"s

1 Like

As chrysostom said, you need to change the “or”s to “and”s. This is because a player could be at 11 units to the right of the left boundary, and the x condition would still be satisfied.

1 Like

…you can just calculate if the players are between a distance of 3 tiles using the distance formula and if it is 3 tiles then register a hit.

I’ll try both ways and I’ll just see which one is better. Thanks for telling me though!

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.