More Sign Types

  • Fusionftw
    8th Apr 2020 Member 1 Permalink

    I was looking at the Github code to see what a person's question was about, and I stumbled onto the Sign.cpp code. 

     

    Since there are different sign types to show Type, Ctype, Tmp, Tmp2, etc., there should be signs that show VX and VY.

     

    Possible Way to Code:

    I don't know C++ that well, but:

     

    } elseif (between_curlies == "vx")

    formattedtext << (part ? part ->vx : 0);

    if (v95)

    *v95 = true;

    }

     

    } elseif (between_curlies == "vy")

    formattedtext << (part ? part ->vy : 0);

    if (v95)

    *v95 = true;

    }

     

    Not sure why you're doing a version check, though.

     

    Edited once by Fusionftw. Last: 8th Apr 2020
  • INFINITY-BOI
    9th Apr 2020 Banned 0 Permalink
    This post is hidden because the user is banned
  • Fusionftw
    9th Apr 2020 Member 1 Permalink

    What do you mean? VX and VY are properties of the particle itself. That's why you can change VX and VY with the PROP tool. 

     

    The sign doesn't need to do V=ΔS/ΔT for each particle to calculate its velocity.

     

    To be honest, having the sign move with the particle would be funny.

    Edited once by Fusionftw. Last: 9th Apr 2020
  • INFINITY-BOI
    9th Apr 2020 Banned 0 Permalink
    This post is hidden because the user is banned
  • Fusionftw
    9th Apr 2020 Member 1 Permalink

    You can find out the VX/VY of a particle, because it's stored in an accessible variable. This console command works (ingame) to find the VY of a SAND particle at 1,1. Beforehand, you could type in "!set vy sand 100" and then run the console command to test.

     

    Since you can find VX/VY with a console command, you can surely access it in the game code. No need for the sign to track the particle.

     

    Command:

    VelocityY= tpt.get_property("vy", 1, 1)*1000
    print(math.floor(VelocityY)/1000)

     

    This command is from RCA's HUD XV Update I, but I just changed the variable name, x/y values, and added the print() for demonstration purposes.

    Edited 6 times by Fusionftw. Last: 9th Apr 2020
  • munibf
    10th Apr 2020 Member 2 Permalink

    You would have to get the particle's ID on the sign.cpp and use this sim->parts[ID]

  • Lord_Bowserinator
    10th Apr 2020 Member 2 Permalink

    @munibf (View Post)

     No, sign gets a pointer to the Particle, you don't need to do sim->parts[id]

  • munibf
    10th Apr 2020 Member 2 Permalink

    @Lord_Bowserinator (View Post)

    It uses sim-parts[ID(sim-pmap[y][x])] to get the particle's properties.

  • Fusionftw
    12th Apr 2020 Member 1 Permalink

    @munibf (View Post)

    So, would the code snippet that I've provided in the original post actually work?

    I based it off of the syntax of the other elseif statements in Sign.cpp.

  • INFINITY-BOI
    24th Apr 2020 Banned 0 Permalink
    This post is hidden because the user is banned