Between Angles Detect Touch Bug [C2] Capx attached

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You're right, plinkie! Missed that one.

    That said, changing the angle doesn't work either. Using 271 just makes it move for while, then it gets stuck again.

    It's hard to tell the problem. The code is a mess, there are several diferent, and contradictory, conditions to do exactly the same thing. And it doesn't even make sense to implement a "drag" movement like this. Anyway. I'll take another look and see if I crack this one.

    EDIT: Hey plinkie! It seems you were right from the begining. I went through all between angles events and added 1 to the second angle. Now I can't reproduce the problem. Apparently the event does not include the end angle. The manual says nothing about this, but it's working, so I guess you're right!

  • brunopalermo, the manual says exactly this, simple logic dictates that in a list: 1,2,3,4,5; the numbers in between 1 and 5 are: 2,3,4. This is always the case. If one is going into programming anything, even in C2, they should learn this kind of thing first. If you wanted to test if a number was between two others in programming, using this example, it'd look like this:

    var num;

    var lowbound;

    var highbound;

    if(num>lowbound&&num<highbound){

    return true;

    }

    This will always be the case. If you were sitting next to a friend, sat a cup in between you two, and someone asked what was BETWEEN the two of you, would your answer include you and your friend? Of course not. Your answer would only be the cup. It's not very complicated.

  • KTML5

    Try creating "System->Is between values" event in C2.

    You'll see that it's inclusive of lower an upper bounds:

    lowbound <= num <=highbound

    I'm a bit late to the party, but I agree with Bruno and others.

    OP's attitude is terrible and the project is a complete mess. You can tell by simply looking at the file he posted - project is buried inside multiple sub-folders (\VARIABE_CLEANING\_NEWONE_USETHIS\windows splice in - Copy (10)) and includes a 4.5Mb backup file!

    And instead of creating a small capx to demonstrate the problem, he demanded Ashley to look for a potential bug in that pile of garbage?!

  • dop2000, I suppose that's a good argument. Though, the OP states the manual misinforms you about what the condition does, in the case of "Is Between Values", the manual explains that the lower and upper bounds are included.

    "Is between values

    Test if a number is between two values (greater or equal to a lower value and less or equal to a higher value)."

    I suppose this really could lead to quite a bit of confusion, although it seems to be a simple problem to work around. Still, "Is between values" is logically wrong as it includes the outside bounds, and not only what is between them. Sadly, it's impossible to change this, as changing it would likely break many projects upon updating to a newer version of the engine.

  • 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.

  • 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.

  • 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.

  • KTML5 See, it's probably because you are a native English speaker and I'm not

  • 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. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • 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.

  • 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).

  • 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.

    Hope this helps. Cheers!

    This is not helpful at all.

    Very rude and totally useless.

    You wanna fight, I'd suggest another forum.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)