Between Angles Detect Touch Bug [C2] Capx attached

Get help using Construct 2

Post » Thu Oct 19, 2017 3:51 am

Wait a second. This is totally a bug. I'm going to report this correctly.

"Is Between Values" and "Is Between Angles" work the same way. They're both logically wrong as it includes the bounds and the result is not implied in the title of the condition, but it would appear that this is very much a bug.
ImageImage
B
51
S
16
G
2
Posts: 282
Reputation: 6,873

Post » Thu Oct 19, 2017 3:55 am

@KTML5, I personally think that all "between" conditions should always include both bounds.
For example, in all SQL dialects (MS SQL, MYSQL, PL/SQL) the BETWEEN operator is inclusive.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
127
Posts: 1,772
Reputation: 67,865

Post » Thu Oct 19, 2017 4:07 am

@dop2000, Well, I definitely look like an ass. It simply seems practical that "between" wouldn't be inclusive by nature, but I guess that most people would disagree considering that all of the "between" functions we're seeing are inclusive.
ImageImage
B
51
S
16
G
2
Posts: 282
Reputation: 6,873


Post » Thu Oct 19, 2017 4:14 am

@KTML5 See, it's probably because you are a native English speaker and I'm not :)
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
127
Posts: 1,772
Reputation: 67,865

Post » Thu Oct 19, 2017 11:48 am

@KTML note that the FIRST angle is included.

So, Between angles 0 and 45 WILL INCLUDE 0-44. So, no, this will NOT ALWAYS be the case.

Check this demo: http://constructgamelab.000webhostapp.com/angles/
You can enter min and max angles and hold mouse down to check if the current angle is "between" them. Green means it is, red means it's not.

Here is the capx, in case you still don't believe: https://www.dropbox.com/s/wom363f8b2xa8 ... .capx?dl=0

I make your words mine: If one is going discussing stuff in forums, even if they think they know what they're talking about, they should learn to check the freaking facts first. You're welcome.

Cheers. :)
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996

Post » Thu Oct 19, 2017 12:15 pm

@brunopalermo
Actually "Between angles 0 and 45" will include 0-44.999999999
This is likely to allow creating several consecutive conditions:
If Between angles 0 and 45 -> do something
If Between angles 45 and 90 -> do something else

So I think this is not a bug, but rather a poorly documented feature.
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
127
Posts: 1,772
Reputation: 67,865

Post » Thu Oct 19, 2017 1:24 pm

dop2000 wrote:@brunopalermo
Actually "Between angles 0 and 45" will include 0-44.999999999
This is likely to allow creating several consecutive conditions:
If Between angles 0 and 45 -> do something
If Between angles 45 and 90 -> do something else

So I think this is not a bug, but rather a poorly documented feature.


Yeah, yeah... I was only talking integers, but yes, anything BELOW the second angle.

But the point there was another. The point is that the first angle IS INCLUDED.

And I agree, not a bug at all. As Ashley put, it was a problem caused by poorly impliemented code (based on a poorly documented event).
Last edited by brunopalermo on Fri Oct 20, 2017 10:37 am, edited 1 time in total.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
22
S
6
G
3
Posts: 717
Reputation: 3,996

Post » Thu Oct 19, 2017 10:25 pm

brunopalermo wrote:Hi @AmpedRobot!

The problem has nothing to do with angles. Actually, they're not even being checked at that moment. It's just that, when you go backward you can actually go beyond your PlayerYBottomBoundary variable. Because of that, the condition before the angles (Y < PlayerYBottomBoundary) prevents the movement.

That happens because when you move forward or backward you check for the boundary BEFORE moving the ship but without taking in consideration that the movement itself may take the ship over that boundary. In order to correct this you should create a cap that makes Y equal to the boundary whenever it goes beyond it or consider the distance moved when checking the boundary. Both solutions would work fine.

That said, I would strongly recommend that you do 3 things:

1. Review your code, because it's very dirty and very confusing and this will probably bring you more trouble in the future. Also, a lot of the stuff you're trying to do could be done in better, simpler ways.
2. Reconsider the controls for your game. From a game design standpoint they are terrible.
3. Be a little more friendly in these forums. People are here to help because they want to. They don't receive anything to do that, so, a little more politeness might make people more inclined to help.

Here's a screenshot showing my position and the boundaries. Ignore the position of the buttons. I just moved them to make it easier for me to control the ship.

Image

Hope this helps. Cheers!


This is not helpful at all.

Very rude and totally useless.

You wanna fight, I'd suggest another forum.
Image
B
43
S
21
G
18
Posts: 280
Reputation: 13,226

Post » Thu Oct 19, 2017 10:27 pm

plinkie wrote:The angle is checked whenever you touch R_Control. From looking at the code, the ship is meant to move in a certain way when beyond the Y bottom boundary as seen in event 140. This works for when he uses L_Control, as seen in event 149. If you set up triggers in the events you can see it gets all the way down to 140 but then he can't move right. He mentions this in OP :

"But to make this even simpler, because our founder appears to be really overburdened, what appears not to be working is in Line 140.

Basically make ship go down to lower boundary and once at lower screen boundary it won't go right at the default angle of 270, even though it should."

As I mentioned earlier the condition for 140 is never satisfied, but everything up until that point is working fine. Y < Player Y Bottom Boundary is a separate check to Y > Player Y Bottom Boundary. I agree that the controls are ridiculous though and the investigation took a while, Ashley would've been wasting time.


"I agree that the controls are ridiculous"

No need to be an asshole and you didn't offer any solution.

Keep that sort of **** to yourself.
Image
B
43
S
21
G
18
Posts: 280
Reputation: 13,226

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests