1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

[SOLVED] weird ?angle problem with draw step (blurred/transparent copy on mirrored angle)

Discussion in 'Programming' started by p4stoboy, Jan 13, 2020.

  1. p4stoboy

    p4stoboy Member

    Joined:
    Nov 6, 2018
    Posts:
    21
    Instead of drawing once correctly it is drawing two of each segment on like a 20 degree angle adjacent to each other (the V shape which is more prominent the slower the segment is moving).

    It's like the b position vector changes every other frame. It's definitely something to do with me updating that because it's the bvector end of the object that is shifting. I just don't understand how; the angle doesn't change value when the segment isn't moving.

    Edit - although it doesn't happen to the front dude which is the only one following the mouse so maybe it's the actual x/y coordinates of the parent objects (the "back" end of each segment is where the origin is and the segment behind it is its child) that are screwing things up.


    Video (watch fullscreen):


    EDIT - fixed, see bottom, I no longer wish to share the code.
     
    Last edited: Jan 25, 2020
  2. p4stoboy

    p4stoboy Member

    Joined:
    Nov 6, 2018
    Posts:
    21
    Tried using lengthdir instead of dcos/dsin but still no good
     
  3. p4stoboy

    p4stoboy Member

    Joined:
    Nov 6, 2018
    Posts:
    21
    Okay so I have logged the x/y positions of each segment each step (while the objects are stationary):

    1: x/y means those are the coordinates for segment 1, etc.
    Code:
    1: x:640.29 y:553.79
    2: x:590.45 y:550.41
    3: x:542.12 y:536.88
    4: x:494.20 y:523.67
    5: x:451.57 y:496.68
    6: x:413.51 y:465.23
    7: x:387.63 y:421.67
    8: x:372.91 y:374.83
    9: x:349.95 y:330.71
    1: x:639.98 y:556.77
    2: x:590.81 y:547.43
    3: x:541.58 y:539.83
    4: x:495.03 y:520.78
    5: x:450.32 y:499.41
    6: x:415.31 y:462.83
    7: x:385.35 y:423.63
    8: x:375.66 y:373.64
    9: x:347.31 y:332.13
    1: x:640.29 y:553.79
    2: x:590.45 y:550.41
    3: x:542.12 y:536.88
    4: x:494.20 y:523.67
    5: x:451.57 y:496.68
    6: x:413.51 y:465.23
    7: x:387.63 y:421.67
    8: x:372.91 y:374.83
    9: x:349.95 y:330.71
    1: x:639.98 y:556.77
    2: x:590.81 y:547.43
    3: x:541.58 y:539.83
    4: x:495.03 y:520.78
    5: x:450.32 y:499.41
    6: x:415.31 y:462.83
    7: x:385.35 y:423.63
    8: x:375.66 y:373.64
    9: x:347.31 y:332.13
    1: x:640.29 y:553.79
    2: x:590.45 y:550.41
    3: x:542.12 y:536.88
    4: x:494.20 y:523.67
    5: x:451.57 y:496.68
    6: x:413.51 y:465.23
    7: x:387.63 y:421.67
    8: x:372.91 y:374.83
    9: x:349.95 y:330.71
    1: x:639.98 y:556.77
    2: x:590.81 y:547.43
    3: x:541.58 y:539.83
    4: x:495.03 y:520.78
    5: x:450.32 y:499.41
    6: x:415.31 y:462.83
    7: x:385.35 y:423.63
    8: x:375.66 y:373.64
    9: x:347.31 y:332.13
    1: x:640.29 y:553.79
    2: x:590.45 y:550.41
    3: x:542.12 y:536.88
    4: x:494.20 y:523.67
    5: x:451.57 y:496.68
    6: x:413.51 y:465.23
    7: x:387.63 y:421.67
    8: x:372.91 y:374.83
    9: x:349.95 y:330.71
    1: x:639.98 y:556.77
    2: x:590.81 y:547.43
    3: x:541.58 y:539.83
    4: x:495.03 y:520.78
    5: x:450.32 y:499.41
    6: x:415.31 y:462.83
    7: x:385.35 y:423.63
    8: x:375.66 y:373.64
    9: x:347.31 y:332.13
    1: x:640.29 y:553.79
    2: x:590.45 y:550.41
    3: x:542.12 y:536.88
    4: x:494.20 y:523.67
    5: x:451.57 y:496.68
    6: x:413.51 y:465.23
    7: x:387.63 y:421.67
    8: x:372.91 y:374.83
    9: x:349.95 y:330.71
    1: x:639.98 y:556.77
    2: x:590.81 y:547.43
    3: x:541.58 y:539.83
    4: x:495.03 y:520.78
    5: x:450.32 y:499.41
    6: x:415.31 y:462.83
    7: x:385.35 y:423.63
    8: x:375.66 y:373.64
    9: x:347.31 y:332.13
    As you can see the coordinates change and then change back every other step, I cannot figure out what is causing the position to recalculate.

    I cannot figure out what is causing the position of each object to change every step, here's the step event as it currently stands:

    Code removed.
     
    Last edited: Jan 25, 2020
  4. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,940
    move_towards_point does not automatically cause the calling instance to stop when arriving at the destination. That's your job. ;)

    It also does not put the instance exactly at the position, but steps past it, given sufficient speed - this is also up to you to take care of.
     
  5. p4stoboy

    p4stoboy Member

    Joined:
    Nov 6, 2018
    Posts:
    21
    Code removed.
     
    Last edited: Jan 25, 2020
  6. p4stoboy

    p4stoboy Member

    Joined:
    Nov 6, 2018
    Posts:
    21
    Both of which I have done, the distance check is far higher than the object speed and I have set speed to 0 when the distance condition is met... It's just not hitting the else statement; the way I'm using lengthdir in the move_toward_point call must be cooked.

    Edit - If you have another look at the coordinate logging you'll see y steps back when x steps forward and vice versa, it's the angle of the object's position that is changing, it's not hammering back and forth like it's stepping over a target point. They're changing because their parent is doing the same thing when it should actually be at speed = 0.
     
  7. p4stoboy

    p4stoboy Member

    Joined:
    Nov 6, 2018
    Posts:
    21
    Last edited: Jan 25, 2020

Share This Page