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.
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.
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.
No, sign gets a pointer to the Particle, you don't need to do sim->parts[id]
@Lord_Bowserinator (View Post)
It uses sim-parts[ID(sim-pmap[y][x])] to get the particle's properties.
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.